qwen-code/docs/design
ranzhenyu cf42ab6b7e
feat(acp): expose tool-call preparation lifecycle (#6819)
* feat(acp): expose tool-call preparation lifecycle

Why:
ACP clients receive no signal while providers stream tool arguments, making long calls appear stalled and delaying tool-identity policy decisions.

What:
- attach transient preparation metadata for Anthropic and OpenAI-compatible streams
- emit correlated ACP pending, execution, and discarded lifecycle updates
- preserve normalized call IDs across partial chunks and provider ID reuse
- clear abandoned retry calls and keep cleanup failures from terminating healthy retry/fallback streams
- deduplicate suppressed preparations and protect completed remapped parser buffers
- cover multi-tool Anthropic streams, ID reservation, TodoWrite suppression, retry cleanup, cancellation, and stream failure

Impact:
The metadata is additive and consumed only by ACP. It exposes no partial arguments, is not persisted to conversation history, and does not move permissions, hooks, scheduling, or execution ahead of complete function calls.

Tests:
- Core provider and stream suites: 649 passed
- ACP lifecycle suites: 316 passed
- npm run build
- npm run typecheck
- npm run lint:ci
- changed-file Prettier and git diff checks

Refs: #6775

* fix(acp): stabilize tool preparation lifecycle updates

Why:
- ACP cleanup failures must not convert a successful model stream into a failed prompt.
- A prepared tool call must be updated in place when execution starts instead of creating a second card.

What:
- Preserve the primary stream outcome when preparation cleanup fails and remove duplicate message display finalization.
- Track prepared call IDs so execution starts use tool_call_update, guard empty preparation metadata, and cover late stable IDs.

Impact:
- Ordinary tool calls keep their existing tool_call start frame.
- Streaming parser production behavior is unchanged.

* Update packages/cli/src/acp-integration/session/Session.test.ts

overrides参数在createPreparationResponse中被声明但从未使用——所有11个调用点仅传递callId且toolName. 该as GenerateContentResponse强制类型转换会绕过对始终为空对象的结构化类型检查。

Co-authored-by: qwen-code-ci-bot <qwen-code-ci@service.alibaba.com>

* fix(acp): harden preparation lifecycle handling

Why:
- A malformed test helper prevented the preparation lifecycle suite from compiling.
- Duplicate preparing frames and state cleanup need direct regression coverage.

What:
- Repair the preparation response helper and isolate cleanup warning assertions.
- Suppress duplicate preparing frames and cover terminal cleanup plus missing tool call IDs.

Impact:
- Normal preparation and execution transitions remain unchanged.
- Repeated preparation frames for the same call ID are now ignored.

---------

Co-authored-by: qwen-code-ci-bot <qwen-code-ci@service.alibaba.com>
2026-07-15 00:40:02 +00:00
..
adaptive-output-token-escalation fix(core): stop repeated truncated write_file/edit retries from looping (#5934) 2026-06-27 12:17:12 +00:00
auth refactor(cli): provider-first auth registry with unified install pipeline (#3864) 2026-05-08 12:19:28 +08:00
auto-memory fix(core): prevent OOM in auto-memory extraction during /quit (#5147) (#5181) 2026-06-19 08:17:45 +08:00
channels feat(channels): add dmPolicy config to disable private/DM messages (#6521) 2026-07-08 12:01:10 +00:00
compact-mode feat: optimize compact mode UX — shortcuts, settings sync, and safety (#3100) 2026-04-16 09:29:24 +08:00
compaction-image-stripping feat(core): strip inline media before chat compaction summary (#4101) 2026-05-14 10:20:11 +08:00
ctrl-o-detail-expand feat(serve): add workspace persisted transcript reader (#6740) 2026-07-12 10:39:05 +00:00
customize-banner-area feat(cli): customize banner area (logo, title, hide) (#3710) 2026-05-07 10:17:53 +08:00
daemon-acp-http feat(daemon,sdk): resumable /acp session stream (Last-Event-ID) + opt-in SDK transports export (#5852) 2026-06-30 02:07:48 +00:00
daemon-session-artifacts feat(serve): add workspace persisted transcript reader (#6740) 2026-07-12 10:39:05 +00:00
daemon-sidechannel-coordination docs(design): daemon side-channel coordination (A1/A2/A4/A5) (#4511) 2026-07-05 09:43:46 +00:00
daemon-transport-abstraction feat(serve): add daemon idle detection to GET /health?deep=true (#4934) 2026-06-18 06:55:03 +00:00
fork-subagent feat(core): implement fork subagent for context sharing (#2936) 2026-04-14 14:27:38 +08:00
hot-reload Feat: LSP Server support hot reload (#5953) 2026-07-05 13:50:00 +00:00
performance perf(cli): defer startup prefetch tasks (#6303) 2026-07-07 15:31:55 +00:00
prompt-cache feat(core): stabilize tool schema declaration order (#6339) 2026-07-05 12:24:59 +00:00
prompt-suggestion fix(followup): prevent tool call UI leak and Enter accept buffer race (#2872) 2026-04-09 00:07:03 +08:00
rt-optimization feat(telemetry): foundation for skill-based RT optimization (P0+P1) (#4565) 2026-05-29 02:17:40 +08:00
session-crash-recovery feat(core): add unified session recovery planning (#6731) 2026-07-11 11:15:40 +00:00
session-idle-reaper feat(daemon): merge daemon-mode feature batch into main (#4490) 2026-06-12 00:34:49 +08:00
session-recap feat(daemon): merge daemon-mode feature batch into main (#4490) 2026-06-12 00:34:49 +08:00
session-title fix: Make chat recording failures durable and visible (#6743) 2026-07-12 10:52:26 +00:00
skill-nudge feat(memory): add autoSkill background project skill extraction (#3673) 2026-05-09 14:25:02 +08:00
slash-command feat(cli): improve slash command discovery (#3736) 2026-05-09 14:25:44 +08:00
standalone-clipboard-native-addon/assets fix(packaging): bundle clipboard addon in standalone builds (#6708) 2026-07-11 15:18:24 +00:00
structured-output docs: user + design docs for --json-schema structured output (#4051) 2026-05-17 23:10:34 +08:00
tool-use-summary feat(tui): partition tool display by type — collapse read/search, show mutation tools individually (#5661) 2026-06-25 12:44:50 +00:00
virtual-viewport feat(cli): virtual viewport for long conversations on ink 7 (#4146) 2026-06-02 13:57:17 +08:00
2026-05-15-async-memory-recall-design.md fix(core): decouple auto-memory recall from main-agent request path (#4172) 2026-05-19 13:58:58 +08:00
2026-05-21-memory-pressure-monitor-design.md docs: consolidate design docs and plans under docs/ (#6417) 2026-07-07 06:05:05 +00:00
2026-05-26-daemon-logger-design.md docs: consolidate design docs and plans under docs/ (#6417) 2026-07-07 06:05:05 +00:00
2026-05-27-daemon-workspace-service-design.md docs: consolidate design docs and plans under docs/ (#6417) 2026-07-07 06:05:05 +00:00
2026-06-12-session-shell-permission-policy.md docs: consolidate design docs and plans under docs/ (#6417) 2026-07-07 06:05:05 +00:00
2026-06-13-file-history-snapshot-persistence.md docs: consolidate design docs and plans under docs/ (#6417) 2026-07-07 06:05:05 +00:00
2026-06-15-simulated-sed-file-history.md docs: consolidate design docs and plans under docs/ (#6417) 2026-07-07 06:05:05 +00:00
2026-06-23-fix-conflicts-command.md docs: consolidate design docs and plans under docs/ (#6417) 2026-07-07 06:05:05 +00:00
2026-06-24-daemon-clientid-self-heal-design.md docs: consolidate design docs and plans under docs/ (#6417) 2026-07-07 06:05:05 +00:00
2026-06-24-stream-inactivity-timeout-design.md docs: consolidate design docs and plans under docs/ (#6417) 2026-07-07 06:05:05 +00:00
2026-06-30-unified-reasoning-effort-cli.md docs: consolidate design docs and plans under docs/ (#6417) 2026-07-07 06:05:05 +00:00
2026-07-01-channel-lifecycle-status-adapters.md docs: consolidate design docs and plans under docs/ (#6417) 2026-07-07 06:05:05 +00:00
2026-07-01-channel-lifecycle-status-umbrella.md docs: consolidate design docs and plans under docs/ (#6417) 2026-07-07 06:05:05 +00:00
2026-07-01-channel-p0-identity-task-lifecycle-design.md docs: consolidate design docs and plans under docs/ (#6417) 2026-07-07 06:05:05 +00:00
2026-07-05-large-frame-handling-measurement.md docs: consolidate design docs and plans under docs/ (#6417) 2026-07-07 06:05:05 +00:00
2026-07-06-session-start-profiler.md docs: consolidate design docs and plans under docs/ (#6417) 2026-07-07 06:05:05 +00:00
2026-07-07-bounded-replay-snapshot-window.md feat(serve): Add cursor-paged transcript replay endpoint (#6525) 2026-07-10 16:34:43 +00:00
2026-07-09-webshell-user-message-input-annotations.md feat(web-shell): render composer references in user messages (#6537) 2026-07-11 17:44:47 +00:00
2026-07-11-daemon-persistent-workspace-registration.md feat(serve): persist dynamic workspace registrations (#6716) 2026-07-11 16:49:40 +00:00
2026-07-11-daemon-workspace-runtime-removal.md feat(serve): support runtime workspace removal (#6745) 2026-07-13 15:43:38 +00:00
2026-07-11-managed-memory-microcompaction.md fix(core): preserve managed memory during microcompaction (#6714) 2026-07-11 15:58:54 +00:00
2026-07-11-tool-call-preparing-events.md feat(acp): expose tool-call preparation lifecycle (#6819) 2026-07-15 00:40:02 +00:00
2026-07-13-workspace-skills-installed-path.md feat(serve): expose skill installation paths (#6811) 2026-07-13 09:29:09 +00:00
2026-07-14-silent-command-heartbeat.md feat(core): emit liveness heartbeats for silent foreground shell commands (#6876) 2026-07-15 00:07:26 +00:00
auto-compaction-threshold-redesign.md feat(core)!: redesign auto-compaction thresholds with three-tier ladder (#4345) 2026-05-25 21:11:08 +08:00
chat-recording-failure-observability.md fix: Make chat recording failures durable and visible (#6743) 2026-07-12 10:52:26 +00:00
custom-api-key-auth-wizard-prd.md docs(auth): add custom API key wizard PRD (#3583) 2026-05-13 14:04:41 +08:00
daemon-channel-runtime-control.md feat(cli): Add runtime daemon channel control (#6741) 2026-07-13 02:53:27 +00:00
daemon-extension-at-mention.md docs: consolidate design docs and plans under docs/ (#6417) 2026-07-07 06:05:05 +00:00
daemon-extension-install-interactions.md feat(web-shell): add extension management page (#6815) 2026-07-14 08:31:13 +00:00
daemon-idle-detection-api.md feat(loop): wire prompt-only /loop to self-paced wakeups (#5197) 2026-06-18 18:36:24 +08:00
daemon-multi-workspace-phase1-registry.md docs: consolidate design docs and plans under docs/ (#6417) 2026-07-07 06:05:05 +00:00
daemon-multi-workspace-phase2a-sessions.md fix(serve): Route session continue, language, and artifacts by owner (#6833) 2026-07-13 23:11:50 +00:00
daemon-multi-workspace-phase4-acp.md feat(cli): workspace-qualified ACP transport (daemon multi-workspace phase 4) (#6621) 2026-07-11 00:24:01 +00:00
daemon-multi-workspace-phase4b-channel-workers.md feat(cli): group daemon channel workers by workspace (phase 4b) (#6635) 2026-07-11 13:08:02 +00:00
daemon-multi-workspace-phase4b-voice.md feat(serve): Add workspace-qualified Voice (#6839) 2026-07-14 03:42:58 +00:00
daemon-multi-workspace-session-export.md feat(serve): Add workspace-qualified session export (#6844) 2026-07-14 03:50:06 +00:00
daemon-multi-workspace-session-file-ops.md feat(serve): support multi-workspace rewind and shell (#6826) 2026-07-13 15:32:44 +00:00
daemon-multi-workspace-session-organization-mutations.md fix(cli): Scope session organization mutations by workspace (#6724) 2026-07-11 12:25:16 +00:00
daemon-session-runtime-status.md feat(daemon): expose session runtime status (#6645) 2026-07-10 10:15:12 +00:00
daemon-skill-toggle.md feat(daemon): add workspace skill toggle API (#6816) 2026-07-14 02:59:13 +00:00
daemon-untrusted-workspace-session-catalog.md feat(serve): Expose read-only untrusted session catalogs (#6717) 2026-07-11 15:28:41 +00:00
daemon-workspace-remember.md fix(memory): allow forget to remove user managed memory (#6432) 2026-07-08 09:51:36 +00:00
declarative-agents-port.md docs: consolidate design docs and plans under docs/ (#6417) 2026-07-07 06:05:05 +00:00
extension-file-reload.md feat: extension file reload — watch for plugin changes and hot-reload runtime (#6347) 2026-07-08 11:16:21 +00:00
extension-management-v2.md feat(serve): add extension management v2 (#6825) 2026-07-14 03:30:47 +00:00
f2-mcp-transport-pool.md refactor(cli): rename serve files to kebab-case (#5592) 2026-06-22 13:13:07 +08:00
issue-4479-token-usage-stats-coordination.md feat(stats): expose token usage for cost visibility (#4564) 2026-06-19 07:14:07 +08:00
markdown-syntax-extension.md feat(cli): expand TUI markdown rendering (#3680) 2026-05-07 16:24:13 +08:00
openrouter-auth-and-models.md refactor(cli): remove legacy qwen auth CLI subcommand, redirect to /auth TUI dialog (#3959) 2026-05-11 16:44:09 +08:00
prompt-queue-backpressure.md docs: consolidate design docs and plans under docs/ (#6417) 2026-07-07 06:05:05 +00:00
serve-server-final-split.md docs: consolidate design docs and plans under docs/ (#6417) 2026-07-07 06:05:05 +00:00
serve-server-split.md docs: consolidate design docs and plans under docs/ (#6417) 2026-07-07 06:05:05 +00:00
session-group-custom-hex-colors.md feat(web-shell): support custom Hex session group colors (#6752) 2026-07-12 10:41:17 +00:00
skill-required-capabilities.md docs(web-shell): document chart renderer integration (#6353) 2026-07-06 04:55:26 +00:00
standalone-clipboard-native-addon.md fix(packaging): bundle clipboard addon in standalone builds (#6708) 2026-07-11 15:18:24 +00:00
telemetry-llm-request-timing-design.md feat(telemetry): Phase 4b — retry visibility for qwen-code.llm_request (#3731) (#4432) 2026-06-05 13:45:47 +08:00
telemetry-outbound-propagation-design.md feat(telemetry): client-side HTTP span + opt-in W3C traceparent propagation (#4384) (#4390) 2026-05-25 22:16:54 +08:00
telemetry-resource-attributes-design.md feat(telemetry): support custom resource attributes and add metric cardinality controls (#4367) 2026-05-21 13:54:37 +08:00
telemetry-subagent-spans-design.md feat(telemetry): Phase 3 — qwen-code.subagent span with concurrent isolation (#3731) (#4410) 2026-06-05 17:12:34 +08:00
tui-spacing-density-pr1.md docs: consolidate design docs and plans under docs/ (#6417) 2026-07-07 06:05:05 +00:00
tui-user-message-half-line-pr2.md docs: consolidate design docs and plans under docs/ (#6417) 2026-07-07 06:05:05 +00:00
untrusted-persisted-transcript.md feat(serve): Bound persisted transcript pages (#6769) 2026-07-13 03:18:11 +00:00
web-shell-session-created-callback.md feat(web-shell): add session created callback (#6703) 2026-07-13 07:04:42 +00:00
web-shell-table-selection-statistics.md feat(web-shell): add selection statistics to markdown tables (#6838) 2026-07-14 03:54:33 +00:00
webshell-composer-placeholders.md feat(web-shell): support custom composer placeholders (#6765) 2026-07-12 12:44:59 +00:00
webshell-mention-icon-chips.md docs: consolidate design docs and plans under docs/ (#6417) 2026-07-07 06:05:05 +00:00
workflow-tracing-gaps.md feat(telemetry): unify span creation paths for hierarchical trace tree (#4126) 2026-05-16 22:29:55 +08:00
worktree.md feat(worktree): Phase D — startup --worktree flag + symlinkDirectories + PR refs (#4381) 2026-05-27 17:04:51 +08:00
yaml-parser-replacement.md docs: consolidate design docs and plans under docs/ (#6417) 2026-07-07 06:05:05 +00:00