Repository navigation
v0.1.20
中文更新说明
v0.1.20 是一次聚焦 协议 1:1 深度对齐、百号生产零丢号架构、双部署网页一键热更新、大上下文首字提速与近期社区 Issues 闭环 的重要版本升级。
✨ 核心新特性与重大改进
1. 双部署通用网页一键热更新(Docker + 宿主机全支持)
- 零
docker.sock、支持崩溃自动回滚:引入bootstrap.js轻量监管引导器,支持在 Web 控制台「版本信息」弹窗中一键在线拉取官方 GitHub Release 热更包(aws-quick2api-dist-v*.tar.gz)原地热重启或一键回滚,同时兼容 Docker 非 root 容器与宿主机 systemd / pm2 /npm start部署。 - 多层安全门禁:严格锁定官方仓库
kuk-888/aws-quick2api(防 RCE)、仅允许 GitHub HTTPS 域名、恒定时间 SHA-256 校验、防 Zip-Slip / 符号链接 / 解压炸弹安全解压、依赖指纹depsHash变更自动拦截引导升级镜像、支持DISABLE_SELF_UPDATE=true一键关闭;新版本若在启动校验期崩溃或超时未就绪,自动回滚至上一稳定版本或内置底包。 - Linux 百号
bootstrap.js兼容与路径统一:监管进程不再向execve环境变量展开.env(彻底规避 Linux 128KBE2BIG启动限制并让热重启实时读取最新.env),同时统一宿主机与容器的DATA_DIR解析。
2. 零丢号运行态存储架构(data/pool-state.json + 三层防线)
- 运行态拆分原子落盘:将号池凭证、代理、备注、Agent 绑定、OAuth 刷新令牌轮换、自动停用状态与策略设置迁移至
${DATA_DIR}/pool-state.json(150ms 防抖异步原子rename),彻底解决 Docker 单文件挂载./.env:/app/.env的EBUSY风险与只读.env(0444/:ro)报错问题。 - 三层零丢号防线:
- 首次启动自动从
v0.1.19.env无损迁移全部账号与元数据,并支持低频结构化变更(增删号 / 改配置 / OAuthrefreshToken轮换)异步镜像回可写.env,兼顾仅挂.env的手写docker run与降级回退; - 启动即检测
DATA_DIR写权限,遇EACCES立即 Fail-Fast 并打印chown -R 1000:1000 data .env修复命令; - Docker 容器未挂载持久化
/app/data卷时主动输出告警。
- 首次启动自动从
- Docker Compose 开箱即用:
docker-compose.yml默认启用多架构预构建镜像ghcr.io/kuk-888/aws-quick2api:latest(移除env_file:以支持 100+ 账号,支持docker compose pull && docker compose up -d直接启动)。
3. 社区 Issues 全面闭环(#1 / #2 / #5 / #6 / #8 / #10 / #11)
- #6 & #11(Anthropic
effort=max、进度条同步、百号扩展与审计日志持久化):- 完善思考强度优先级:
output_config.effort/reasoning_effort> 模型后缀(如quick-smart-max)>thinking.adaptive/budget_tokens,零隐蔽降级; - Anthropic
usage水位单调不缩水、支持/compact骤降自动重置,并按上游真实context_window的 80% 动态水位自动轮转热线程; - 新增
RequestTraceLogger纯元数据落盘持久化(${DATA_DIR}/request-traces.json),重启保留管理台「请求日志」,严格零提示词/思考/正文泄露,清空立即落盘。
- 完善思考强度优先级:
- #10(思考模式长时间卡死根治):
- 加固
turn-stream-runner全套看门狗:活跃 WSping/pong心跳判死、纯keepalive/status不重置内容空闲超时、runIdleTimeoutMs、分段纯thinking_delta上限保护、turn_usage后迟到事件自动重挂postUsageTimer; - 客户端 Ctrl+C 取消时发送原生
stop_generation(保留 350ms 线上传输宽限)并立即释放并发槽位。
- 加固
- #5 & #8(
quick-smart误拦治理与云端智能体批量同步):- 新增可选
SANITIZE_CLIENT_SYSTEM_PROMPT(默认false,不改写普通用户系统提示词);开启后对 Claude Code / Cursor / Kilo / Antigravity / ZCode 等重型 IDE 系统提示词做线性零回溯防误拦净化,同时 100% 保留<user_rules>业务规则; AUTO_REPHRASE_ON_CONTENT_FILTER采用纯英文领域中立重述模板,热会话走原生edit_message分支且严守原模型绝不降级,修复非流式重述偶发拼串问题;- 控制台新增「同步云端智能体」弹窗与
POST /v1/admin/keys/sync-agents(支持批量勾选、自定义名称/描述/指令、默认新增不覆写个人自定义助手、旧版Quick2API Bridge告警徽章与单账号热编辑),并引入WarmSessionPool槽位代次校验与全链路shortId归一化,热切换/更新 Agent 或 OAuth 换票时即时清理旧停泊连接、杜绝并发回泊竞态。
- 新增可选
- #1 & #2(三协议工具调用与 Codex / Claude Code 加固):
- 完整支持 Anthropic 20+ 工具 + MCP 长名 +
tool_reference+defer_loading、OpenAI Chat / Responses(Codexshell/apply_patch/customfreeform 参数与命名空间工具); - 统一在流式与非流式路径强制执行
parallel_tool_calls: false/disable_parallel_tool_use: true并对齐热池前缀哈希;围栏感知工具词法解析器与<decision>/<artifact>清洗器防标签泄漏;修复累计 >5 文件历史后的纯文本追问 400 问题。
- 完整支持 Anthropic 20+ 工具 + MCP 长名 +
4. 大上下文首字提速(TTFT 优化)与模块化架构重构
- OOB 附件上传与 WS 拨号握手并行:>46.5KB 大上下文或媒体走带外上传时,同步并行拨号 WebSocket 并完成
session_connect握手,重叠隐藏 ~0.9–1.0s 建连耗时(实测 180KB/320KB 冷传 TTFT 降低 ~19%–27%);同步开放 Web Cookie 账号 OOB.txt上传。 - 渐进 DLP 轮询与多模态并发:OAuth 附件 DLP 轮询改为渐进退避
[250, 400, 600, 1000, 1500]ms,文件与图片阶段并发上传。 - 热续传命中率加固:剥离历史消息内动态
<system-reminder>哈希漂移、修复单工具裁剪与 OAuth 换票引起的缓存失效,保障大上下文多轮会话稳定命中warm_incremental(首字 1.3–2.3s);flushEarly15s 定时器推迟至 OOB 上传完成并在切号/重试时立即重置,保真返回真实 HTTP 429/502 状态码。 - 核心引擎模块化:
engine.ts拆解为ws-transport、warm-session-pool、turn-stream-runner、turn-attachment-builder、turn-frame-builder、turn-protocol-state、media-utils等单一职责模块,并实现 AWS Quick 协议 1:1 对齐(含 S2C_chunked_frame重组与多步云端工具用量聚合)。
📦 无损升级指南
- Docker Compose 用户:直接执行
docker compose pull && docker compose up -d(请保留原有.env与./data目录,首次启动会自动无损迁移至data/pool-state.json)。 - 源码部署用户:
git pull && npm ci && npm run build,并重启服务(npm start已默认通过dist/src/bootstrap.js托管以开启网页一键热更新)。 ⚠️ 升级后建议:若此前使用旧版Quick2API Bridge助手,升级后可在后台「凭证管理 → 同步云端智能体」勾选账号一键升级为Coding Assistant;如使用重型编码 IDE 遇到quick-smart偶发误拦,可在「路由与策略」按需开启「客户端 System Prompt 防误拦净化」。
English Release Notes
v0.1.20 delivers 1:1 AWS Quick protocol alignment, zero-account-loss state persistence, dual-mode one-click Web self-update, large-context TTFT acceleration, and full resolution of recent community issues (#1, #2, #5, #6, #8, #10, #11).
✨ Highlights
1. Dual-Mode One-Click Web Self-Update (Docker & Host)
- Zero
docker.sock& automatic crash rollback: Introduces a thinbootstrap.jssupervisor enabling in-place hot updates and one-click rollback directly from the Web Console for both non-root Docker containers and host (systemd/pm2/npm start) deployments. - Defense-in-depth verification: Locked to official repo
kuk-888/aws-quick2api, GitHub HTTPS-only downloads, constant-time SHA-256 verification, hardened pure-Node tar-gz extraction (blocks Zip-Slip, symlinks, devices, Windows drive paths, and gzip bombs),depsHashnative-dependency gating,DISABLE_SELF_UPDATE=trueopt-out, and automatic rollback if a newly applied release crashes or fails to emitgateway_readywithin 25s. - Linux 100-account
bootstrap.jscompatibility:bootstrap.jsreads.envhints without expanding.envintofork()'sexecveenvironment (eliminating Linux 128KBE2BIGcrashes for 60–100+ OAuth accounts and ensuring.envedits reload on respawn) while unifyingDATA_DIRresolution between supervisor and server.
2. Zero-Account-Loss Runtime State (data/pool-state.json)
- Atomic runtime state split: Runtime credentials, proxies, labels, agent bindings, rotated OAuth refresh tokens, auto-disabled markers, and pool settings now persist atomically to
${DATA_DIR}/pool-state.json(150ms debounced atomic rename), eliminating Docker single-file.envbind-mountEBUSYissues and supporting read-only.env(0444/:ro). - Three-layer protection: Automatic lossless migration from
v0.1.19.env; best-effort mirroring of structural edits and OAuth token rotations back to writable.env(protecting.env-onlydocker runsetups and clean rollbacks tov0.1.19); fail-fast startup probe onDATA_DIRwith actionablechown -R 1000:1000 data .envhint onEACCES. - Out-of-the-box Docker Compose:
docker-compose.ymlnow defaults to the prebuilt multi-archghcr.io/kuk-888/aws-quick2api:latestimage withoutenv_file:(supporting 100+ OAuth accounts out of the box).
3. Community Issues Resolved (#1 / #2 / #5 / #6 / #8 / #10 / #11)
- #6 & #11 (
effort=max, usage meter sync, 100-account pool & persistent request traces):- Strict effort precedence (
output_config.effort/reasoning_effort> model suffix likequick-smart-max>thinking.adaptive/budget_tokens) with zero silent downgrades; - Monotonic Anthropic
usagefloor with/compactdrop detection and dynamic 80% upstreamcontext_windowwarm-thread rotation; - Metadata-only
RequestTraceLoggerpersistence (${DATA_DIR}/request-traces.json) surviving restarts with zero prompt/thinking/response content stored and immediate persistence onclear().
- Strict effort precedence (
- #10 (Thinking-mode 3–4h stall prevention):
- Hardened stream watchdogs in
turn-stream-runner: active WebSocketping/pongdead-socket detection, purekeepalive/statusexcluded from content idle resets,runIdleTimeoutMs, per-segmentthinking_deltacap, andpostUsageTimerre-arming across late events; - Native
stop_generationon client abort with a 350ms wire-flush grace window and instant concurrency-slot release.
- Hardened stream watchdogs in
- #5 & #8 (
quick-smartfalse-positive mitigation & Cloud Agent sync):- Opt-in
SANITIZE_CLIENT_SYSTEM_PROMPT(defaultfalse) linearly sanitizes heavy IDE wrappers (Claude Code, Cursor, Kilo, Antigravity, ZCode) while preserving<user_rules>business instructions; - Domain-neutral
AUTO_REPHRASE_ON_CONTENT_FILTERrecovers on the exact requested model via nativeedit_messagewarm branching with zero prompt logging and clean non-streaming reset; - New Web Console "Sync Cloud Agents" modal &
POST /v1/admin/keys/sync-agents(batch selection, custom name/description/instructions, safe default create-without-overwriting personal agents, legacyQuick2API Bridgebadge, single-account hot-edit), backed byWarmSessionPoolslot-generation guards and full-pathshortIdnormalization.
- Opt-in
- #1 & #2 (Tool calling & Codex / Claude Code hardening):
- Verified Anthropic 20+ tools, long MCP names,
tool_reference,defer_loading, and OpenAI Chat / Responses (shell,apply_patch,customfreeform tools, namespaced tools); - Enforces
parallel_tool_calls: false/disable_parallel_tool_use: trueconsistently across streaming, non-streaming, and warm-session prefix hashing; fixes >5 historical files plain-text follow-up 400s.
- Verified Anthropic 20+ tools, long MCP names,
4. Large-Context TTFT Acceleration & Modular Engine Architecture
- Parallel OOB upload + speculative WebSocket dial/handshake: Overlaps ~0.9–1.0s WS dial +
session_connecthandshake behind >46.5KB OOB.txt/media uploads (~19%–27% cold TTFT reduction on 180KB–320KB contexts), plus OOB.txtsupport for Web Cookie credentials. - Progressive DLP polling & concurrent media upload: Upgraded OAuth DLP polling to
[250, 400, 600, 1000, 1500]msbackoff and parallelized file + image attachment phases. - Warm-hit preservation & accurate HTTP error forwarding: Strips volatile
<system-reminder>blocks from prefix hashes, invalidates warm sessions on OAuthrekeySlotCredential, and defers/resets the 15sflushEarlytimer across OOB uploads and account failovers so 429/502 responses preserve real HTTP status codes andRetry-After. - Modular core: Refactored
engine.tsinto single-responsibility modules with full 1:1 AWS Quick wire alignment (S2C_chunked_framereassembly and multi-step cloud toolturn_usageaggregation).
📦 Upgrade Notes
- Docker Compose: Run
docker compose pull && docker compose up -d(keep your existing.envand./data; state migrates automatically todata/pool-state.json). - Source Deploy: Run
git pull && npm ci && npm run buildand restart (npm startnow launches viadist/src/bootstrap.jsfor Web self-update support).