Skip to content

fix(webui): Close same-session refresh race gaps - #8990

Merged
doudouOUC merged 1 commit into
mainfrom
fix/same-session-refresh-race-gaps
Aug 12, 2026
Merged

fix(webui): Close same-session refresh race gaps#8990
doudouOUC merged 1 commit into
mainfrom
fix/same-session-refresh-race-gaps

Conversation

@doudouOUC

Copy link
Copy Markdown
Collaborator

What this PR does

This follow-up hardens transactional same-session refresh after #8939. It returns a stable event epoch from bounded replay loads, releases prepared candidates and source-tail captures on every terminal failure path, resumes controlled targets after source-bound operations settle, unblocks queued refreshes after both an observed turn and a shell command finish, and preserves the committed modern client identity for later recovery.

Why it's needed

Post-merge review found five deterministic race gaps: the default bounded-history refresh could fail its epoch integrity check, an event-driven timeout could leave a provisional attachment and capture alive, a turn terminal followed by shell completion could leave refresh queued forever, a controlled target could be silently dropped during create or branch work, and a committed client-ID rebind could be overwritten by the initial prop before a later resync. These fixes preserve the current session while closing those failure and liveness gaps.

Reviewer Test Plan

How to verify

Verify that a bounded same-session load includes the live event epoch and commits successfully; that a prepared candidate waiting for source catch-up is detached and its capture stops after an event-driven deadline; that refresh starts only after both an observed turn and an overlapping shell command finish; that a controlled target requested during session creation opens after creation settles; and that a committed client-ID rebind is used by a later ring-resync recovery request. The real-daemon integration should also complete the held-response replay-plus-live-tail path without loss or duplication.

Evidence (Before & After)

N/A — this is state-machine and daemon-response correctness hardening with no visual UI change.

Tested on

OS Status
🍏 macOS
🪟 Windows ⚠️
🐧 Linux ⚠️

Environment (optional)

macOS, Node.js v22.22.3, no sandbox for the focused real-daemon integration.

Risk & Scope

  • Main risk or tradeoff: The change touches the Provider transition coordinator and daemon replay response, so the primary risk is an unintended restore-lifecycle regression; focused and full unit suites plus the real-daemon integration cover the affected paths.
  • Not validated / out of scope: Cursor-less or epoch-less source attachments remain fail-closed and are deferred to a separate follow-up; Windows and Linux were not tested locally.
  • Breaking changes / migration notes: None. There is no REST, ACP, WebSocket, or public API shape change beyond returning the existing event-epoch field consistently from bounded loads.

Linked Issues

Refs #8678

Follow-up to #8939.

中文说明

本 PR 做了什么

这是 #8939 之后对同会话事务刷新进行加固的后续修复。它让有界 replay load 返回稳定的事件 epoch,在所有终止失败路径中释放已准备的候选 attachment 和 source-tail capture,在 source-bound 操作结束后继续处理受控目标,在观察到的 turn 与 shell 命令都结束后推进排队的刷新,并确保后续恢复继续使用现代事务提交后的 client identity。

为什么需要

合入后的 review 发现了五个可确定复现的竞态缺口:默认有界历史刷新可能无法通过 epoch 完整性校验;事件驱动的超时可能遗留 provisional attachment 和 capture;turn 结束后 shell 再结束可能让刷新永久停在 queued;create 或 branch 工作期间的受控目标可能被静默丢弃;已经提交的 client-ID rebind 可能在后续 resync 前被初始 prop 覆盖。这些修复在保留当前会话的同时关闭上述失败与活性缺口。

Reviewer 测试计划

如何验证

验证有界同会话 load 会携带 live event epoch 并成功提交;等待 source 追赶的 prepared candidate 在事件驱动 deadline 后会被 detach,且 capture 停止继续收集;刷新只会在观察到的 turn 和重叠 shell 命令都结束后启动;会话创建期间请求的受控目标会在创建结束后打开;已经提交的 client-ID rebind 会用于后续 ring-resync 恢复请求。真实 daemon integration 还应完成 held-response 的 replay 与 live tail 合并路径,且不丢失、不重复事件。

证据(Before & After)

N/A —— 这是状态机与 daemon 响应正确性加固,没有可视 UI 变化。

测试平台

OS 状态
🍏 macOS
🪟 Windows ⚠️
🐧 Linux ⚠️

环境(可选)

macOS、Node.js v22.22.3;focused 真实 daemon integration 使用 no-sandbox。

风险与范围

  • 主要风险或取舍:改动涉及 Provider transition coordinator 与 daemon replay 响应,主要风险是引入 restore 生命周期回归;受影响路径已有 focused/full 单测和真实 daemon integration 覆盖。
  • 未验证 / 范围外:缺少 cursor 或 epoch 的 source attachment 仍然 fail-closed,留给独立后续处理;本地未在 Windows 和 Linux 上测试。
  • Breaking change / 迁移说明:无。除有界 load 现在会一致返回既有的 event-epoch 字段外,不改变 REST、ACP、WebSocket 或公开 API shape。

关联 Issue

Refs #8678

#8939 的后续修复。

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
@doudouOUC

Copy link
Copy Markdown
Collaborator Author

E2E report: QWEN_SANDBOX=false NODE_OPTIONS=--no-experimental-webstorage npx vitest run --root ./integration-tests cli/qwen-serve-webui-same-session-refresh.test.ts --reporter=dot passed 3/3 on macOS with Node.js v22.22.3. The held-response case used historyPageSize: 100, exercised the bounded replay response, accepted live source events while the response was held, and committed replay plus live tail without loss or duplication. The suite also verified structured 504 rollback and client-ID-only resume transcript preservation. Existing React act(...) warnings were emitted by the harness; there were no test failures or unhandled rejections.

@qwen-code-ci-bot

qwen-code-ci-bot commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Qwen Triage finishedview run. See the stage comments in this thread for the result.

Qwen Triage 已完成 —— 查看运行。结果见本线程中的各阶段评论。

@qwen-code-ci-bot

qwen-code-ci-bot commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the PR!

  • Template: complete ✓ — all sections filled, bilingual, test plan included.
  • Problem: observed and well-anchored, not theoretical. This is a follow-up to fix(webui): Make same-session refresh transactional #8939 closing five race gaps found in the post-merge review of that state machine, and the whole line of work traces back to P1 bug fix(serve): Preserve the current session when a large restore times out #8678 (current session lost when a large restore times out). Each gap is described as a concrete interleaving — bounded load missing the epoch check, deadline leaking a provisional attachment, turn-terminal plus shell leaving refresh queued, controlled target dropped mid-create, committed client-ID overwritten by the initial prop — and each gets a dedicated regression test in this diff. That is the right shape of evidence for race conditions.
  • Direction: aligned. Session preservation across restore/refresh is core reliability for qwen serve webui users, and the reference CHANGELOG shows a steady stream of comparable session-restore/refresh integrity fixes, so the area is squarely in scope.
  • Size: no Stage 0 concerns. 482 changed lines break down as ~160 production logic (DaemonSessionProvider.tsx +82/−75, bridge.ts +3), ~314 test, ~8 design-doc. The change spans two packages (webui + acp-bridge), but it is a fix far below any size threshold.
  • Approach: scope matches the five stated gaps one-to-one, nothing unrelated. It actually reduces code: four duplicated candidate-retire/capture-release blocks collapse into one cleanupTransitionArtifacts helper, and the unmount path now reuses the existing cancel function instead of an inline copy. Design doc updated in lockstep with the semantic changes. Nothing I would cut.
  • Risk: no high-risk path matches against the revert-history patterns.

Moving on to code review. 🔍

中文说明

感谢贡献!

  • **模板:**完整 ✓ —— 各节齐全,中英双语,包含测试计划。
  • **问题:**已观测、有明确锚点,不是理论性问题。这是 fix(webui): Make same-session refresh transactional #8939 的后续,修补该状态机在合入后 review 中发现的五个竞态缺口,整条工作线可追溯到 P1 bug fix(serve): Preserve the current session when a large restore times out #8678(大 restore 超时时当前会话丢失)。每个缺口都描述为具体的交错时序——有界 load 缺少 epoch 校验、deadline 泄漏 provisional attachment、turn 结束加 shell 未结束导致刷新永久排队、create 期间受控目标被丢弃、已提交的 client-ID 被初始 prop 覆盖——并且 diff 中每个缺口都有专门的回归测试。对竞态条件来说,这是正确形态的证据。
  • **方向:**对齐。restore/refresh 期间的会话保留是 qwen serve webui 用户的核心可靠性问题,参考 CHANGELOG 中有大量同类会话 restore/refresh 完整性修复,该领域完全在范围内。
  • **规模:**无 Stage 0 问题。482 行改动中约 160 行为生产逻辑(DaemonSessionProvider.tsx +82/−75、bridge.ts +3),约 314 行为测试,约 8 行为设计文档。改动跨两个包(webui + acp-bridge),但属于远低于任何规模门槛的 fix
  • **方案:**范围与所述五个缺口一一对应,无无关改动。实际上还减少了代码:四处重复的候选退役/释放 capture 逻辑收敛为一个 cleanupTransitionArtifacts 辅助函数,卸载路径复用既有的 cancel 函数而不再内联一份拷贝。设计文档与语义变更同步更新。没有需要砍掉的部分。
  • **风险:**未命中 revert 历史高风险路径。

进入代码审查。🔍

Qwen Code · qwen3.8-max

Reviewed at 9e3d7d0dfbe8732dff8208181de70137a44f14d0 · re-run with @qwen-code /triage

@qwen-code-ci-bot

qwen-code-ci-bot commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Code review

My independent proposal for the five gaps — snapshot and return the epoch from bounded replay loads, centralize terminal candidate/capture cleanup, decouple the observed-turn latch from local shell activity, hold-and-retry controlled targets instead of failing them, and gate the prop-mirror write to legacy daemons — is exactly what this PR does, gap for gap. Re-tracing every fix against the head code on this re-run confirms the tricky parts:

  • Epoch on bounded loads (bridge.ts): the epoch is snapshotted together with the replay watermark before paging, the success path requires both unchanged, and the response now carries eventEpoch so the provider's commit check has a defined value. A journal lacking an epoch still fails closed (snapshot.eventEpoch === undefined rejects), so integrity validation is not quietly weakened.
  • Terminal cleanup (cleanupTransitionArtifacts): consolidates four duplicated retire/release blocks across the deadline, cancel, abort, and supersede paths, with preserveInFlightCapture keeping the capture alive exactly while the raw restore is genuinely in flight (rawTransitionRef.current === intent). On the commit path the removed inline retireAttachment call is safe — the local candidate there is intent.candidate itself, so the shared cleanup retires exactly once.
  • Queued refresh stuck: the pump gate is snapshot.activeTurn || hasCurrentSessionActivePrompt(). Previously the turn-terminal handler re-read hasSessionActivePrompt() into runnerActiveTurn, which latched true while a shell command ran and was never re-cleared after the shell finished. Now the terminal event clears runnerActiveTurn unconditionally and pumps; when the shell later finishes, the setPromptStatus('idle') wrapper pumps the queue again and both gates are false. Matches the new test's interleaving.
  • Controlled target retry: the new early-return sits before the lastHandled* ref updates, so the nonce-driven effect re-run still sees the target as unhandled and processes the latest one; the deferred setControlledRetryNonce fires only when the source-bound count reaches zero and is guarded by mountedRef. The old behavior (publish a terminal controlled failure during create) is deliberately replaced, and the renamed test plus the design-doc update both reflect that.
  • Unmount path: delegating to cancelTransitionRef.current does not lose the lifecycleRef.current += 1 bump — it is the first line of cancelCrossSessionTransition — and additionally releases the candidate/capture the old inline block skipped.
  • Client-ID guard: clientIdRef is still seeded from the prop at mount, but render-time overwrites now require capabilities known + legacy daemon, so a committed modern rebind survives later renders and recovery requests use the committed identity (the new resync test asserts resume receives client-b).

No critical blockers found, and no convention violations — the diff is net-negative in production complexity (160 production lines vs 314 test lines), tests are colocated, and the design doc moves in lockstep with the semantics.

CI test evidence

CI on the reviewed commit has settled. Every suite is green except one check that failed on runner disk exhaustion, unrelated to this PR — the Ubuntu unit job's only failures are 38 tests inside packages/cli/src/commands/review/lib/manifest-repository-context.test.ts, a file this PR does not touch (review-manifest scanning, nothing to do with webui session refresh). All 38 fail in that suite's mkdtemp helper with an explicit OS-level error:

FAIL  src/commands/review/lib/manifest-repository-context.test.ts > fails closed when rule-filter matching work exceeds the budget
AssertionError: expected [Function] to throw error including 'paths matching work exceeds limit'
  but got 'ENOSPC: no space left on device, mkdtemp '/tmp/manifest-context-XXXXXX''

Test Files  1 failed | 797 passed (798)
     Tests  38 failed | 19099 passed | 22 skipped (19159)

Classifying this as pre-existing infrastructure noise, with evidence: (1) the error is literally ENOSPC: no space left on device on the self-hosted runner's /tmp, which no webui/acp-bridge change can plausibly cause; (2) the same job failed in the same time window on unrelated branches — e.g. run 31576662683 (workflow/agent-working-dir, commit c46bcdc9) also failed Test (ubuntu-latest, Node 22.x) with disk-pressure failures across unrelated suites; (3) every suite this PR actually feeds is green on this commit, including all four new regression tests (webui: 34 files / 554 tests ✅, acp-bridge ✅, and the Real daemon E2E that exercises the held-response replay-plus-tail path ✅). A maintainer re-running the failed job should clear it.

