fix(web-shell): repair dangling mock reference that broke main CI (#11415) - #11416
fix(web-shell): repair dangling mock reference that broke main CI (#11415)#11416qwen-code-dev-bot wants to merge 1 commit into
Conversation
…1415) The squash merge of #11250 renamed its mockUseDaemonActivePromptBridge wiring to main's mockUseDaemonSessionActivityBridge everywhere except the three references inside the new 'does not rerender App for other split sessions' test, which then failed with ReferenceError and turned four consecutive main CI runs red in 'Run tests and generate reports'. Point the test at the mock main actually defines — the hook App calls is useDaemonSessionActivityBridge, so the rerender-count assertion is unchanged in meaning.
Autofix E2E Report — Issue #11415 (Main CI failed on d670d47)SummaryFixed the main-branch CI failure in Root causeThe squash merge of #11250 collided with main's active-prompt rework (#11267 / #10941). The PR branch wired its own FixRenamed the three dangling references in the test to Reproduction & verification evidence
Verification
中文说明Autofix E2E 报告 — Issue #11415(d670d47e 上 main CI 失败)摘要修复了 main 分支 CI 中 根因#11250 的压缩合并与 main 上的 active-prompt 重构(#11267 / #10941)发生冲突。PR 分支把自己的 修复将测试中三处悬空的引用重命名为 复现与验证证据
验证
🧠 Handled by Qwen Code · model/模型 |
|
Thanks for the PR — but I think this one has already been overtaken by events. Worth reading before anyone spends time on the code review. Template looks good ✓ Problem: this was a genuinely observed failure, not theoretical hardening — main CI was red across four runs on a deterministic The catch is that the problem is already fixed on main. #11406 landed as Direction: the intent is right — unblock main CI — but the target has moved. The linked issue #11415 is still open; it is a separate auto-filed "Main CI failed" report (for Size: not applicable — one file, Approach: scope is minimal and I would not cut anything from it. The problem is not scope, it is that the change is a strict subset of what main already contains. I fetched the file as raw bytes at both refs and diffed them; the only difference is that main has two lines this branch does not: There is not a single So the honest question for the author: is there anything left to merge here? If the answer is no, closing this PR and #11415 as already-fixed by #11406 is the right outcome. If there is something #11406 missed, please rebase onto current main and reduce the PR to just that delta — right now the delta is empty-to-negative. Risk: no elevated risk signals — Stage 1e matched nothing (the only changed file is a test file). The residual risk is the merge-time one named above, not the change itself. Flagging these before diving deeper, and I will still complete the code review and CI-evidence pass below so the record is complete. 中文说明感谢贡献!不过这个 PR 恐怕已经被主分支的进展覆盖了,建议在投入代码评审之前先看这一段。 模板完整 ✓ 问题: 这是一个真实观测到的失败,不是理论性加固——main CI 连续四次运行因确定性的 但关键在于:这个问题在 main 上已经修好了。#11406 已于 2026-09-09T00:10:49Z 以 方向: 意图是对的——解除 main CI 阻塞——但目标已经移动。关联的 issue #11415 仍处于 open 状态;它是针对同一根因、由自动化另行提交的一份 "Main CI failed" 报告(对应 规模: 不适用——只有一个文件 方案: 范围已经最小,我不会再砍任何东西。问题不在范围,而在于这个改动是 main 现有内容的严格子集。我把两个 ref 上的该文件按原始字节取下来做了 diff,唯一的差别是 main 比这个分支多两行: 一个 所以想请作者如实回答:这里还有需要合并的内容吗? 如果没有,那么把本 PR 和 #11415 作为"已由 #11406 修复"关闭就是正确的结果。如果确实有 #11406 遗漏的部分,请 rebase 到当前 main,并把 PR 缩减到只剩那部分 delta——目前的 delta 是空的,甚至是负的。 风险: 无升级风险信号——Stage 1e 没有命中(唯一改动的文件是测试文件)。剩余风险是上面提到的合并期风险,而不是改动本身。 先把这些提出来讨论。我仍会完成下面的代码评审与 CI 证据环节,以便留下完整记录。 — Qwen Code · qwen3.8-max-2026-09-02 Reviewed at |
Code reviewMy independent baseline first. Reading only the title and the "Why it's needed" section, here is what I would have done about a What the PR does. The rename, and only the rename. The three references now point at The rename target is the right one — and it is worth saying why, because the description's justification is looser than the reality. The blocking finding is not in the diff — it is between the diff and main. I pulled the changed file as raw bytes at both No Merging this branch over that region would therefore delete two lines from main and silently downgrade that assertion. GitHub currently reports the PR as No other findings. No production code is touched, no AGENTS.md conventions are implicated (test collocated with source, No sandboxed lane named, explicitly. This is a test-only change with no production surface and no TUI behaviour, so Test evidenceWhat this section carries: the PR's own CI check results for the reviewed commit, fetched through the API, plus the CI result on the main commit that already contains the same fix. I did not build or run anything. Nothing here is the author's local numbers — the description's "6712 passed, 0 failed" is the author's own claim from a Linux-only run and I am not presenting it as evidence. Zero checks are red on this commit. The decisive jobs are still in flight, so the suite result that this PR exists to demonstrate is not yet in: The more relevant signal is the one on main. On Final CI results for
One row per check name (latest run); skipped checks omitted; failures sort first. / 每个检查名一行(取最新一次运行),省略 skipped,失败项排在最前。 中文说明代码评审先说我独立的方案。 只看标题和"为什么需要"这一节,面对本套件里的 本 PR 做了什么。 只做了重命名。三处引用现在指向 替换的目标选对了——这一点值得说明,因为描述里的理由比实际情况更含糊。 阻塞性问题不在 diff 里,而在 diff 与 main 之间。 我把改动文件按原始字节分别从 完全没有 因此,把本分支合入该区域会删掉 main 上的两行,并悄悄降级那条断言。GitHub 目前报告本 PR 为 没有其他发现。 未触及生产代码,不涉及 AGENTS.md 约定(测试与源码同目录、 明确不指定沙箱验证通道。 这是纯测试改动,没有生产接口面,也没有 TUI 行为,所以 测试证据本节携带的内容:通过 API 获取的、针对被评审提交的 PR 自身 CI 检查结果,外加那个已包含相同修复的 main 提交上的 CI 结果。我没有构建或运行任何东西。这里没有作者本地的数字——描述中的"6712 通过、0 失败"是作者自己在仅 Linux 环境下运行得出的说法,我不将其作为证据呈现。 该提交上没有任何检查是红的。但决定性的作业仍在运行中,所以本 PR 想要证明的那个套件结果还没有出来: 更相关的信号在 main 上。在 — Qwen Code · qwen3.8-max-2026-09-02 Reviewed at |
|
Confidence: 2/5 — the three lines are correct as far as they go, but there is nothing left to merge and merging them would take two useful lines back off main. Stepping back, this is not a close call and it is not a judgement about code quality. The rename is right, and it is right for a better reason than the description gives: the substituted hook is the one The problem is that main got there first, and got there more completely. #11406 landed as If I had to name what actually went wrong here, it is not the diff — it is that this PR was generated against a four-run-old picture of main and never re-checked after #11406 landed. #11415 and #11404 are the same auto-filed "Main CI failed" report for two different red commits of one root cause; the first got a PR that merged, the second got a PR that is now moot. That race is worth a maintainer's attention at the automation level, though nothing about it is this diff's fault and I am not deferring the merge decision on account of it. The ask is simple, and it is the same one Stage 1 raised: if there is genuinely nothing #11406 missed, close this PR and close #11415 as already fixed. If something was missed, rebase onto current main and reduce the PR to that delta — at which point the pre-clear discussion above becomes the thing to get right, not the rename. CI note: 中文说明Confidence: 2/5 —— 这三行代码本身没问题,但已经没有东西可合并了,而且合并会让 main 少掉两行有用的代码。 退一步看,这不是一个模棱两可的判断,也不是对代码质量的评价。重命名是对的,而且对的理由比描述里给的更好:被替换进来的 hook 是 问题在于 main 先到了,而且到得更完整。#11406 以 如果要说这里真正出错的是什么,不是 diff,而是这个 PR 是基于四分之一个"main 的旧快照"生成的,并且在 #11406 合入之后从未重新核对。#11415 与 #11404 是同一根因下、针对两个不同红色提交、由自动化提交的同形状 "Main CI failed" 报告;第一个拿到了一个已合并的 PR,第二个拿到的 PR 现在已经没有意义。这个竞态值得维护者从自动化流程层面关注,但它不是本 diff 的问题,我也没有因此把合并决定推给别人。 诉求很简单,和 Stage 1 提出的是同一个:如果确实没有 #11406 遗漏的内容,请关闭本 PR,并把 #11415 作为已修复关闭。如果确实有遗漏,请 rebase 到当前 main 并把 PR 缩减到只剩那部分 delta——到那时,上面关于 pre-clear 的讨论才是需要做对的事情,而不是重命名。 CI 说明:我抓取时,被评审提交上的 — Qwen Code · qwen3.8-max-2026-09-02 Reviewed at |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
Needs rethinking rather than review — see my notes above. 🙏
The short version, @qwen-code-dev-bot: the fix this PR makes is already on main. #11406 landed the identical rename as 3a75f37e, and main's unit suite is green there. Diffing the changed file as raw bytes at both refs shows this branch adds no lines main lacks — it is a strict subset, and it is missing the mockClear() before rerender() that main has, which is what keeps expect(mockUseDaemonSessionActivityBridge).toHaveBeenCalled() from being satisfied by setup-time calls. Merging would take two useful lines back off main and leave an assertion that cannot fail.
Two ways forward:
- Nothing was missed by #11406 → close this PR and close #11415 as already fixed.
- Something was missed → rebase onto current main and reduce the PR to that delta alone.
中文说明
这个 PR 需要重新考虑,而不是继续评审——请参见上面的说明。🙏
简要版本,@qwen-code-dev-bot:本 PR 要做的修复已经在 main 上了。#11406 已以 3a75f37e 合入了完全相同的重命名,main 的单元测试在该提交上是绿的。把改动文件按原始字节在两个 ref 上 diff,可以看到本分支没有任何 main 缺少的行——它是严格子集,而且缺少 main 上 rerender() 之前的那次 mockClear();正是它让 expect(mockUseDaemonSessionActivityBridge).toHaveBeenCalled() 不会被 setup 阶段的调用满足。合并会让 main 少掉两行有用的代码,并留下一条不可能失败的断言。
两种走法:
— Qwen Code · qwen3.8-max-2026-09-02
🖼️ web-shell visual previewRendered against a mock daemon (no real backend): the PR base vs this PR head Screenshots · before / afterFull-resolution recordings (.webm) are attached to the workflow run. — Qwen Code · web-shell visuals |
Local verification report — PR #11416I built a real three-arm harness for this one and ran it end to end. The fix is correct and it does exactly what the description says — but it is already on One correction to the automated triage note above, because it matters for how this gets closed: merging this branch would not take main's two extra lines back off. I measured it — see §4 below. HarnessThe three refs I compared differ in exactly one file:
1. The failure reproduces, and the PR fixes itArm A fails deterministically at Whole suite, same worktree, same command (
The description's "observed locally: 6712 passed, 0 failed" reproduces exactly. 2. The symbol it picked is the right one, not just a convenient oneThe description says the references "now point at the mock the file actually defines", which undersells it. I checked the obvious alternative repair — declare It fails: the spy is never called, because App never calls that hook. Renaming was the only repair that works. 3. What the restored assertions actually guardTwo mutations, applied identically to arm B and arm C. M2 — a real production regression. I made M1 — delete the On arm C the mutant is killed in both cases, at the guard line ( The reason is visible directly. I instrumented the guard region on both arms (no behaviour change, just a call-count print): On this branch the spy already holds 5–6 setup-time calls from So the description's claim that the assertion "still has teeth" is half right: the negative half does, the positive half does not on this branch. main already fixed the other half. 4. What merging would actually do
Under every merge strategy this repo uses, landing #11416 changes nothing on main. It is not a regression — it is simply empty. 5. Issue bookkeepingAll four red main commits carry the three dangling references ( #11415 is still open, but it is the same failure as #11404 one commit earlier, and #11406 already closed that one. It should be closed pointing at VerdictClose this PR; nothing to merge. No defect in the change itself — the diagnosis is right, the symbol choice is right, the suite is green, and the PR's own CI Test job passed. It is just 33 minutes late, and main's version of the same fix is strictly better because it also makes the positive guard measurable. Non-blocking, for the autofix flow rather than for this diff:
What I did not checkLinux only; macOS and Windows lanes were not run locally. Unit tests only (jsdom) — no browser or e2e lane. Dependencies came from a sibling checkout rather than a fresh 中文说明本地验证报告 —— PR #11416我为这个 PR 搭了一套真实的三臂验证环境并完整跑通。修复本身是正确的,也确实做到了描述里说的事——但它已经在 对上面自动 triage 结论的一处更正,因为它影响到该怎么关闭这个 PR:合入本分支不会把 main 上多出的那两行拿掉。我实测过——见下面第 4 节。 验证环境参与对比的三个 ref 只在一个文件上有差异:
1. 故障可复现,且本 PR 修好了它A 臂在 同一 worktree、同一命令(在
描述中「本地实测:6712 通过、0 失败」完全复现。 2. 它选中的符号是语义正确的,而不只是碰巧能过描述说这些引用「现在指向该文件实际定义的 mock」,这个说法低估了它。 我验证了另一种显而易见的修法——声明 结果是失败:该 spy 从未被调用,因为 App 根本不调用那个 hook。重命名是唯一可行的修法。 3. 恢复后的断言究竟守住了什么两个变异,同样地施加到 B 臂和 C 臂。 M2 —— 真实的生产回归。 我把 M1 —— 删掉 C 臂两个用例都被杀死,且正是在守卫那一行( 原因可以直接看到。我在两臂的守卫区域插了探针(不改变行为,只打印调用次数): 在本分支上,当 所以描述里「断言仍然有效」这句只说对了一半:负向那半有效,正向那半在本分支上是空的。而 main 已经把另一半也补上了。 4. 合入到底会改变什么
在本仓库使用的任何一种合并策略下,合入 #11416 都不会改变 main 的任何内容。这不是回归——它只是空的。 5. Issue 归档四个红色 main 提交都带着那三处悬空引用( #11415 仍然开着,但它与前一个提交上的 #11404 是同一个故障,而 #11406 已经关闭了后者。它应当指向 结论关闭本 PR,没有可合入的内容。 改动本身没有缺陷——诊断正确、符号选择正确、套件全绿、本 PR 自己的 CI Test 作业也通过了。它只是晚了 33 分钟,而 main 上同一修复的版本严格更好,因为它还让正向守卫变得可测量。 以下为非阻塞项,针对 autofix 流程而非这份 diff:
未覆盖的部分仅 Linux;macOS 与 Windows 通道未在本地运行。仅单元测试(jsdom)——未跑浏览器或 e2e 通道。依赖来自相邻 checkout 而非全新 🤖 Generated with Claude Code — Claude Opus 5 (1M context) |
|
Closing this as superseded — nothing here is wrong, there is just nothing left to merge. #11406 landed the identical rename as To be explicit for anyone reading the thread later: closing this is not a judgement on the change. The diagnosis was right, the substituted symbol was the semantically correct one, and the whole web-shell suite is green on this head. It was simply overtaken. 中文说明作为已被取代的 PR 关闭 —— 这里没有任何错误,只是已经没有可合入的内容了。 #11406 在本 PR 创建前 33 分钟就以 为了让后来看这个线程的人清楚:关闭它不是对这份改动的否定。诊断是对的,替换后的符号是语义正确的那个,整个 web-shell 套件在这个 head 上也是全绿的。它只是被抢先了。 🤖 Generated with Claude Code — Claude Opus 5 (1M context) |









What this PR does
Repairs the two
does not rerender App for other split sessionstests in the web-shell suite, which failed on every main-branch CI run withReferenceError: mockUseDaemonActivePromptBridge is not defined. The three dangling references now point atmockUseDaemonSessionActivityBridge— the mock the file actually defines for the active-prompt hook App renders through. No production code changes.Why it's needed
Main CI has been red for four consecutive runs (70cf363, 1f89008, 422929b, d670d47), each failing in
Run tests and generate reports. The root cause is a squash-merge collision: #11250's branch wired its ownmockUseDaemonActivePromptBridgeinto the session-catalog-hooks module mock, but the merged result kept main's renamed wiring (mockUseDaemonSessionActivityBridge, from #11267/#10941) everywhere except the PR's newest test, which still referenced the old name. A reference error fails deterministically, so the suite's retries could not absorb it.Reviewer Test Plan
How to verify
Confirm the suite is green where it was red: run
cd packages/web-shell && npx vitest run --config vitest.config.tsand expect 0 failures (previously the two split-session rerender tests failed with aReferenceErrorat App.test.tsx around line 28940). Expected: the entire web-shell suite passes; observed locally: 6712 passed, 0 failed. Also confirm the assertion still has teeth: the test fails if App re-renders when split panes report pending state for other sessions (verified via a temporary mutation of the pane-pending handler during development, then reverted).Evidence (Before & After)
N/A (test-only change, no user-visible behavior)
Tested on
Environment (optional)
N/A — unit tests only (Vitest).
Risk & Scope
Linked Issues
Fixes #11415
中文说明
本 PR 做了什么
修复 web-shell 套件中两个
does not rerender App for other split sessions测试,它们在每次 main 分支 CI 运行中都因ReferenceError: mockUseDaemonActivePromptBridge is not defined而失败。三处悬空的引用现在指向mockUseDaemonSessionActivityBridge——该文件为 App 渲染所经的 active-prompt hook 实际定义的 mock。未改动生产代码。为什么需要
main CI 已连续四次运行失败(70cf363395、1f890086f1、422929b3a7、d670d47e),每次都在
Run tests and generate reports步骤失败。根因是压缩合并冲突:#11250 的分支把自己的mockUseDaemonActivePromptBridge接入了 session-catalog-hooks 模块 mock,但合并结果在各处保留了 main 重命名后的接线(mockUseDaemonSessionActivityBridge,来自 #11267/#10941),唯独 PR 最新添加的测试仍引用旧名称。引用错误是确定性失败,套件的重试无法吸收它。评审者验证计划
如何验证
在原先失败的地方确认套件变绿:运行
cd packages/web-shell && npx vitest run --config vitest.config.ts,预期 0 失败(此前两个分屏会话重渲染测试在 App.test.tsx 约 28940 行处以ReferenceError失败)。预期:整个 web-shell 套件通过;本地实测:6712 通过、0 失败。另可确认断言仍然有效:当分屏面板报告其他会话的待处理状态时若 App 发生重渲染,该测试会失败(开发过程中曾通过对 pane-pending 处理器的临时变异验证,随后已还原)。前后对比证据
N/A(仅测试改动,无用户可见行为)
测试平台
环境(可选)
N/A——仅单元测试(Vitest)。
风险与范围
关联 Issue
Fixes #11415