Skip to content

v0.1.22

Choose a tag to compare

@kuk-888 kuk-888 released this 26 Nov 15:18
· 4 commits to main since this release

Highlights / 本版亮点

⚡ 4× Faster Cold Starts & Real-Time Streaming Tool Calls / 冷启动提速 4× + 工具调用实时流式输出

  • Pre-Warmed Standby WebSocket Pool (standbyWs): Proactively maintains 1 session_established standby WebSocket per healthy enabled OAuth account (strictly bounded under AWS's 5-WS/account cap, evicted first under load, with 15s heartbeat, 12m OAuth token_refresh, and 10s first-response half-open proxy failover). Cold-start TTFT drops from ~3.5–11.3s down to ~1.6–1.95s (including residential SOCKS5 proxy accounts!). Can be opted out via STANDBY_WS_PREWARM=false.
  • Incremental <tool_call> Argument Streaming (All 3 Protocols): StreamingToolCallFilter now streams JSON arguments character-by-character as tokens arrive across OpenAI Chat Completions (delta.tool_calls), OpenAI Responses / Codex CLI (response.function_call_arguments.delta), and Anthropic Messages / Claude Code (input_json_delta), eliminating 8–60s blank-screen stalls when writing large files/patches while preserving 100% warm_incremental multi-turn continuity, single-tool enforcement (parallel_tool_calls: false / disable_parallel_tool_use: true), and on-the-fly JSON newline/trailing-comma repair.
  • Pipelined Cold Sends & Proxy Keep-Alive: Desktop cold dials pipeline user_message immediately after session_connect + federate_status (~400ms RTT saved); HTTP CONNECT and SOCKS5 proxy agents now enable keepAlive: true with 20s idle socket expiry and TCP_NODELAY, cutting 65KB OOB cold turns by ~35%.
  • Full-Pipeline Multimodal Concurrency: Parallelized remote image/file downloads (concurrency=4), sharp compression (concurrency=4), pre-lease SSRF URL checks (Promise.all), and OOB attachment uploads (concurrency=5, cutting 5-image upload TTFT by ~29%).
  • Zero-Disruption OAuth Token Renewal: Access tokens refresh proactively in the background 15 minutes before expiry, and hourly refresh_token rotation now migrates parked & standby WebSockets via rekeySlot instead of wiping active warm pools.

🛡️ Zero-502 Resilience Hardening / 高频 502 根因六连修

  • Single-Account / Exhausted-Pool Transient Self-Healing: Retries transient socket drops (1006), proxy resets, and session hiccups once with short jittered backoff instead of surfacing raw 502.
  • Accurate Upstream Error Separation: Narrowed Unexpected server response matching so WS 401/403 triggers OAuth force-refresh and WS 429 triggers rate-limit backoff rather than proxy misclassification; oversized payload/context errors return 400 invalid_request_error immediately without burning healthy accounts; 504 timeouts no longer blind-failover; unrecovered LimitExceededException / rate-limit errors map cleanly to 429 rate_limit_exceeded with Retry-After.
  • Upload & Control-Plane Reliability: Added jittered 429/5xx retries to OAuth upload-attachment, Web Cookie qbsproxy/uploads, and direct non-proxy fetch; fixed Web Cookie session_connect handshake in listChatAgentsForKey / createAndPublishCodingAgentForKey / updateAndPublishAgentForKey; gracefully finalize turns if upstream closes the socket immediately after delivering turn_usage + response text.

🖼️ Multimodal OAuth Upload Fixes (Fixes #8) / 图片与附件上传修复

  • Auto-Transcode Non-Allowlisted Image Formats: Narrowed OAuth direct-upload image allowlist to AWS Quick's actual supported formats (image/png, image/jpeg), automatically transcoding image/webp, image/gif, bmp, avif, etc. to high-quality JPEG via sharp (with explicit 400 invalid_image on corrupted inputs) and skipping empty 0-byte images.
  • MIME Normalization & Clear Upstream 400 Details: Normalized non-allowlisted text/* (e.g. text/typescript, text/css) and application/octet-stream extensions to AWS Quick's official upload MIME allowlist, and surfaced sanitized upstream 4xx error messages instead of bare status codes.
  • Documentation Hygiene: Upgraded sensitive screenshot masking in docs/screenshots/oauth-wizard.png and docs/screenshots/cookie-step1-curl.png to solid blocks.

Upgrade / 升级方式

  • Web Console One-Click Update / 网页一键热更新: Open Web Console → click the version badge in the top-left corner → Update Online (zero-downtime restart with automatic crash rollback).
  • Docker / GHCR:
    docker compose pull && docker compose up -d
    Multi-arch image: ghcr.io/kuk-888/aws-quick2api:0.1.22 (linux/amd64, linux/arm64).