feat(daemon): Advertise ACP preheat readiness - #7200
Conversation
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
🖼️ web-shell visual previewRendered against a mock daemon (no real backend): the PR base vs this PR head Screenshots · before / afterFull-resolution recordings (.webm) are attached to the workflow run. — Qwen Code · web-shell visuals |
🩺 serve daemon A/BBuilt the PR base vs this PR head
|
| field | PR base (before) | this PR (after) |
|---|---|---|
features[] |
— | "workspace_acp_preheat" |
features[] |
— | "workspace_acp_status" |
— Qwen Code · serve A/B
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
Reviewed. 1 Suggestion-level finding(s) could not be anchored to the diff; see the terminal output.
— qwen3.7-max via Qwen Code /review
Code Coverage Summary
CLI Package - Full Text ReportCore Package - Full Text ReportFor detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run. |
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
|
Thanks — agreed and fixed the actionable suggestion. Review feedback addressed
Verification: the focused workspace-service suite passes 87/87 tests, and the pre-commit format/lint gate passed. Resolved 0/0 review threads; the actionable finding was unanchored and created no inline thread. |
wenshao
left a comment
There was a problem hiding this comment.
Reviewed. Suggestions are inline. Not reviewed: build-and-test — Integration Tests (CLI, No Sandbox) was skipped in CI and its suite (integration-tests/cli/qwen-serve-routes.test.ts) did not run locally; its only PR-relevant assertion (the two new capability tags) is redundantly covered by the unit test server.test.ts, which ran and passed on the ubuntu Test leg.
— qwen-latest-series-invite-beta-v77 via Qwen Code /review
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
No issues found. LGTM! ✅
— qwen3.7-max via Qwen Code /review
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Review feedback addressed
Verification: focused workspace-service suite passes 87/87 tests; pre-commit Prettier and ESLint gate passed. |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
No issues found. LGTM! ✅
— qwen3.7-max via Qwen Code /review
wenshao
left a comment
There was a problem hiding this comment.
No issues found. LGTM! ✅
— qwen3.8-max-preview via Qwen Code /review
|
Released in v0.20.1. |

What this PR does
This PR advertises the existing primary-workspace ACP status and preheat routes as independent v1 capabilities, defines their point-in-time readiness and failure contract, and hardens concurrent preheat waiters so an HTTP timeout no longer clears the shared channel initialization. The TypeScript SDK now always sends these daemon control-plane calls over REST, while the Web UI only uses them when the daemon advertises support and the selected workspace exactly matches the primary workspace.
Preheat responses now preserve
ready === channelLive, use monotonic integer durations, sanitize client-visible failures while retaining detailed daemon logs, and reject malformed present timeout parameters instead of silently using the default.Why it's needed
Released clients could not discover these routes, ACP transports could misroute REST-only control calls, and a short waiter could clear service-level single-flight state while the bridge continued starting the same child. That made capability negotiation and retry behavior ambiguous and could cause clients to touch the primary runtime while operating on a secondary workspace.
This PR establishes the compatibility boundary required before any client-side timing change. It does not move preheat earlier, await it before first Session creation, add a readiness lease, or add workspace-qualified ACP routes.
Reviewer Test Plan
How to verify
qwen servenormally and with deferred runtime initialization failure, then confirm/capabilitiesadvertises bothworkspace_acp_statusandworkspace_acp_preheatin each case.reason: "timeout"without starting a second child, while the longer waiter should still be able to observe the live channel. After a settled initialization failure, a later request should be allowed to retry.npm run build,npm run bundle,npm run typecheck, andnpm run lint. All should pass.Evidence (Before & After)
N/A — this changes daemon protocol semantics, client compatibility, documentation, and tests without changing the TUI.
Tested on
Environment (optional)
macOS with Node.js v22.22.3 and npm 10.9.8; local release build and bundled CLI, with the packaged serve integration tests run without a sandbox.
Risk & Scope
Linked Issues
Part of #4748
中文说明
本 PR 做了什么
本 PR 将现有的主工作空间 ACP 状态与预热路由分别声明为独立的 v1 capability,定义其时点型 readiness 与失败契约,并强化并发预热等待者的 single-flight 语义,使单个 HTTP 请求超时后不再清除仍在执行的共享 channel 初始化。TypeScript SDK 现在始终通过 REST 发送这两个 daemon control-plane 请求;Web UI 仅在 daemon 明确声明支持,并且当前所选工作空间与主工作空间完全一致时使用它们。
预热响应现在始终满足
ready === channelLive,使用单调时钟生成整数毫秒耗时,对客户端可见的失败信息做脱敏处理,同时在 daemon 日志中保留详细错误;当 timeout 参数存在但格式错误时会直接拒绝,而不是静默使用默认值。为什么需要
已发布客户端此前无法发现这些路由;ACP transport 可能错误地路由仅支持 REST 的控制调用;短超时等待者还可能在 bridge 仍继续启动同一个子进程时清除 service 层的 single-flight 状态。这使 capability 协商与重试语义存在歧义,也可能导致客户端在操作次级工作空间时误触主 runtime。
本 PR 建立后续任何客户端触发时机调整所必需的兼容性边界。它不会提前触发预热、不会在创建首个 Session 前等待预热、不会增加 readiness lease,也不会增加按工作空间限定的 ACP 路由。
Reviewer 测试计划
如何验证
qwen serve,确认两种情况下/capabilities都声明workspace_acp_status与workspace_acp_preheat。reason: "timeout"且不启动第二个子进程,长等待者仍应能观察到已存活的 channel。初始化最终失败后,后续请求应允许重试。npm run build、npm run bundle、npm run typecheck和npm run lint,所有检查都应通过。证据(Before & After)
N/A —— 本 PR 修改 daemon 协议语义、客户端兼容性、文档与测试,不改变 TUI。
测试平台
环境(可选)
macOS,Node.js v22.22.3,npm 10.9.8;使用本地 release build 与 bundled CLI,打包后的 serve integration tests 在关闭 sandbox 的条件下运行。
风险与范围
关联 Issue
属于 #4748 的一部分