Check Conclusion
Test (ubuntu-latest, Node 22.x) ❌ failure — pre-existing runner ENOSPC, see classification above
Capture web-shell visuals (ubuntu-latest, Node 22.x) ✅ success
Classify PR ✅ success
Desktop Shell (ubuntu-22.04) ✅ success
Desktop Shell (windows-2022) ✅ success
Real daemon E2E / Java 11 ✅ success
web-shell E2E Smoke (ubuntu-latest, Node 22.x) ✅ success
ubuntu-latest / Java 11 ✅ success
ubuntu-latest / Java 17 ✅ success
ubuntu-latest / Java 21 ✅ success
macos-latest / Java 21 ✅ success
windows-latest / Java 21 ✅ success
Post Coverage Comment (ubuntu-latest, 22.x) ✅ success

Not verified by me directly: this is an unattended CI run, so I do not build or run PR code here — the evidence above is the PR's own CI, quoted from the API. The local integration-suite pass reported in the thread is the author's claim (macOS, Node v22.22.3); the Real daemon E2E check covers the same path in CI and is green.

Sandboxed verification would settle the remaining gap: @qwen-code /verify — that the five new regression tests actually pin their fixes (i.e. fail against the pre-#8990 build) is not observable from the diff or from a green suite alone; an A/B run against the base build would prove the tests are load-bearing, and would also stand in for the macOS-only local testing reported in the PR body.

中文说明

代码审查

我对这五个缺口的独立方案——有界 replay load 快照并返回 epoch、把终止路径的候选/capture 清理集中化、把观察到的 turn 标志与本地 shell 活动解耦、受控目标挂起重试而不是直接失败、prop 镜像写入仅限 legacy daemon——与本 PR 的做法逐条一致。本轮重新在 head 代码上逐条核对,确认了关键细节:

  • 有界 load 的 epoch:epoch 与 replay watermark 在分页前一起快照,成功要求两者均未变化,响应现在携带 eventEpoch,provider 的提交校验有确定值;journal 缺少 epoch 时仍 fail-closed,完整性校验没有被悄悄放松。
  • 终止清理cleanupTransitionArtifacts 统一了 deadline、cancel、abort、supersede 四处重复逻辑;preserveInFlightCapture 仅在 raw restore 确实在途时保留 capture;commit 路径移除的内联退役是安全的——该处局部 candidate 就是 intent.candidate,共享清理恰好退役一次。
  • 排队刷新卡死:旧代码在 turn 终止时把 hasSessionActivePrompt() 重读进 runnerActiveTurn,shell 在跑时锁死为 true 且之后无人清零;新代码在终止事件无条件清零并 pump,shell 结束时 setPromptStatus('idle') 的包装层再次 pump,两道门控均为 false。与新测试的时序一致。
  • 受控目标重试:新增的提前返回位于 lastHandled* 更新之前,nonce 触发的 effect 重跑仍会处理最新目标;延迟的 setControlledRetryNonce 仅在 source-bound 计数归零时触发且有 mountedRef 保护。旧行为被有意替换,测试改名与设计文档同步反映。
  • 卸载路径:改走 cancelTransitionRef.current 不丢 lifecycleRef.current += 1(它是 cancel 函数第一行),还顺带释放了旧内联块遗漏的候选/capture。
  • client-ID 保护clientIdRef 仍在挂载时由 prop 种子化,但渲染期覆写现在要求 capabilities 已知且为 legacy daemon,已提交的现代 rebind 不被后续渲染覆盖(新 resync 测试断言 resume 收到 client-b)。

未发现关键阻塞问题,也无规范违规——生产代码净复杂度下降(160 行生产逻辑、314 行测试),测试与源码同目录,设计文档与语义同步。

CI 测试证据

被审 commit 的 CI 已结束。除一项与 PR 无关的 runner 磁盘耗尽失败外全部为绿:Ubuntu 单测 job 的唯一失败是 packages/cli/src/commands/review/lib/manifest-repository-context.test.ts 中的 38 个用例——该文件本 PR 未触及(review 清单扫描,与 webui 会话刷新无关),38 个全部失败在该套件第 29 行的 mkdtemp 辅助函数,报错为操作系统级的 ENOSPC: no space left on device

判定为既有基础设施噪音,证据:(1)报错是宿主机 /tmp 写满,webui/acp-bridge 改动不可能造成;(2)同一时间窗内无关分支的同一 job 也失败——如 run 31576662683(workflow/agent-working-dir,commit c46bcdc9)同样因磁盘压力挂掉多个无关套件;(3)本 PR 实际涉及的全部套件在该 commit 上为绿,包括四个新回归测试(webui 34 文件 / 554 用例 ✅、acp-bridge ✅、验证 held-response replay+tail 合并路径的 Real daemon E2E ✅)。维护者重跑该失败 job 即可消除。

我未直接验证:无人值守 CI 环境不构建、不运行 PR 代码,以上证据为通过 API 引用的该 PR 自身 CI 结果。线程中报告的本地集成套件通过是作者自述(macOS、Node v22.22.3);CI 的 Real daemon E2E 覆盖同一路径且为绿。

沙箱验证可以补齐剩余缺口:@qwen-code /verify —— 五个新回归测试是否真的钉住了修复(即在 #8990 之前的构建上失败)无法从 diff 或绿色套件本身看出;对 base 构建做 A/B 运行可以证明测试是 load-bearing 的,也可弥补 PR 描述中"仅 macOS 本地测试"的局限。

Qwen Code · qwen3.8-max

Reviewed at 9e3d7d0dfbe8732dff8208181de70137a44f14d0 · re-run with @qwen-code /triage

@qwen-code-ci-bot

qwen-code-ci-bot commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Confidence: 4/5 — clean, tightly scoped hardening that matches what I would have written, with dense regression coverage; the single red CI check is proven runner disk exhaustion, not this PR.

Stepping back: this is what a good follow-up PR looks like. Five concrete gaps, five targeted fixes, a dedicated regression test per gap, and the design doc updated in lockstep — and the change removes duplication (four inline cleanup blocks → one helper) rather than adding machinery. On this re-run I re-traced each fix end-to-end against the head code: epoch snapshot consistency in the bridge, single-retire semantics on every terminal path, decoupled turn/shell gating for the refresh pump (including the setPromptStatus re-pump that frees the queue once the shell settles), a retry that reads the latest controlled target, and committed client identity flowing into recovery. Nothing fails open — a missing epoch still rejects at the commit check, and the capture is preserved only while a raw restore is genuinely in flight. I went looking for a simpler mechanism per gap and didn't find one; each fix is the minimal move for its interleaving.

On the red check: the earlier run deferred approval until CI landed green, and the one failure that blocked it is environmental — 38 tests in an untouched CLI review-manifest suite, all dying in mkdtemp with ENOSPC: no space left on device, while unrelated branches hit the same wall in the same window (full evidence in the review comment above). Everything this PR actually feeds is green, including the real-daemon E2E. Branch protection still enforces CI at merge time, so a maintainer re-running that one job clears the path; nothing about the failure changes my read of the code.

Standing reservations, stated plainly: this is a complex state machine, and static review cannot exclude interleavings beyond the ones under test — but coverage is dense (+314 test lines pinning each race) and the held-response replay-plus-tail path runs green in CI. The author tested locally on macOS only; the OS matrix and CLI integration suites pick this up in the merge queue, which is this repo's design for those checks. The /verify line in the review comment names how to prove the new tests are load-bearing against the base build.

Approving now, pinned to the reviewed commit.

中文说明

置信度:4/5 —— 干净、范围收敛的加固,与我会写出的方案一致,回归覆盖密集;唯一的红色 CI 检查已证实是 runner 磁盘耗尽,与本 PR 无关。

整体来看:这是一个高质量后续 PR 的样子。五个具体缺口、五处定向修复、每个缺口一个专门的回归测试,设计文档同步更新——而且改动是减少重复(四处内联清理块收敛为一个辅助函数),不是堆叠机制。本轮重新逐条在 head 代码上追到底:bridge 中 epoch 快照的一致性、所有终止路径的恰好一次退役、刷新泵 turn/shell 门控解耦(包括 shell 结束后 setPromptStatus 包装层重新 pump 解锁队列)、重试读取最新受控目标、已提交的 client 身份流入恢复流程。没有 fail-open——缺少 epoch 仍会在提交校验处被拒绝,capture 仅在 raw restore 确实在途时保留。我也为每个缺口找过更简机制,没找到;每个修复都是对应交错时序的最小动作。

关于红色检查:上一轮把批准推迟到 CI 全绿,而挡住它的那个失败是环境问题——一个本 PR 未触及的 CLI review-manifest 套件中 38 个用例全部死于 mkdtempENOSPC: no space left on device,同一时间窗内无关分支也撞上同样的墙(完整证据见上方审查评论)。本 PR 实际涉及的部分全部为绿,包括 real-daemon E2E。分支保护在合并时仍会强制 CI,维护者重跑该 job 即可放行;该失败不改变我对代码的判断。

坦率说明保留意见:这是一个复杂状态机,静态审查无法排除测试覆盖之外的交错——但覆盖密集(+314 行测试钉住每个竞态),held-response 的 replay+tail 合并路径在 CI 中为绿。作者仅在 macOS 本地测试;OS 矩阵与 CLI 集成套件按本仓库设计在 merge queue 阶段运行。审查评论中的 /verify 一行说明了如何证明新测试相对 base 构建是 load-bearing 的。

现在批准,绑定被审 commit。

Qwen Code · qwen3.8-max

Reviewed at 9e3d7d0dfbe8732dff8208181de70137a44f14d0 · re-run with @qwen-code /triage

@qwen-code-ci-bot

Copy link
Copy Markdown
Collaborator

🖼️ web-shell visual preview

Rendered against a mock daemon (no real backend): the PR base vs this PR head 9e3d7d0. Only screenshots that changed are shown (flows below, if any, are head-only) — refreshes on every push.

Screenshots · before / after

ℹ️ No screenshot changed against the PR base — but this PR edits 1 render-shaping file:

  • packages/webui/src/daemon/session/DaemonSessionProvider.tsx

Either the change has no visual effect (logic, plumbing, a state the scenarios never reach), or no scenario renders this UI — in which case the preview cannot see it, and an empty result is a coverage gap rather than a clean bill of health. To make it visible, add a scenario to packages/web-shell/client/e2e/visuals/screenshots.spec.ts that seeds whatever state the UI is gated on; it then appears here as a head-only (NEW) capture.

Full-resolution recordings (.webm) are attached to the workflow run.

Qwen Code · web-shell visuals

@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage Summary

Package Lines Statements Functions Branches
CLI N/A% N/A% N/A% N/A%
Core 87.88% 87.88% 89.46% 86.39%
CLI Package - Full Text Report
CLI full-text-summary.txt not found at: coverage_artifact/cli/coverage/full-text-summary.txt
Core Package - Full Text Report
-------------------|---------|----------|---------|---------|-------------------
File               | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
-------------------|---------|----------|---------|---------|-------------------
All files          |   87.88 |    86.39 |   89.46 |   87.88 |                   
 src               |     100 |      100 |     100 |     100 |                   
  index.ts         |     100 |      100 |     100 |     100 |                   
 src/__mocks__/fs  |       0 |        0 |       0 |       0 |                   
  promises.ts      |       0 |        0 |       0 |       0 | 1-48              
 src/agents        |   90.38 |    84.54 |   94.85 |   90.38 |                   
  ...transcript.ts |   87.63 |    83.52 |     100 |   87.63 | ...80,588,594-598 
  ...ent-resume.ts |   85.59 |    77.55 |   83.33 |   85.59 | ...1793-1797,1800 
  ...ound-tasks.ts |   94.63 |    90.13 |   96.38 |   94.63 | ...1773,1793-1796 
  index.ts         |     100 |      100 |     100 |     100 |                   
  ...ent-result.ts |    96.8 |    92.68 |     100 |    96.8 | 106,129-131       
  ...n-registry.ts |   94.79 |     87.7 |     100 |   94.79 | ...1067,1081-1083 
  ...w-snapshot.ts |   92.12 |    77.14 |     100 |   92.12 | ...65,189,196-198 
 src/agents/arena  |   76.32 |    67.71 |   78.94 |   76.32 |                   
  ...gentClient.ts |   79.47 |    88.88 |   81.81 |   79.47 | ...68-183,189-204 
  ArenaManager.ts  |   75.11 |    64.51 |   78.57 |   75.11 | ...1887,1893-1894 
  arena-events.ts  |   64.44 |      100 |      50 |   64.44 | ...71-175,178-183 
  diff-summary.ts  |    87.5 |    72.34 |     100 |    87.5 | ...32-133,137-138 
  index.ts         |     100 |      100 |     100 |     100 |                   
  types.ts         |     100 |      100 |     100 |     100 |                   
 ...gents/backends |   78.09 |    85.23 |   76.28 |   78.09 |                   
  ITermBackend.ts  |   97.97 |    93.93 |     100 |   97.97 | ...78-180,255,307 
  ...essBackend.ts |    90.9 |    85.36 |   93.33 |    90.9 | ...70,672,674-675 
  TmuxBackend.ts   |    90.7 |    76.55 |   97.36 |    90.7 | ...87,697,743-747 
  detect.ts        |   31.25 |      100 |       0 |   31.25 | 34-88             
  index.ts         |     100 |      100 |     100 |     100 |                   
  iterm-it2.ts     |     100 |     92.1 |     100 |     100 | 37-38,106         
  tmux-commands.ts |    6.64 |      100 |    3.03 |    6.64 | ...93-363,386-503 
  types.ts         |     100 |      100 |     100 |     100 |                   
 ...agents/runtime |    91.1 |    86.68 |   89.23 |    91.1 |                   
  agent-context.ts |     100 |      100 |     100 |     100 |                   
  agent-core.ts    |   85.07 |     76.8 |   77.77 |   85.07 | ...2291,2337-2339 
  agent-events.ts  |     100 |      100 |     100 |     100 |                   
  ...t-headless.ts |   93.49 |    89.41 |   83.33 |   93.49 | ...96-497,500-501 
  ...nteractive.ts |   81.01 |    82.35 |   76.66 |   81.01 | ...33,535-538,541 
  ...statistics.ts |   98.29 |    82.55 |     100 |   98.29 | 141,165,206,239   
  agent-types.ts   |     100 |      100 |     100 |     100 |                   
  index.ts         |     100 |      100 |     100 |     100 |                   
  ...ool-policy.ts |   98.34 |      100 |    92.3 |   98.34 | 81-82             
  ...low-budget.ts |     100 |      100 |     100 |     100 |                   
  ...-scheduler.ts |   97.43 |    96.36 |     100 |   97.43 | 128-130           
  ...ow-journal.ts |   91.76 |    75.86 |     100 |   91.76 | ...38-139,179-181 
  ...chestrator.ts |    92.4 |       90 |   83.78 |    92.4 | ...1862,1911-1914 
  ...ow-prompts.ts |     100 |      100 |     100 |     100 |                   
  ...low-runner.ts |   94.85 |     87.5 |   92.85 |   94.85 | ...93,260,280-283 
  ...ow-sandbox.ts |   96.85 |    91.28 |     100 |   96.85 | ...1705,1711-1712 
  ...flow-saved.ts |   96.51 |    94.36 |     100 |   96.51 | 134-135,234-237   
  ...flow-stall.ts |    97.9 |    83.33 |     100 |    97.9 | 138-139,236       
 src/agents/tasks  |     100 |      100 |     100 |     100 |                   
  types.ts         |     100 |      100 |     100 |     100 |                   
 src/agents/team   |   82.04 |    84.17 |   88.97 |   82.04 |                   
  TeamManager.ts   |   72.02 |    79.41 |   79.24 |   72.02 | ...1632,1655-1656 
  identity.ts      |     100 |      100 |     100 |     100 |                   
  index.ts         |     100 |      100 |     100 |     100 |                   
  ...sionBridge.ts |     100 |      100 |     100 |     100 |                   
  mailbox.ts       |   96.02 |    87.23 |     100 |   96.02 | 352-358           
  ...ptAddendum.ts |     100 |      100 |     100 |     100 |                   
  tasks.ts         |   89.24 |    82.82 |     100 |   89.24 | ...-994,1038-1039 
  team-events.ts   |   60.52 |      100 |      50 |   60.52 | ...40-144,151-155 
  teamHelpers.ts   |   92.02 |    94.91 |   95.23 |   92.02 | ...31-332,368-378 
  types.ts         |     100 |      100 |     100 |     100 |                   
 ...eam/test-utils |   94.39 |    94.26 |   98.21 |   94.39 |                   
  ...on-harness.ts |   96.49 |    84.21 |     100 |   96.49 | 128-129,141-142   
  fake-agent.ts    |   98.49 |    95.08 |     100 |   98.49 | 201-203           
  fake-backend.ts  |   86.46 |    97.61 |   95.83 |   86.46 | 124-146           
 src/config        |    84.8 |    87.18 |   75.42 |    84.8 |                   
  approval-mode.ts |     100 |      100 |     100 |     100 |                   
  ...xtDefaults.ts |     100 |      100 |     100 |     100 |                   
  config.ts        |   84.11 |    86.91 |   73.86 |   84.11 | ...8440,8444-8445 
  constants.ts     |     100 |      100 |     100 |     100 |                   
  models.ts        |     100 |      100 |     100 |     100 |                   
  storage.ts       |   94.39 |    91.57 |   88.23 |   94.39 | ...45-446,449-450 
 ...nfirmation-bus |   98.27 |    97.14 |     100 |   98.27 |                   
  message-bus.ts   |   98.14 |    97.05 |     100 |   98.14 | 42-43             
  types.ts         |     100 |      100 |     100 |     100 |                   
 src/core          |   92.37 |    88.09 |   93.29 |   92.37 |                   
  baseLlmClient.ts |    88.4 |     83.8 |   81.81 |    88.4 | ...59,672,678-680 
  client.ts        |   92.05 |     87.4 |   91.66 |   92.05 | ...3987,4085-4086 
  ...tGenerator.ts |   86.34 |    87.34 |   84.61 |   86.34 | ...96-497,542-548 
  ...lScheduler.ts |   90.04 |    84.69 |   96.15 |   90.04 | ...6215,6243-6259 
  geminiChat.ts    |    94.7 |    90.12 |   95.53 |    94.7 | ...5052,5100-5101 
  geminiRequest.ts |     100 |      100 |     100 |     100 |                   
  genai-compat.ts  |     100 |      100 |     100 |     100 |                   
  ...MediaLimit.ts |     100 |       96 |     100 |     100 | 96                
  ...htProtocol.ts |    9.09 |      100 |       0 |    9.09 | ...9,62-66,69-110 
  ...ream-error.ts |     100 |      100 |     100 |     100 |                   
  logger.ts        |   87.41 |    87.02 |     100 |   87.41 | ...64-568,614-628 
  ...lay-buffer.ts |     100 |      100 |     100 |     100 |                   
  ...dispatcher.ts |     100 |      100 |     100 |     100 |                   
  ...tyDefaults.ts |     100 |      100 |     100 |     100 |                   
  ...olExecutor.ts |   93.54 |    83.33 |      50 |   93.54 | 49-50             
  ...on-helpers.ts |   93.49 |    78.57 |     100 |   93.49 | ...10-211,228-229 
  ...issionFlow.ts |   98.97 |    96.96 |     100 |   98.97 | 107               
  ...try-policy.ts |     100 |      100 |     100 |     100 |                   
  ...ell-policy.ts |   94.89 |    88.54 |     100 |   94.89 | ...51-252,297-298 
  prompts.ts       |   93.64 |    91.42 |   83.33 |   93.64 | ...1209,1412-1413 
  ...ing-effort.ts |     100 |      100 |     100 |     100 |                   
  ...n-recovery.ts |   95.13 |       80 |     100 |   95.13 | ...06-107,142-144 
  ...t-profiler.ts |    97.9 |    81.15 |   88.23 |    97.9 | 117,124-125,130   
  ...port-retry.ts |     100 |      100 |     100 |     100 |                   
  tokenLimits.ts   |     100 |    91.89 |     100 |     100 | 87,122-139        
  ...reparation.ts |     100 |      100 |     100 |     100 |                   
  ...tion-guard.ts |   90.38 |    94.73 |     100 |   90.38 | 68-72             
  ...allIdUtils.ts |   98.41 |    93.47 |     100 |   98.41 | 36,45             
  ...okTriggers.ts |   99.45 |    92.43 |     100 |   99.45 | 182,193           
  ...terruption.ts |     100 |     92.3 |     100 |     100 | 86,104            
  turn.ts          |   98.67 |    93.12 |     100 |   98.67 | ...79,707-708,755 
  ...l-fallback.ts |     100 |      100 |     100 |     100 |                   
 ...ntentGenerator |   96.33 |    88.12 |   96.15 |   96.33 |                   
  ...tGenerator.ts |   97.24 |    86.72 |   94.87 |   97.24 | ...1436,1465,1476 
  converter.ts     |   96.19 |    89.25 |     100 |   96.19 | ...1329,1550-1552 
  index.ts         |       0 |        0 |       0 |       0 | 1-21              
  usage.ts         |     100 |      100 |     100 |     100 |                   
 ...ntentGenerator |   88.78 |    72.36 |   89.47 |   88.78 |                   
  ...tGenerator.ts |   87.18 |    71.83 |   88.88 |   87.18 | ...58-364,382-383 
  index.ts         |     100 |       80 |     100 |     100 | 50                
 ...ntentGenerator |   95.88 |    90.34 |    92.3 |   95.88 |                   
  index.ts         |     100 |      100 |     100 |     100 |                   
  ...tGenerator.ts |   95.81 |    89.63 |   91.89 |   95.81 | ...1221-1222,1250 
  ...tDetection.ts |     100 |      100 |     100 |     100 |                   
 ...ntentGenerator |   91.71 |    90.53 |   95.61 |   91.71 |                   
  constants.ts     |     100 |      100 |     100 |     100 |                   
  converter.ts     |    91.3 |    89.49 |   96.87 |    91.3 | ...1942,2111-2126 
  errorHandler.ts  |     100 |      100 |     100 |     100 |                   
  index.ts         |   60.31 |       75 |      50 |   60.31 | ...71,74-78,90-94 
  ...tGenerator.ts |    66.4 |    70.58 |   88.88 |    66.4 | ...51-157,168-169 
  pipeline.ts      |   95.48 |    91.27 |     100 |   95.48 | ...1309,1317,1416 
  ...ix-caching.ts |   95.23 |    92.85 |     100 |   95.23 | 45-46,69-70       
  ...ureContext.ts |     100 |      100 |     100 |     100 |                   
  ...ingOptions.ts |       0 |        0 |       0 |       0 | 1                 
  ...CallParser.ts |   92.24 |     92.4 |     100 |   92.24 | ...28-529,549-552 
  ...kingParser.ts |     100 |    96.87 |     100 |     100 | 42                
  types.ts         |       0 |        0 |       0 |       0 | 1                 
 ...rator/provider |   97.36 |    92.19 |    98.5 |   97.36 |                   
  dashscope.ts     |   98.33 |    94.97 |   96.42 |   98.33 | ...91-692,834-835 
  deepseek.ts      |   94.91 |    89.36 |     100 |   94.91 | ...31-132,145-146 
  default.ts       |   99.18 |    97.05 |     100 |   99.18 | 208               
  index.ts         |     100 |      100 |     100 |     100 |                   
  mimo.ts          |   94.11 |    66.66 |     100 |   94.11 | 29,52-53          
  minimax.ts       |     100 |      100 |     100 |     100 |                   
  mistral.ts       |   96.07 |    73.33 |     100 |   96.07 | 32-33             
  modelscope.ts    |     100 |      100 |     100 |     100 |                   
  types.ts         |       0 |        0 |       0 |       0 |                   
  utils.ts         |     100 |      100 |     100 |     100 |                   
  zai.ts           |   92.13 |    82.14 |     100 |   92.13 | ...,39-40,135-137 
 src/extension     |   87.71 |    84.62 |   92.57 |   87.71 |                   
  ...ive-safety.ts |     100 |      100 |     100 |     100 |                   
  ...-converter.ts |   80.55 |    73.66 |     100 |   80.55 | ...1133,1179-1180 
  corruptFile.ts   |     100 |       50 |     100 |     100 | 40-45             
  ...-converter.ts |     100 |      100 |     100 |     100 |                   
  ...me-refresh.ts |     100 |      100 |     100 |     100 |                   
  ...sion-store.ts |   90.94 |    86.26 |   97.91 |   90.94 | ...1230-1236,1280 
  ...ionManager.ts |   83.89 |    82.86 |   81.72 |   83.89 | ...2832,2861-2862 
  ...references.ts |     100 |     90.9 |     100 |     100 | ...05,129,197,200 
  ...onSettings.ts |    92.3 |     94.4 |     100 |    92.3 | ...98-501,570-571 
  ...-converter.ts |    75.9 |    85.71 |   85.71 |    75.9 | ...98,202,214-248 
  github.ts        |   90.48 |    82.71 |     100 |   90.48 | ...4,994-995,1005 
  http-client.ts   |   84.61 |       80 |     100 |   84.61 | 20-21             
  i18n.ts          |   78.26 |       96 |      50 |   78.26 | 104-110,116-123   
  index.ts         |     100 |      100 |     100 |     100 |                   
  marketplace.ts   |   88.39 |    83.11 |     100 |   88.39 | ...08,494,507-508 
  ...ork-policy.ts |   89.72 |       90 |     100 |   89.72 | ...36,148-154,156 
  npm.ts           |   89.02 |    81.81 |     100 |   89.02 | ...86-688,695-700 
  override.ts      |   94.11 |    93.33 |     100 |   94.11 | 63-64,81-82       
  ...-converter.ts |   94.89 |    90.41 |     100 |   94.89 | ...50-151,222-224 
  redaction.ts     |     100 |      100 |     100 |     100 |                   
  settings.ts      |   66.26 |      100 |      50 |   66.26 | 81-107,141-146    
  ...ceRegistry.ts |   94.01 |    83.14 |     100 |   94.01 | ...38-344,365-366 
  storage.ts       |     100 |      100 |     100 |     100 |                   
  ...ableSchema.ts |     100 |      100 |     100 |     100 |                   
  variables.ts     |   88.95 |    84.21 |     100 |   88.95 | ...32-235,238-241 
  ...extraction.ts |   85.77 |       81 |   89.47 |   85.77 | ...02-205,260-261 
 ...ent-plugins-v1 |   84.94 |    79.51 |     100 |   84.94 |                   
  index.ts         |     100 |      100 |     100 |     100 |                   
  manifest.ts      |   81.87 |    84.48 |     100 |   81.87 | ...55-156,161-174 
  mcp.ts           |   84.98 |    79.56 |     100 |   84.98 | ...88-389,419-420 
  paths.ts         |     100 |    94.44 |     100 |     100 | 59                
  skills.ts        |   82.31 |    63.88 |     100 |   82.31 | ...38-141,150-151 
 src/followup      |    79.9 |    78.92 |    90.9 |    79.9 |                   
  followupState.ts |   98.44 |    95.74 |     100 |   98.44 | 236-237           
  index.ts         |     100 |      100 |     100 |     100 |                   
  overlayFs.ts     |   96.29 |    88.88 |     100 |   96.29 | 78,108,122        
  speculation.ts   |   71.76 |    64.76 |   71.42 |   71.76 | ...53-654,661-662 
  ...onToolGate.ts |   97.97 |     87.5 |     100 |   97.97 | 105,110           
  ...nGenerator.ts |   72.03 |    81.15 |   83.33 |   72.03 | ...68-219,331-333 
 src/generated     |       0 |        0 |       0 |       0 |                   
  git-commit.ts    |       0 |        0 |       0 |       0 | 1-10              
 src/goals         |    93.3 |    89.05 |    94.6 |    93.3 |                   
  ...eGoalStore.ts |   87.61 |    88.88 |   86.66 |   87.61 | ...85-188,196-204 
  ...t-verifier.ts |   96.27 |     90.9 |     100 |   96.27 | ...20,143-146,163 
  ...checkpoint.ts |   81.48 |    76.19 |     100 |   81.48 | ...02-105,115-118 
  goal-evidence.ts |   88.79 |     88.5 |   96.42 |   88.79 | ...04-805,828-831 
  ...projection.ts |   66.66 |    72.97 |   33.33 |   66.66 | ...83,186,190-192 
  ...ersistence.ts |   87.73 |    84.84 |      80 |   87.73 | ...-94,97,101-106 
  goal-protocol.ts |   95.74 |    93.33 |     100 |   95.74 | 154-155           
  goal-reducer.ts  |    93.4 |    90.65 |   96.96 |    93.4 | ...27,501,519-520 
  goal-runtime.ts  |   97.62 |     89.9 |     100 |   97.62 | ...1049,1169-1170 
  goal-tools.ts    |   98.22 |    93.02 |      95 |   98.22 | ...46-147,248-249 
  ...rn-context.ts |     100 |      100 |     100 |     100 |                   
  goal-verifier.ts |   92.46 |    92.85 |     100 |   92.46 | ...69-172,185-187 
  goal-wire.ts     |       0 |        0 |       0 |       0 | 1-28              
  goalHook.ts      |   96.91 |    92.42 |     100 |   96.91 | 115-120,221-222   
  goalJudge.ts     |   95.84 |    87.09 |     100 |   95.84 | ...55-356,448-449 
  index.ts         |     100 |      100 |     100 |     100 |                   
 src/hooks         |   88.07 |    86.25 |   88.54 |   88.07 |                   
  ...okRegistry.ts |   86.48 |    77.08 |     100 |   86.48 | ...41-344,362-369 
  ...bortSignal.ts |     100 |      100 |     100 |     100 |                   
  context-usage.ts |     100 |      100 |     100 |     100 |                   
  ...terpolator.ts |   96.66 |    93.33 |     100 |   96.66 | 66-67             
  ...HookRunner.ts |   96.68 |    87.23 |     100 |   96.68 | 110-112,231-233   
  ...Aggregator.ts |   96.57 |    91.48 |     100 |   96.57 | ...20-321,402,404 
  ...entHandler.ts |   95.57 |    84.76 |   94.73 |   95.57 | ...1040-1041,1051 
  hookPlanner.ts   |   87.55 |    85.54 |   86.66 |   87.55 | ...22-226,233-244 
  hookRegistry.ts  |   92.53 |    85.43 |     100 |   92.53 | ...39,458,462,466 
  hookRunner.ts    |   62.65 |    72.34 |   66.66 |   62.65 | ...70-771,780-781 
  hookSystem.ts    |   87.64 |     98.5 |   70.83 |   87.64 | ...58-759,765-766 
  ...HookRunner.ts |   79.06 |    66.66 |      80 |   79.06 | ...33-434,452-456 
  index.ts         |     100 |      100 |     100 |     100 |                   
  ...edCallback.ts |     100 |      100 |     100 |     100 |                   
  ...HookRunner.ts |   94.19 |    84.37 |   81.81 |   94.19 | ...76-384,458-459 
  ...SkillHooks.ts |   78.75 |       75 |   66.66 |   78.75 | 62-66,137-152     
  ...oksManager.ts |   94.87 |    88.88 |     100 |   94.87 | ...84,325,327-329 
  ssrfGuard.ts     |   86.45 |    87.91 |     100 |   86.45 | ...85,289-295,301 
  stopHookCap.ts   |     100 |      100 |     100 |     100 |                   
  trustedHooks.ts  |      90 |    52.63 |     100 |      90 | ...53,66-67,97-98 
  types.ts         |   94.25 |    96.09 |   88.88 |   94.25 | ...46-547,632-636 
  urlValidator.ts  |     100 |      100 |     100 |     100 |                   
  ...it-context.ts |     100 |      100 |     100 |     100 |                   
 src/ide           |   76.98 |    85.03 |   79.03 |   76.98 |                   
  constants.ts     |     100 |      100 |     100 |     100 |                   
  detect-ide.ts    |     100 |      100 |     100 |     100 |                   
  ide-client.ts    |   69.16 |    84.65 |   68.29 |   69.16 | ...1068,1097-1105 
  ide-installer.ts |   89.06 |    79.31 |     100 |   89.06 | ...36,143-147,160 
  ideContext.ts    |     100 |      100 |     100 |     100 |                   
  process-utils.ts |   84.84 |    71.79 |     100 |   84.84 | ...37,151,193-194 
  types.ts         |     100 |      100 |     100 |     100 |                   
 src/lsp           |   58.96 |    70.57 |   66.14 |   58.96 |                   
  ...nfigLoader.ts |   80.55 |       72 |   95.45 |   80.55 | ...02-504,508-514 
  ...ionFactory.ts |   42.81 |    73.07 |      50 |   42.81 | ...76-427,433-450 
  ...Normalizer.ts |   23.09 |    13.72 |   30.43 |   23.09 | ...04-905,909-924 
  ...verManager.ts |   75.73 |     80.1 |   79.66 |   75.73 | ...1346,1352-1382 
  ...eLspClient.ts |   32.78 |       80 |   16.66 |   32.78 | ...89-293,299-300 
  ...LspService.ts |      60 |    73.36 |   78.26 |      60 | ...1575,1635-1645 
  configHash.ts    |     100 |      100 |     100 |     100 |                   
  constants.ts     |     100 |      100 |     100 |     100 |                   
  types.ts         |     100 |      100 |     100 |     100 |                   
 src/mcp           |    82.3 |    77.81 |   78.33 |    82.3 |                   
  configHash.ts    |     100 |      100 |     100 |     100 |                   
  constants.ts     |     100 |      100 |     100 |     100 |                   
  ...h-provider.ts |   86.95 |      100 |   33.33 |   86.95 | ...,93,97,101-102 
  ...h-provider.ts |   79.31 |    58.06 |     100 |   79.31 | ...26-933,940-942 
  ...en-storage.ts |   98.78 |    97.95 |     100 |   98.78 | 106-107           
  oauth-utils.ts   |   73.61 |    85.48 |    92.3 |   73.61 | ...46-366,392-421 
  ...n-provider.ts |   89.83 |       96 |   45.45 |   89.83 | ...43,147,151-152 
 .../token-storage |   82.12 |    88.19 |   89.28 |   82.12 |                   
  ...en-storage.ts |     100 |      100 |     100 |     100 |                   
  ...en-storage.ts |   87.08 |    87.03 |   95.23 |   87.08 | ...00-201,214-215 
  ...en-storage.ts |     100 |      100 |     100 |     100 |                   
  index.ts         |     100 |      100 |     100 |     100 |                   
  ...en-storage.ts |   68.14 |    82.35 |   64.28 |   68.14 | ...81-295,298-314 
  types.ts         |     100 |      100 |     100 |     100 |                   
 src/memory        |   87.83 |    83.75 |   90.47 |   87.83 |                   
  ...y-document.ts |   89.52 |    84.61 |     100 |   89.52 | ...24-325,329-330 
  ...nel-memory.ts |   97.36 |    96.63 |   96.42 |   97.36 | ...91-293,367-368 
  const.ts         |   94.28 |     92.3 |     100 |   94.28 | 66-67             
  dream.ts         |    64.6 |    72.22 |      50 |    64.6 | ...04-109,124-165 
  ...entPlanner.ts |     100 |    83.33 |     100 |     100 | 136,146           
  entries.ts       |   75.59 |    84.84 |   83.33 |   75.59 | ...56-157,172-180 
  extract.ts       |   92.41 |    79.41 |     100 |   92.41 | 56-61,100,119-122 
  ...entPlanner.ts |   91.59 |    76.74 |     100 |   91.59 | ...05,114-117,293 
  ...ionPlanner.ts |       0 |        0 |       0 |       0 | 1                 
  forget.ts        |   81.83 |       75 |   83.33 |   81.83 | ...51,474,478-507 
  indexer.ts       |   94.14 |       84 |     100 |   94.14 | ...32-233,334,337 
  ...kill-agent.ts |   97.94 |    89.36 |     100 |   97.94 | 82-83,179-180     
  manager.ts       |    78.4 |    82.29 |   77.77 |    78.4 | ...1482,1495-1497 
  ...ent-config.ts |   86.99 |    82.69 |   86.36 |   86.99 | ...69,389,396-402 
  memoryAge.ts     |   90.47 |       80 |     100 |   90.47 | 50-51             
  paths.ts         |     100 |      100 |     100 |     100 |                   
  ...ing-skills.ts |     100 |       72 |     100 |     100 | 31-35,73-78,97    
  prompt.ts        |   97.26 |    87.03 |     100 |   97.26 | ...10-218,222,225 
  recall.ts        |   82.06 |       75 |    90.9 |   82.06 | ...59-364,395-406 
  refresh.ts       |   93.58 |    89.58 |     100 |   93.58 | ...75-176,183-184 
  ...ceSelector.ts |    93.1 |    81.81 |     100 |    93.1 | ...25,127-128,136 
  remember.ts      |   98.89 |    90.19 |     100 |   98.89 | 50,70             
  scan.ts          |   93.12 |    74.19 |     100 |   93.12 | ...08-109,154,157 
  scopes.ts        |     100 |      100 |     100 |     100 |                   
  ...et-scanner.ts |     100 |      100 |     100 |     100 |                   
  ...entPlanner.ts |   77.24 |    74.07 |   72.22 |   77.24 | ...52-456,459,465 
  status.ts        |   10.52 |      100 |       0 |   10.52 | 41-98             
  store.ts         |   92.92 |    81.81 |     100 |   92.92 | ...16-117,147-148 
  ...git-status.ts |     100 |     87.5 |     100 |     100 | 30                
  ...cret-guard.ts |     100 |      100 |     100 |     100 |                   
  ...emory-sync.ts |   94.24 |    82.85 |     100 |   94.24 | ...34-236,246-247 
  types.ts         |     100 |      100 |     100 |     100 |                   
  ...ontextFile.ts |   81.21 |     79.1 |   81.81 |   81.21 | ...63-277,291-296 
 src/mocks         |       0 |        0 |       0 |       0 |                   
  msw.ts           |       0 |        0 |       0 |       0 | 1-9               
 src/models        |   92.55 |    88.62 |   91.13 |   92.55 |                   
  constants.ts     |     100 |      100 |     100 |     100 |                   
  ...tor-config.ts |   97.77 |    91.83 |     100 |   97.77 | 155,161,171       
  index.ts         |     100 |      100 |     100 |     100 |                   
  ...nfigErrors.ts |   74.22 |       44 |   84.61 |   74.22 | ...,67-74,106-117 
  ...igResolver.ts |   98.71 |    93.33 |     100 |   98.71 | 166,328,334       
  modelRegistry.ts |     100 |    98.11 |     100 |     100 | 177,261           
  modelsConfig.ts  |   89.36 |    86.93 |   88.09 |   89.36 | ...1404,1433-1434 
  types.ts         |     100 |      100 |     100 |     100 |                   
 src/output        |     100 |      100 |     100 |     100 |                   
  ...-formatter.ts |     100 |      100 |     100 |     100 |                   
  types.ts         |     100 |      100 |     100 |     100 |                   
 src/permissions   |   83.79 |    91.16 |   71.07 |   83.79 |                   
  autoMode.ts      |   97.66 |    93.13 |     100 |   97.66 | ...82-589,635,712 
  ...transcript.ts |      98 |       84 |     100 |      98 | 200-201           
  classifier.ts    |      94 |    94.54 |     100 |      94 | 158-165,389-393   
  ...erousRules.ts |     100 |    89.36 |     100 |     100 | 110,133,147,175   
  ...alTracking.ts |     100 |      100 |     100 |     100 |                   
  ...e-commands.ts |   86.77 |     73.8 |     100 |   86.77 | 131-141,210-214   
  index.ts         |     100 |      100 |     100 |     100 |                   
  ...on-manager.ts |   86.63 |    89.01 |      80 |   86.63 | ...1111,1217-1221 
  rule-parser.ts   |   94.49 |     92.7 |     100 |   94.49 | ...1447,1481-1483 
  ...-semantics.ts |   70.44 |    91.07 |   46.66 |   70.44 | ...2237,2311-2314 
  types.ts         |     100 |      100 |     100 |     100 |                   
 ...sifier-prompts |   99.04 |    95.23 |     100 |   99.04 |                   
  system-prompt.ts |   99.04 |    95.23 |     100 |   99.04 | 220               
 src/prompts       |   83.63 |      100 |    87.5 |   83.63 |                   
  mcp-prompts.ts   |   18.18 |      100 |       0 |   18.18 | 11-19             
  ...t-registry.ts |     100 |      100 |     100 |     100 |                   
 src/providers     |   83.71 |     78.6 |   81.25 |   83.71 |                   
  all-providers.ts |     100 |      100 |     100 |     100 |                   
  index.ts         |     100 |      100 |     100 |     100 |                   
  install.ts       |   93.11 |     84.5 |     100 |   93.11 | ...56-257,330-331 
  ...der-config.ts |   75.85 |    74.04 |   78.26 |   75.85 | ...73-474,502-503 
  types.ts         |       0 |        0 |       0 |       0 | 1                 
 ...viders/presets |   97.82 |    91.66 |   63.63 |   97.82 |                   
  ...oding-plan.ts |   87.34 |      100 |       0 |   87.34 | 81-83,86-88,90-93 
  ...a-standard.ts |     100 |      100 |     100 |     100 |                   
  ...token-plan.ts |     100 |      100 |     100 |     100 |                   
  ...m-provider.ts |   97.05 |    81.25 |      75 |   97.05 | 118-119           
  deepseek.ts      |     100 |      100 |     100 |     100 |                   
  grok.ts          |     100 |      100 |     100 |     100 |                   
  idealab.ts       |     100 |      100 |     100 |     100 |                   
  minimax.ts       |     100 |      100 |     100 |     100 |                   
  modelscope.ts    |     100 |      100 |     100 |     100 |                   
  openrouter.ts    |     100 |      100 |     100 |     100 |                   
  requesty.ts      |     100 |      100 |     100 |     100 |                   
  zai.ts           |     100 |      100 |     100 |     100 |                   
 src/qwen          |   85.41 |    78.76 |   95.89 |   85.41 |                   
  ...tGenerator.ts |   98.64 |    98.18 |     100 |   98.64 | 105-106           
  qwenOAuth2.ts    |   82.79 |    73.75 |   90.62 |   82.79 | ...1205-1221,1251 
  ...kenManager.ts |   85.36 |    76.61 |     100 |   85.36 | ...52-757,778-783 
 src/resources     |     100 |      100 |     100 |     100 |                   
  ...e-registry.ts |     100 |      100 |     100 |     100 |                   
 src/services      |   89.71 |    84.68 |   96.92 |   89.71 |                   
  ...ionTrailer.ts |     100 |      100 |     100 |     100 |                   
  ...llRegistry.ts |    98.5 |     87.5 |     100 |    98.5 | 81-82,105,476-477 
  ...ionService.ts |   97.51 |    96.15 |     100 |   97.51 | ...,929,1072-1080 
  ...ingService.ts |   91.41 |    85.15 |   95.65 |   91.41 | ...2116,2143-2144 
  ...ttribution.ts |   91.73 |    87.71 |      90 |   91.73 | ...80-685,826-827 
  ...utSlimming.ts |    97.2 |    93.93 |     100 |    97.2 | ...39-340,378-381 
  cronScheduler.ts |   94.17 |    90.45 |      98 |   94.17 | ...1333,1736-1737 
  cronTasksFile.ts |   95.49 |    90.82 |     100 |   95.49 | ...37,346-347,483 
  cronTasksLock.ts |   94.44 |    89.47 |     100 |   94.44 | ...02-103,132-133 
  ...eryService.ts |   96.22 |    93.54 |      90 |   96.22 | 121,155-156,161   
  ...oryService.ts |   88.17 |    79.02 |    92.3 |   88.17 | ...1303,1344-1347 
  fileReadCache.ts |    97.5 |    96.07 |     100 |    97.5 | 349-350,363-364   
  ...temService.ts |    92.8 |    84.68 |   94.11 |    92.8 | ...53,479-486,531 
  ...ratedFiles.ts |      96 |    88.23 |     100 |      96 | 119-120,146-147   
  gitInit.ts       |     100 |      100 |     100 |     100 |                   
  ...reeService.ts |    73.7 |    68.49 |   95.83 |    73.7 | ...2196,2225-2226 
  ...on-service.ts |   87.38 |       72 |     100 |   87.38 | ...01-305,343-344 
  ...references.ts |   98.39 |    88.76 |     100 |   98.39 | 154-155,215-216   
  ...ionService.ts |   98.26 |    97.35 |     100 |   98.26 | ...13-714,761-762 
  ...ticsDumper.ts |   98.37 |    95.23 |     100 |   98.37 | 185-186           
  ...ureMonitor.ts |   95.82 |    90.52 |   97.05 |   95.82 | ...60,861,875-877 
  ...orRegistry.ts |    97.3 |    91.22 |     100 |    97.3 | ...53-454,611-612 
  ...ttachments.ts |   97.74 |    90.85 |     100 |   97.74 | 298-308,646       
  ...ersistence.ts |   90.95 |    78.75 |     100 |   90.95 | ...78,963-964,992 
  ...on-service.ts |   94.49 |    92.26 |   97.14 |   94.49 | ...98-600,656-664 
  ...ce-service.ts |    98.5 |    94.11 |    90.9 |    98.5 | 64-65             
  ...ipt-reader.ts |   94.55 |    89.78 |   96.66 |   94.55 | ...1353-1354,1422 
  ...est-helper.ts |       0 |        0 |       0 |       0 | 1-65              
  ...iter-lease.ts |   82.45 |    74.11 |   97.61 |   82.45 | ...2433,2445-2448 
  sessionRecap.ts  |   67.56 |    43.47 |     100 |   67.56 | ...60,178,180-183 
  ...ionService.ts |   89.08 |    84.71 |   97.18 |   89.08 | ...2514,2590-2610 
  sessionTitle.ts  |   94.26 |    73.21 |     100 |   94.26 | ...45-248,279-280 
  ...ionService.ts |    84.4 |    78.45 |   97.18 |    84.4 | ...2493,2499-2504 
  ...pInhibitor.ts |   97.42 |    92.77 |     100 |   97.42 | ...30,169,369-370 
  ...Estimation.ts |     100 |    88.23 |     100 |     100 | 118-119           
  ...ageService.ts |   97.76 |    91.59 |   93.75 |   97.76 | ...61-262,366,567 
  ...ite-origin.ts |     100 |    93.33 |     100 |     100 | 32                
  ...UseSummary.ts |   94.63 |    88.46 |     100 |   94.63 | ...62-164,214-215 
  ...rd-service.ts |     100 |    88.37 |     100 |     100 | ...29,145-146,241 
  ...oryService.ts |   90.72 |    84.07 |     100 |   90.72 | ...06-509,561-562 
  ...reeCleanup.ts |   14.42 |      100 |   33.33 |   14.42 | 58-186            
  ...ionService.ts |   88.36 |     87.8 |     100 |   88.36 | ...48-449,465-466 
 ...icrocompaction |    98.9 |    95.08 |     100 |    98.9 |                   
  microcompact.ts  |    98.9 |    95.08 |     100 |    98.9 | ...40,749,758-759 
 ...s/visionBridge |   98.81 |    92.12 |     100 |   98.81 |                   
  ...capability.ts |     100 |      100 |     100 |     100 |                   
  ...part-utils.ts |     100 |      100 |     100 |     100 |                   
  ...ion-bridge.ts |   98.72 |    82.35 |     100 |   98.72 | 65,71             
  ...-constants.ts |     100 |      100 |     100 |     100 |                   
  ...ge-service.ts |   98.61 |     94.7 |     100 |   98.61 | ...06,666,679-680 
 src/skills        |   89.29 |    85.89 |   93.61 |   89.29 |                   
  index.ts         |     100 |      100 |     100 |     100 |                   
  ...activation.ts |     100 |    93.33 |     100 |     100 | 93,112            
  skill-curator.ts |   89.71 |    81.54 |     100 |   89.71 | ...01-902,904-907 
  skill-load.ts    |   94.84 |     87.5 |     100 |   94.84 | ...03,223,235-237 
  skill-manager.ts |   84.82 |    85.29 |   83.33 |   84.82 | ...1243,1250-1254 
  skill-paths.ts   |   90.42 |     87.5 |     100 |   90.42 | ...19-120,125-126 
  symlinkScope.ts  |     100 |      100 |     100 |     100 |                   
  types.ts         |   97.91 |    98.03 |     100 |   97.91 | 277-278           
 ...ataviz/scripts |   80.06 |    95.23 |   88.23 |   80.06 |                   
  ...te_palette.js |   80.06 |    95.23 |   88.23 |   80.06 | 261-296,306-328   
 ...s/bundled/loop |   97.48 |    95.77 |     100 |   97.48 |                   
  ...omous-loop.ts |     100 |      100 |     100 |     100 |                   
  ...-task-file.ts |   94.85 |     92.4 |     100 |   94.85 | ...56,367,375-376 
  ...k-resolver.ts |     100 |      100 |     100 |     100 |                   
 src/subagents     |   87.72 |    89.01 |   96.55 |   87.72 |                   
  ...ter-schema.ts |     100 |    98.07 |     100 |     100 | 99                
  ...tin-agents.ts |     100 |      100 |     100 |     100 |                   
  index.ts         |     100 |      100 |     100 |     100 |                   
  ...nt-manager.ts |   84.48 |    85.91 |   94.87 |   84.48 | ...1582,1659-1660 
  types.ts         |     100 |      100 |     100 |     100 |                   
  validation.ts    |   92.46 |    95.18 |     100 |   92.46 | 47-52,63-68,71-76 
 src/telemetry     |   81.83 |    83.71 |   84.92 |   81.83 |                   
  ...ty-tracker.ts |     100 |      100 |     100 |     100 |                   
  config.ts        |     100 |      100 |     100 |     100 |                   
  constants.ts     |     100 |      100 |     100 |     100 |                   
  ...on-metrics.ts |   99.08 |    80.95 |     100 |   99.08 | 185,199           
  ...on-tracing.ts |   76.31 |    74.62 |   73.68 |   76.31 | ...80,387-389,405 
  ...attributes.ts |   95.15 |    87.27 |     100 |   95.15 | ...97-198,216-217 
  ...ag-metrics.ts |     100 |    77.77 |     100 |     100 | 21,40             
  ...t-loop-lag.ts |   96.85 |    85.71 |     100 |   96.85 | 170-173           
  ...-exporters.ts |   65.78 |    83.33 |   55.55 |   65.78 | ...04-105,108-109 
  ...ai-content.ts |    74.5 |    66.41 |   91.66 |    74.5 | ...1480,1493-1502 
  ...i-provider.ts |     100 |       99 |     100 |     100 | 99                
  ...ai-request.ts |   87.52 |    92.79 |   83.78 |   87.52 | ...55-561,564-570 
  gen-ai-usage.ts  |     100 |      100 |     100 |     100 |                   
  index.ts         |     100 |      100 |     100 |     100 |                   
  ...t.circular.ts |       0 |        0 |       0 |       0 | 1-111             
  ...-processor.ts |    99.1 |    95.72 |      95 |    99.1 | 145,369-370       
  ...t.circular.ts |       0 |        0 |       0 |       0 | 1-128             
  loggers.ts       |   60.25 |    77.03 |   66.66 |   60.25 | ...1492,1509-1529 
  metrics.ts       |   80.37 |    82.35 |   80.95 |   80.37 | ...1150,1153-1164 
  otlp-urls.ts     |     100 |      100 |     100 |     100 |                   
  ...attributes.ts |     100 |      100 |     100 |     100 |                   
  ...ime-config.ts |       0 |        0 |       0 |       0 | 1                 
  sanitize.ts      |      80 |    83.33 |     100 |      80 | 35-36,41-42       
  ...rters-grpc.ts |     100 |      100 |     100 |     100 |                   
  ...rters-http.ts |     100 |      100 |     100 |     100 |                   
  sdk-impl.ts      |   91.06 |    87.15 |   68.75 |   91.06 | ...32,482-483,499 
  sdk.ts           |    82.7 |     90.9 |   66.66 |    82.7 | ...00-204,242-264 
  ...on-context.ts |     100 |      100 |     100 |     100 |                   
  ...ion-events.ts |     100 |      100 |     100 |     100 |                   
  ...on-tracing.ts |    91.1 |    88.68 |   96.77 |    91.1 | ...1737,1768-1771 
  ...etry-utils.ts |     100 |      100 |     100 |     100 |                   
  ...l-decision.ts |     100 |      100 |     100 |     100 |                   
  trace-context.ts |     100 |      100 |     100 |     100 |                   
  ...e-id-utils.ts |     100 |      100 |     100 |     100 |                   
  tracer.ts        |   98.56 |    88.63 |     100 |   98.56 | 52,101            
  types.ts         |   83.09 |    88.31 |   86.36 |   83.09 | ...1467,1471-1478 
  uiTelemetry.ts   |   97.18 |    93.93 |      88 |   97.18 | ...70,314,461-462 
 ...ry/qwen-logger |   74.23 |    80.53 |      70 |   74.23 |                   
  event-types.ts   |       0 |        0 |       0 |       0 |                   
  qwen-logger.ts   |   74.23 |    80.35 |   69.49 |   74.23 | ...1122,1160-1161 
 src/test-utils    |   96.38 |    98.61 |   83.33 |   96.38 |                   
  config.ts        |     100 |      100 |     100 |     100 |                   
  ...st-helpers.ts |   94.11 |       90 |     100 |   94.11 | 69-70             
  index.ts         |     100 |      100 |     100 |     100 |                   
  ...mised-lock.ts |     100 |      100 |     100 |     100 |                   
  mock-tool.ts     |   94.85 |      100 |   78.78 |   94.85 | ...53,227-228,241 
  ...aceContext.ts |     100 |      100 |     100 |     100 |                   
 src/tools         |   86.25 |    85.07 |   88.72 |   86.25 |                   
  ...erQuestion.ts |   89.71 |    80.76 |   91.66 |   89.71 | ...66-367,374-375 
  ...-registrar.ts |    77.7 |    66.66 |   66.66 |    77.7 | ...72-277,292-294 
  ...ub-session.ts |   89.67 |     91.3 |   81.81 |   89.67 | ...03-304,315-322 
  cron-create.ts   |   90.64 |    92.85 |   72.72 |   90.64 | ...,73-74,223-231 
  cron-delete.ts   |   97.56 |      100 |   83.33 |   97.56 | 31-32             
  cron-list.ts     |   98.23 |    95.34 |    87.5 |   98.23 | 57-58             
  diffOptions.ts   |     100 |      100 |     100 |     100 |                   
  display-image.ts |   87.42 |    84.84 |   88.88 |   87.42 | ...29-134,194-195 
  edit.ts          |   82.76 |    86.77 |   81.25 |   82.76 | ...45-746,865-915 
  ...r-worktree.ts |   83.14 |    67.56 |    87.5 |   83.14 | ...84-187,278-279 
  enterPlanMode.ts |      85 |     82.6 |    87.5 |      85 | ...28-133,161-175 
  exit-worktree.ts |   83.29 |    83.65 |   94.44 |   83.29 | ...14-515,537-538 
  exitPlanMode.ts  |      95 |    85.29 |     100 |      95 | ...21-325,344,378 
  ...permission.ts |     100 |      100 |     100 |     100 |                   
  glob.ts          |   96.33 |     88.5 |     100 |   96.33 | ...24-225,373,376 
  grep.ts          |   90.73 |    86.61 |   85.71 |   90.73 | ...76-677,727-728 
  ...adTracking.ts |     100 |      100 |     100 |     100 |                   
  image-gen.ts     |   91.66 |    77.41 |    90.9 |   91.66 | ...13-214,221-222 
  list-agents.ts   |   94.02 |    82.35 |   83.33 |   94.02 | 31-32,47-48       
  loop-wakeup.ts   |   99.27 |    92.85 |     100 |   99.27 | 45                
  ls.ts            |   96.74 |    90.27 |     100 |   96.74 | 176-181,212,216   
  lsp.ts           |   72.71 |     59.5 |   90.32 |   72.71 | ...1212,1214-1215 
  ...nt-manager.ts |   82.13 |    80.47 |   85.71 |   82.13 | ...3234,3236-3237 
  mcp-client.ts    |   80.03 |    86.58 |   89.47 |   80.03 | ...2272,2276-2279 
  ...ry-timeout.ts |     100 |      100 |     100 |     100 |                   
  mcp-errors.ts    |     100 |      100 |     100 |     100 |                   
  ...pool-entry.ts |   79.21 |    85.71 |   81.57 |   79.21 | ...1341,1349-1350 
  ...ool-events.ts |       8 |      100 |       0 |       8 | 132-158           
  mcp-pool-key.ts  |   97.46 |    93.93 |     100 |   97.46 | 176-177           
  ...ce-content.ts |   96.55 |    91.17 |     100 |   96.55 | 80-82             
  mcp-retry.ts     |   97.67 |    95.65 |     100 |   97.67 | 131-132           
  ...ion-config.ts |     100 |      100 |     100 |     100 |                   
  mcp-status.ts    |     100 |      100 |     100 |     100 |                   
  mcp-tool.ts      |   98.35 |    93.71 |     100 |   98.35 | ...-990,1045-1046 
  ...sport-pool.ts |   83.98 |     80.3 |   88.46 |   83.98 | ...1409,1416-1420 
  ...ace-budget.ts |   87.27 |     82.6 |     100 |   87.27 | ...00-305,340-345 
  memory-config.ts |     100 |      100 |     100 |     100 |                   
  ...iable-tool.ts |     100 |    84.61 |     100 |     100 | 101,108           
  monitor.ts       |   91.82 |    83.09 |   88.46 |   91.82 | ...99,612,810-815 
  notebook-edit.ts |   85.71 |    77.08 |   81.25 |   85.71 | ...96-912,958-959 
  ...escendants.ts |   36.17 |    64.51 |   55.55 |   36.17 | ...46-310,385-390 
  ...nforcement.ts |   83.21 |    90.69 |     100 |   83.21 | 147-158,207-220   
  read-file.ts     |   95.49 |    88.52 |   86.66 |   95.49 | ...49,464,536-537 
  ...p-resource.ts |   96.85 |      100 |   91.66 |   96.85 | 92-96             
  ...d-artifact.ts |   91.18 |    86.71 |    87.5 |   91.18 | ...26-427,441-453 
  ripGrep.ts       |    94.6 |    87.26 |   95.23 |    94.6 | ...33-734,740-741 
  ...-transport.ts |   71.42 |    55.55 |   71.42 |   71.42 | ...36-137,143-144 
  send-message.ts  |   81.13 |    89.74 |    62.5 |   81.13 | ...80-286,363-371 
  ...n-mcp-view.ts |   94.07 |    91.89 |    90.9 |   94.07 | 131-139           
  shell.ts         |   78.81 |    84.22 |   91.91 |   78.81 | ...5036,5099-5100 
  skill-utils.ts   |     100 |      100 |     100 |     100 |                   
  skill.ts         |   91.39 |    92.55 |      90 |   91.39 | ...84,488,534-556 
  ...eticOutput.ts |   95.12 |      100 |      80 |   95.12 | 87-88             
  task-create.ts   |    94.4 |    93.33 |   81.81 |    94.4 | 45-49,63-64,95    
  task-list.ts     |   73.38 |    77.77 |   83.33 |   73.38 | ...02,105,109-116 
  task-stop.ts     |   93.14 |    96.15 |   85.71 |   93.14 | 39-40,54-64       
  task-update.ts   |   82.89 |    83.92 |    92.3 |   82.89 | ...14-422,454-465 
  team-create.ts   |   97.22 |    85.71 |   83.33 |   97.22 | 48-49,129-130     
  team-delete.ts   |   86.74 |    83.33 |   83.33 |   86.74 | 37-38,42-48,72-73 
  ...n-approval.ts |   92.14 |    96.77 |   77.77 |   92.14 | 38-39,42-43,93-99 
  todoWrite.ts     |   95.13 |    87.85 |   93.33 |   95.13 | ...23-527,540-545 
  tool-error.ts    |     100 |      100 |     100 |     100 |                   
  tool-names.ts    |     100 |      100 |     100 |     100 |                   
  tool-registry.ts |   78.57 |    79.59 |    82.6 |   78.57 | ...89-990,998-999 
  tool-search.ts   |   96.19 |    89.72 |   93.33 |   96.19 | ...09,259-264,426 
  tools.ts         |   93.11 |    92.53 |   91.66 |   93.11 | ...69-570,586-592 
  ...reapproved.ts |   99.27 |    94.11 |     100 |   99.27 | 170               
  web-fetch.ts     |   96.05 |    90.54 |   96.77 |   96.05 | ...85-786,800-801 
  web-search.ts    |   90.58 |    83.57 |      80 |   90.58 | ...1025,1083-1086 
  write-file.ts    |   86.72 |    84.92 |   88.88 |   86.72 | ...25-828,865-900 
  zoom-image.ts    |   95.76 |    93.75 |      90 |   95.76 | 54-59,203-204     
 src/tools/agent   |   87.22 |    87.68 |   88.69 |   87.22 |                   
  agent.ts         |   85.84 |    86.59 |   86.31 |   85.84 | ...4315,4337-4347 
  fork-profile.ts  |   93.65 |       90 |     100 |   93.65 | ...33-134,171-174 
  fork-subagent.ts |   98.73 |       95 |     100 |   98.73 | 101-102,173       
 ...tools/artifact |   95.78 |    92.51 |   88.63 |   95.78 |                   
  artifact-tool.ts |   91.46 |    88.46 |   71.42 |   91.46 | ...13-314,322-325 
  ...-publisher.ts |     100 |    85.71 |     100 |     100 | 32                
  ...-publisher.ts |   96.74 |    97.72 |    87.5 |   96.74 | 29-30,156-157     
  html.ts          |     100 |    96.77 |     100 |     100 | 122               
  ...-publisher.ts |     100 |       80 |     100 |     100 | 30                
  oss-publisher.ts |    98.1 |    91.48 |     100 |    98.1 | 43-45             
  publisher.ts     |     100 |      100 |     100 |     100 |                   
 ...s/computer-use |   90.21 |    82.17 |   78.08 |   90.21 |                   
  bootstrap.ts     |   59.42 |    80.95 |   41.66 |   59.42 | ...35-339,341-345 
  client.ts        |   80.11 |       90 |   77.77 |   80.11 | ...97,242-243,274 
  constants.ts     |     100 |    94.73 |     100 |     100 | 129,256           
  downloader.ts    |   65.29 |    52.77 |   58.33 |   65.29 | ...99-300,316-355 
  index.ts         |     100 |      100 |     100 |     100 |                   
  install-state.ts |   94.44 |    72.72 |     100 |   94.44 | 44-45             
  ...n-detector.ts |     100 |     87.5 |     100 |     100 | 50                
  schemas.ts       |     100 |      100 |     100 |     100 |                   
  tool.ts          |    96.3 |    85.71 |     100 |    96.3 | 75-76,184,252-258 
 ...tools/workflow |   86.51 |    84.81 |      75 |   86.51 |                   
  workflow.ts      |   86.51 |    84.81 |      75 |   86.51 | ...67,512,514-515 
 src/utils         |   92.89 |    89.61 |   96.88 |   92.89 |                   
  LruCache.ts      |     100 |      100 |     100 |     100 |                   
  ...Controller.ts |     100 |      100 |     100 |     100 |                   
  ...ssageQueue.ts |     100 |      100 |     100 |     100 |                   
  ...cFileWrite.ts |   94.94 |    92.47 |     100 |   94.94 | ...43-544,651-655 
  bareMode.ts      |   81.81 |      100 |      50 |   81.81 | 18-19             
  ...ry-content.ts |   98.45 |    95.45 |     100 |   98.45 | 132-133,159-160   
  browser.ts       |   86.84 |    78.94 |     100 |   86.84 | 34,36-37,65-66    
  btwUtils.ts      |   13.95 |      100 |       0 |   13.95 | 17-31,34-55       
  bundlePaths.ts   |     100 |      100 |     100 |     100 |                   
  ...on-context.ts |     100 |      100 |     100 |     100 |                   
  ...igResolver.ts |     100 |      100 |     100 |     100 |                   
  ...engthError.ts |   91.06 |    89.47 |     100 |   91.06 | ...46-147,154-155 
  ...n-branches.ts |   95.88 |    94.11 |      95 |   95.88 | ...98-499,511-524 
  ...tion-chain.ts |     100 |      100 |     100 |     100 |                   
  cronDisplay.ts   |     100 |    97.61 |     100 |     100 | 46                
  cronParser.ts    |   95.34 |    93.33 |     100 |   95.34 | 41-42,47-48,70-71 
  debugLogger.ts   |   96.66 |    96.61 |   88.88 |   96.66 | 192-196           
  editHelper.ts    |   93.63 |     83.9 |     100 |   93.63 | ...27-428,462-463 
  editor.ts        |   97.65 |    95.45 |     100 |   97.65 | ...35-336,338-339 
  encoding.ts      |     100 |      100 |     100 |     100 |                   
  env.ts           |     100 |      100 |     100 |     100 |                   
  ...arResolver.ts |   94.28 |    88.88 |     100 |   94.28 | 28-29,125-126     
  ...entContext.ts |   96.63 |    90.13 |   96.66 |   96.63 | ...42,444-445,512 
  errorParsing.ts  |     100 |      100 |     100 |     100 |                   
  ...rReporting.ts |   95.65 |    93.33 |     100 |   95.65 | 37-38             
  errors.ts        |   83.39 |    95.17 |    61.9 |   83.39 | ...81-397,401-407 
  fetch.ts         |   90.68 |    82.51 |     100 |   90.68 | ...72,483-484,503 
  file-identity.ts |     100 |      100 |     100 |     100 |                   
  fileUtils.ts     |   94.87 |    92.95 |   96.15 |   94.87 | ...1907,1915-1916 
  forkedAgent.ts   |   92.45 |    82.35 |   93.75 |   92.45 | ...34,642,647-654 
  formatters.ts    |     100 |      100 |     100 |     100 |                   
  ...eUtilities.ts |    92.4 |    86.95 |     100 |    92.4 | ...52-158,168-169 
  ...rStructure.ts |   94.39 |    94.28 |     100 |   94.39 | ...29-132,343-348 
  getPty.ts        |   31.57 |       50 |     100 |   31.57 | 26-38             
  git-branches.ts  |    91.6 |    84.21 |    92.3 |    91.6 | ...90,405-410,570 
  ...fig-safety.ts |   97.01 |       80 |     100 |   97.01 | 53-54             
  gitDiff.ts       |   95.19 |    81.36 |     100 |   95.19 | ...1073,1419-1420 
  gitDirect.ts     |   98.84 |    94.28 |     100 |   98.84 | 234,318           
  ...noreParser.ts |   94.48 |    93.22 |     100 |   94.48 | ...23-124,158-159 
  gitUtils.ts      |   78.02 |    81.25 |   85.71 |   78.02 | ...22-123,147-198 
  github-prs.ts    |   95.74 |    82.27 |     100 |   95.74 | 216,314-322       
  iconvHelper.ts   |     100 |      100 |     100 |     100 |                   
  ...rePatterns.ts |     100 |      100 |     100 |     100 |                   
  image-view.ts    |   95.12 |    93.33 |     100 |   95.12 | ...68-172,240-244 
  ...ionManager.ts |     100 |     90.9 |     100 |     100 | 27                
  ...lPromptIds.ts |     100 |      100 |     100 |     100 |                   
  ...on-context.ts |     100 |      100 |     100 |     100 |                   
  jsonl-utils.ts   |   95.41 |    93.54 |     100 |   95.41 | ...27-328,370-373 
  ...-detection.ts |     100 |      100 |     100 |     100 |                   
  ...iconv-lite.ts |     100 |      100 |     100 |     100 |                   
  ...simple-git.ts |   96.77 |    91.66 |     100 |   96.77 | 38                
  ...m-headless.ts |      96 |    88.88 |     100 |      96 | 34                
  ...iagnostics.ts |    96.4 |     94.2 |     100 |    96.4 | ...66,293-294,376 
  ...yDiscovery.ts |    92.4 |    89.13 |     100 |    92.4 | ...28,331,522-525 
  ...tProcessor.ts |   94.01 |       90 |     100 |   94.01 | ...47-353,445-446 
  ...Inspectors.ts |     100 |      100 |     100 |     100 |                   
  modelId.ts       |   98.96 |    98.21 |     100 |   98.96 | 153               
  ...kerChecker.ts |    90.9 |    91.66 |     100 |    90.9 | 73-79             
  notebook.ts      |   94.57 |    89.91 |   95.83 |   94.57 | ...21,333,385-387 
  openaiLogger.ts  |   91.66 |    89.74 |     100 |   91.66 | ...26-228,251-256 
  osc8.ts          |   54.26 |    64.86 |   83.33 |   54.26 | ...72-195,197-257 
  partUtils.ts     |     100 |    98.64 |     100 |     100 | 211               
  pathReader.ts    |     100 |      100 |     100 |     100 |                   
  paths.ts         |   93.61 |    92.42 |     100 |   93.61 | ...62-563,565-567 
  pdf.ts           |   92.17 |    85.81 |     100 |   92.17 | ...64-565,606-611 
  projectPath.ts   |     100 |      100 |     100 |     100 |                   
  projectRoot.ts   |   71.73 |    78.57 |     100 |   71.73 | 54-66             
  ...ectSummary.ts |   89.62 |    72.41 |     100 |   89.62 | ...40-145,196-199 
  ...tIdContext.ts |     100 |      100 |     100 |     100 |                   
  proxyUtils.ts    |     100 |      100 |     100 |     100 |                   
  ...rDetection.ts |   71.15 |       86 |     100 |   71.15 | ...-90,96-101,147 
  ...noreParser.ts |   92.63 |    91.66 |     100 |   92.63 | ...77-178,197-198 
  rateLimit.ts     |   93.75 |    89.62 |     100 |   93.75 | ...13,218-219,262 
  ...text-range.ts |   96.98 |    87.15 |     100 |   96.98 | ...87-688,763-764 
  readManyFiles.ts |   95.75 |    80.86 |     100 |   95.75 | ...05,558,568-572 
  retry.ts         |   96.09 |    92.52 |     100 |   96.09 | ...67,558-559,577 
  retryContext.ts  |     100 |      100 |     100 |     100 |                   
  ...sification.ts |   97.63 |    97.08 |     100 |   97.63 | ...17,251-252,278 
  retryPolicy.ts   |   97.72 |    90.56 |     100 |   97.72 | 130-131           
  ripgrepUtils.ts  |   90.04 |    93.43 |   95.45 |   90.04 | ...55-565,598-599 
  ...sDiscovery.ts |   97.46 |    93.05 |     100 |   97.46 | ...04,182-183,202 
  ...iagnostics.ts |   83.08 |     67.5 |   92.59 |   83.08 | ...23,543-544,550 
  ...tchOptions.ts |   84.87 |    86.71 |   96.29 |   84.87 | ...71,696,725-734 
  ...odelPrefix.ts |     100 |      100 |     100 |     100 |                   
  runtimeStatus.ts |   97.77 |    91.48 |     100 |   97.77 | 172-173           
  safe-mode.ts     |     100 |      100 |     100 |     100 |                   
  safeJsonParse.ts |     100 |      100 |     100 |     100 |                   
  ...nStringify.ts |     100 |      100 |     100 |     100 |                   
  ...-child-env.ts |     100 |      100 |     100 |     100 |                   
  ...aConverter.ts |   98.03 |    97.75 |     100 |   98.03 | 100,102-103       
  ...aValidator.ts |   92.09 |    83.65 |   90.47 |   92.09 | ...60,882-883,896 
  ...r-launcher.ts |   96.35 |    93.97 |   85.71 |   96.35 | ...35-336,347-348 
  sedEditParser.ts |   91.78 |    92.18 |     100 |   91.78 | ...66-569,645-646 
  ...nIdContext.ts |     100 |      100 |     100 |     100 |                   
  ...orageUtils.ts |   95.98 |    83.96 |     100 |   95.98 | ...70,386,466,485 
  ...-pager-env.ts |     100 |      100 |     100 |     100 |                   
  ...fety-rules.ts |     100 |     89.7 |     100 |     100 | ...01,304,309-311 
  shell-utils.ts   |   86.07 |    88.34 |     100 |   86.07 | ...2269,2276-2280 
  ...lAstParser.ts |   98.27 |    91.38 |     100 |   98.27 | ...1321-1323,1333 
  ...ContextEnv.ts |     100 |       92 |     100 |     100 | 50-52             
  ...nlyChecker.ts |   96.33 |    96.57 |     100 |   96.33 | ...83-284,292-293 
  sideQuery.ts     |   86.82 |    86.66 |     100 |   86.82 | ...79-185,187-193 
  ...pEventSink.ts |     100 |       80 |     100 |     100 | 61                
  ...tGenerator.ts |     100 |      100 |     100 |     100 |                   
  ...ameContext.ts |     100 |      100 |     100 |     100 |                   
  symlink.ts       |   77.77 |       50 |     100 |   77.77 | 44,54-59          
  ...e-encoding.ts |   85.96 |    76.47 |     100 |   85.96 | 58-61,64-65,78-79 
  ...emEncoding.ts |   96.36 |    91.17 |     100 |   96.36 | 59-60,124-125     
  terminalSafe.ts  |     100 |      100 |     100 |     100 |                   
  ...Serializer.ts |   98.72 |       90 |     100 |   98.72 | 42-43,134,201-203 
  testUtils.ts     |   53.33 |      100 |   33.33 |   53.33 | ...53,59-64,70-72 
  ...-constants.ts |     100 |      100 |     100 |     100 |                   
  textUtils.ts     |      65 |      100 |      75 |      65 | 56-75             
  thoughtUtils.ts  |     100 |    95.65 |     100 |     100 | 99                
  ...-converter.ts |   95.23 |    85.71 |     100 |   95.23 | 36-37             
  ...name-utils.ts |     100 |      100 |     100 |     100 |                   
  ...-finalizer.ts |   97.66 |     90.9 |     100 |   97.66 | 165-166,168-172   
  tool-utils.ts    |    95.2 |    93.61 |     100 |    95.2 | ...58-159,162-163 
  ...ultCleanup.ts |   54.62 |       25 |      75 |   54.62 | ...03-105,108-134 
  ...Compaction.ts |   96.13 |    96.42 |     100 |   96.13 | ...34-339,341-346 
  ...pt-records.ts |    87.5 |    86.13 |     100 |    87.5 | ...76-480,510-525 
  truncation.ts    |   90.56 |    90.43 |     100 |   90.56 | ...35-443,480-486 
  windowsPath.ts   |   89.47 |    79.31 |     100 |   89.47 | ...57-58,62,90-91 
  ...aceContext.ts |   95.39 |    89.47 |     100 |   95.39 | ...16-317,321-322 
  xml.ts           |    97.8 |    87.69 |     100 |    97.8 | 98-99             
  yaml-parser.ts   |   83.87 |    77.27 |     100 |   83.87 | ...31-234,239-240 
 ...ils/filesearch |   83.94 |    80.72 |   94.73 |   83.94 |                   
  crawlCache.ts    |     100 |      100 |     100 |     100 |                   
  crawler.ts       |    82.9 |    76.81 |   95.08 |    82.9 | ...1563,1597-1598 
  fileSearch.ts    |   93.78 |    87.67 |     100 |   93.78 | ...71-272,274-275 
  fzfWorker.ts     |       0 |        0 |       0 |       0 | 1-109             
  ...rkerHandle.ts |   84.05 |    75.43 |   89.47 |   84.05 | ...30-334,340-341 
  ignore.ts        |     100 |    97.36 |     100 |     100 | 187               
  result-cache.ts  |     100 |    93.75 |     100 |     100 | 49                
 ...uest-tokenizer |   69.76 |    75.47 |   85.29 |   69.76 |                   
  ...eTokenizer.ts |   65.72 |    74.02 |    92.3 |   65.72 | ...65-466,479-533 
  index.ts         |     100 |      100 |     100 |     100 |                   
  ...tTokenizer.ts |   68.39 |    69.49 |    90.9 |   68.39 | ...24-325,327-328 
  ...ageFormats.ts |   76.92 |      100 |   33.33 |   76.92 | 46-49,56-57       
  textTokenizer.ts |     100 |      100 |     100 |     100 |                   
  types.ts         |       0 |        0 |       0 |       0 | 1                 
-------------------|---------|----------|---------|---------|-------------------

For detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run.

@doudouOUC
doudouOUC requested a review from wenshao August 12, 2026 08:55
@doudouOUC doudouOUC self-assigned this Aug 12, 2026

@yiliang114 yiliang114 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the race-gap closures against the merged #8939 coordinator design; all gaps are real and the fixes hold. Approving.

Verified fixes

  • runnerActiveTurn latch: previously recomputed from hasSessionActivePrompt() (which includes the :shell entry) at turn-terminal/stream-start, so a shell running when a remote turn completed latched activeTurn true with nothing to clear it — a queued same-session refresh never started. Now runnerActiveTurn tracks only the runner event-stream turn lifecycle; orthogonal shell/prompt gating stays on the live hasCurrentSessionActivePromptRef() check in the pump/commit gates (3631/3838), and shell completion pumps via setPromptStatus('idle'). Fail-closed direction holds; new test pins observed-turn + shell ordering.
  • Controlled target during source-bound ops: replaced the terminal failed-transition with pending + retry-on-settle (controlledRetryPendingRef + nonce re-run). Latest-target-wins, re-blocks if a new source-bound op starts before the microtask, mount-guarded, and the counter decrements on both settle paths of the raw op (create/branch .then(dec, dec)), so the retry fires exactly when the final raw op settles even after an outer action timeout.
  • Capture lifecycle unification: cleanupTransitionArtifacts with preserveInFlightCapture: rawTransitionRef.current === intent applied consistently across deadline, pre-restore deadline, cancel, abort, supersede, and unmount paths. With a raw restore in flight the capture stays attached until .finally() releases it, so an exact-shape retry (adoptingRaw, same key) adopts the in-flight result with a gap-free tail; unadopted captures are released in .finally() — no lingering event capture. Removing the explicit retireAttachment calls is safe because exposeCrossSessionFailure is guarded by desiredTransitionRef.current === intent and the pump reaches those checks synchronously, so exactly one path retires. New test pins retire-once + post-failure capture release.
  • Unmount leak: unmount now routes through cancelTransitionRef, retiring the candidate and releasing the capture (previously only rejected the intent).
  • Committed clientId as recovery identity: the render-time prop mirror is now restricted to legacy daemons (no client_identity feature), so a committed rebind survives re-renders and ring/epoch recovery resumes with the attachment that owns the runner. No pre-capabilities gap — the ref is initialized to the same stable value.
  • Bridge bounded-load epoch: refreshedReplayFieldsFor snapshots epoch + watermark together and requires both (plus same entry, no active prompt) unchanged through the persisted-page read; fail-closed fallback retries once then uses the in-memory replay. Bounded responses now carry eventEpoch like full responses, so the provider's same-epoch commit CAS works with historyPageSize (previously candidate.eventEpoch === undefined failed the completeness check). Pinned in bridge.test.ts and the integration test.

CI note: Test (ubuntu-latest, Node 22.x) is red from ENOSPC: no space left on device in packages/cli/src/commands/review/lib/manifest-repository-context.test.ts (38/60) — runner disk exhaustion in a file this PR doesn't touch; unrelated infra. This PR's files are green: bridge.test.ts 568 ✓, DaemonSessionProvider.test.tsx 265 ✓.

Nit (P3, non-blocking): legacyClientIdDependency still computes initialClientIdDependencyRef.current for modern daemons where it is now unused — harmless, could be simplified later.

@doudouOUC
doudouOUC enabled auto-merge August 12, 2026 09:11
@doudouOUC

Copy link
Copy Markdown
Collaborator Author

@qwen-code /triage

@qwen-code-ci-bot

qwen-code-ci-bot commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Sandboxed verification: ✅ passed — merge-ready (agent verdict) - workflow run

Ran the PR in an isolated, token-free container: A/B against the base build, mock-free harness assertions, targeted gates. Advisory evidence for human reviewers — not a review, an approval, or a CI check.

Scripted assertions: 1670 passed · 0 failed · 1670 total

中文 — 判定:✅ 通过 · 可合入(agent 判定)

沙箱验证在隔离、无凭证的容器中执行了该 PR 的代码(与 base 构建 A/B 对照、无 mock harness 断言、定向门禁)。仅作为评审证据,不构成评审、批准或 CI 检查

脚本断言:1670 通过 · 0 失败 · 1670 总计

Verification report

PR 8990 — fix(webui): Close same-session refresh race gaps

Verdict: merge-ready — 1670/1670 executed assertions landed on their predicted outcome (0 unexpected failures); verified head 9e3d7d0dfbe8732dff8208181de70137a44f14d0, base 1570e6c73fd9ade90df9d8e220153b621bc35ead. One non-blocking coverage suggestion (see Findings).

中文摘要
  • 结论merge-ready。1670 条已执行断言全部落在预期结果上(0 个意外失败)。
  • A/B 结论:五个竞态缺口逐一反转。HEAD 测试文件对 base 源码跑出 4 failed | 261 passed(恰好是四个 provider 缺口测试),bridge 有界 load 测试在 base 上因响应缺少 eventEpoch 而红、在 HEAD 上绿;真实 daemon 集成(historyPageSize: 100 强制有界路径)在 HEAD 上 3/3 绿。261+567 个无关测试在两侧皆绿,作为阳性对照。
  • Findings:1 条非阻塞建议——bridge.ts 新增的 epoch 新鲜性子句(entry.events.epoch === eventEpoch)没有任何测试 pin 住(删除后 568/568 仍绿);判定为覆盖缺口而非死代码(它防护"有界页读取期间 daemon 重启"的窄竞态,缺失时会回退到带当前 epoch 的全量 replay)。相邻突变(base 行为,不返回 eventEpoch)会被同一测试杀死,证明 harness 有效。
  • 未覆盖:base 侧真实 daemon 集成未跑(共享 node_modules 会引入 HEAD dist 混淆,改用组合证明);daemon 重启竞态的活体探针未驱动;repo 级 lint 未跑;Windows/Linux 未测(作者已声明)。

Central claim and A/B

The PR exists to close five deterministic race gaps left by #8939. The central one: the default bounded-history same-session refresh could never pass the provider's epoch integrity check, because the bridge's bounded (persisted-page) load response omitted eventEpoch — so the provider's pre-existing candidate.eventEpoch === undefined || candidate.eventEpoch !== intent.capture?.eventEpoch check (provider.tsx:3975, unchanged by this PR, pinned by the pre-existing it.each "rejects a same-session load with epoch mismatch" test) failed every bounded refresh. Secondary claims: terminal failure paths leak prepared candidates/captures; a turn terminal followed by shell completion strands a queued refresh forever; controlled targets requested during source-bound operations are dropped with a failed transition; committed client-ID rebinds are overwritten by the initial prop before a later resync.

Method: the HEAD test files were run against a git worktree of the base tip (tmp/base-tree, symlinked only the webui tooling node_modules — vite plugins; internal @qwen-code/* links asserted via readlink -f to resolve into the head tree, and this PR touches neither packages/core nor packages/sdk-typescript, so cross-package resolution is uncontaminated; lockfile untouched). Each base red cell is an assertion that the base arm fails; each is counted as a pass in the totals.

Gap Test (HEAD file) base head witness
#1 epoch on bounded load bridge 'refreshes an attached load from a bounded persisted page' FAIL — response object lacks eventEpoch PASS 01-ab-bridge-base-cell-fails.png, 02-ab-bridge-head-cell-passes.png
#1 end-to-end commit integration 'merges the live source tail before committing a held load response' (historyPageSize: 100) not run (see Not covered; base side proven by composition) PASS (4.9 s) 04-head-gates-green.png
#2 candidate/capture leak on deadline 'retires a prepared candidate when an event-driven deadline wins' FAILdetachFetch called 0× (candidate leaked) PASS — detach 1×, capture serialization 0× after failure 03-ab-provider-base-cells-fail.png
#3 refresh queued forever 'starts a queued refresh after both an observed turn and shell finish' FAIL — 5 s timeout, load never called PASS — load called exactly once after both settle 03
#4 controlled target dropped 'opens the latest controlled target after session creation settles' FAIL — published {phase:'failed', error:'Another session operation is already in progress'} PASS — no failure transition; session-b opens 03
#5 rebind overwritten 'keeps the committed clientId for a later recovery request' FAIL — recovery resume never fired PASS — resume called with 'client-b' 03
controls 261 other provider tests / 567 other bridge tests PASS PASS (265/265, 568/568) 04

Five of five gap cells flip broken→fixed; zero collateral failures on either side. Mechanism notes verified in source: #3's base deadlock is a stale runnerActiveTurn = true (set at the turn terminal while the shell key was still in activePromptsRef, never reset by any later event) blocking the pump gate snapshot.activeTurn even though the shell-completion setPromptStatus('idle') wrapper does pump; head resets it unconditionally and always pumps, while the pump itself still gates on hasCurrentSessionActivePromptRef.current() so a refresh cannot start during active shell work. #2's base leak was specifically the "timed out before restore started" path, which called exposeCrossSessionFailure without retiring the candidate; head centralizes cleanup in cleanupTransitionArtifacts. #4's counter (sourceBoundOperationCountRef) is balanced on both raw settle arms at actions.ts:909-925 and 1605-1613, and tracks the raw request past the action timeout by design.

Reviewer Test Plan walkthrough

  1. Bounded same-session load includes the live event epoch and commits successfully — performed: bridge focused A/B (red/green) + head integration with historyPageSize: 100. ✔
  2. Prepared candidate detached and capture stopped after event-driven deadline — performed: deadline test asserts detach fetch 1× and that a source event serialized after the failure is never serialized. ✔
  3. Refresh starts only after both observed turn and overlapping shell finish — performed: the head test asserts load not called after the turn terminal alone, then exactly once after shell settle. ✔
  4. Controlled target requested during creation opens after creation settles — performed. ✔
  5. Committed client-ID rebind used by later ring-resync — performed: recovery resume carries 'client-b', not the initial 'client-a' prop. ✔
  6. Real-daemon held-response replay-plus-live-tail without loss or duplication — performed at head: integration 3/3 (14.7 s). ✔

All six steps are executable and pass at head; no step is structurally unreachable.

Vacuity and mutation matrix

Running the HEAD test files against base source is the revert-based vacuity check: all four new/changed provider tests go red on the unfixed source at their intended behavioral assertion (three clean expected-vs-actual diffs; the liveness one as a 5 s hang, the honest shape of "queued forever"), and the bridge test red on the missing eventEpoch field. Positive control: the 261 unrelated provider tests pass on base, so the harness is capable of green and the reds are specific.

mutation suite result
M0 = base bridge (bounded response without epoch) bridge.test.ts KILLED (1 failed)
M1 = delete entry.events.epoch === eventEpoch freshness clause, keep returning epoch bridge.test.ts 568 SURVIVED 568/568
M2 = base provider (all four fixes absent) provider.test.tsx KILLED (4 failed)

M1 is a coverage gap, not dead code: the clause guards a daemon restart (bus rebuild, new epoch) landing inside a bounded page read; without it the bridge would return a page snapshotted against a dead epoch and the provider would commit a replay anchored to it. The fallback (retry once, then replayFieldsFor full in-memory replay, which always carries the current epoch) is straightforward in source. See Findings.

Findings

F1 — Suggestion (non-blocking): the bridge epoch freshness clause is unpinned. Deleting entry.events.epoch === eventEpoch at packages/acp-bridge/src/bridge.ts:5440 leaves all 568 bridge tests green (logs/mutant-M1-no-epoch-clause.log, 05-mutation-matrix.png). Believable because the adjacent mutant (M0/base behavior) is killed by exactly one test. Classification: coverage gap — the behavior is right, nothing asserts it; the only door into the clause is a daemon restart mid-read, which the existing fixtures cannot drive (the bus epoch is a readonly randomUUID() per bus instance, eventBus.ts:371).

Suggested fixture (sketch, unmeasured — ship together with the test)

In a sibling of 'refreshes an attached load from a bounded persisted page', have the fake channel's sessionTranscript extMethod handler await a deferred before responding, and between the bridge's epoch snapshot and that response replace the entry's bus (the fixture seam that rebuilds entry.events, e.g. the same path a channel reconnect uses) so entry.events.epoch differs; assert the refreshed response is the full-replay fallback (liveJournal/compactedReplay from snapshotReplay(), eventEpoch = the new epoch) rather than the bounded page. Not applied in this round; a fix for a coverage gap should ship with its fixture.

Not covered

  • Base-side real-daemon integration run. The base worktree cannot run it cleanly: the spawned CLI resolves @qwen-code/acp-bridge/webui dists through the shared root node_modules (head builds), so a "base" integration cell would mix base and head code. The base side of gap pre-release: fix ci #1 is instead proven by composition: M0 proves the base bridge omits eventEpoch from the bounded response, and the provider's consuming rejection is pre-existing code (provider-base.tsx:3983) pinned by the pre-existing epoch-mismatch it.each case, which passes on base.
  • Live probe of the daemon-restart-during-bounded-read race (M1's live behavior): would need a reconnect/bus-rebuild fixture; classified from source reading + the mutant run instead.
  • The base liveness cell fails as a 5 s hang, not a targeted assertion — that is the honest shape of "queued forever", but it makes the base-arm diagnostic weaker than the other three expected-vs-actual diffs.
  • Repo-wide lint/format gates not run; targeted gates were per-package tsc --noEmit (both exit 0) and the unit/integration suites above.
  • Windows/Linux behavior (author-disclosed as untested); cursor-less/epoch-less source attachments remain fail-closed (deferred by the author to a separate follow-up); webui React 18/19 matrix not exercised (package default test env only).

Methodology

Environment: CI verify container (node:22-bookworm), merge-ref checkout (HEAD c17efc6749 = merge of head 9e3d7d0dfb into base 1570e6c73f), npm ci + npm run build pre-completed at HEAD. A/B control: git worktree add tmp/base-tree HEAD^1; HEAD test files copied into it; webui tooling deps provided by symlinking packages/webui/node_modules (vite plugins only, no @qwen-code entries); internal-link realpath asserted and both linked packages (core, sdk-typescript) confirmed untouched by the PR. Integration ran the built HEAD dists (packages/cli/dist/index.js daemon + @qwen-code/webui/daemon-react-sdk) against a real spawned daemon with a mock ACP child, QWEN_SANDBOX=false. Mutation M1 applied to a scratch edit of bridge.ts, suite run, source restored via git checkout (tree clean afterwards). Raw logs in logs/, cell adjudication rerunnable via node ab-harness.mjs (10/10 predicted outcomes), evidence PNGs rendered with scripts/verify-capture.mjs. Assertion tally: head provider 265 + head bridge 568 + head integration 3 + base provider 265 (261 controls + 4 predicted reds) + base bridge focused 1 (predicted red) + M1 run 568 (predicted green) = 1670 executed, 0 unexpected.

Evidence images

01-ab-bridge-base-cell-fails

02-ab-bridge-head-cell-passes

03-ab-provider-base-cells-fail

04-head-gates-green

05-mutation-matrix

Harness scripts and raw logs are in the workflow run artifacts (7-day retention).

Qwen Code · sandboxed verification

@qwen-code-ci-bot qwen-code-ci-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, looks ready to ship. ✅

@doudouOUC
doudouOUC added this pull request to the merge queue Aug 12, 2026
Merged via the queue into main with commit 9ff1519 Aug 12, 2026
63 of 65 checks passed
@doudouOUC
doudouOUC deleted the fix/same-session-refresh-race-gaps branch August 12, 2026 09:32
@qwen-code-ci-bot

Copy link
Copy Markdown
Collaborator

Released in v0.21.11.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants