Skip to content

test(serve): widen hosted recovery waitFor windows for CI contention (#14101) - #14107

Merged
yiliang114 merged 3 commits into
mainfrom
autofix/issue-14101
Oct 14, 2026
Merged

yiliang114 merged 3 commits into
mainfrom
autofix/issue-14101

Conversation

@qwen-code-dev-bot

Copy link
Copy Markdown
Collaborator

What this PR does

Widens the state-polling windows in two Hosted Harness no-tool session tests from vitest's implicit 1000 ms vi.waitFor default to an explicit 10 s, with a comment on each naming the issue and the mechanism. No assertions were added, removed, or weakened, and no production code changed.

Why it's needed

Main-branch CI failed on these two tests in run 38410683888 (Test (ubuntu-latest, Node 22.x)). Both tests wait for recovery state that settles across fsync-backed journal commits — parking an admitted prompt after a model-request-preparation failure, and settling an interrupted channel turn while retaining cleanup debt — with a supertest HTTP round-trip per poll. Vitest's default waitFor window is only 1 s, which a loaded shared runner running the main-branch coverage-instrumented job can exhaust before the state lands, producing a Timed out in waitFor! flake rather than a real defect. This is the same contention class fixed the same day in #14084/#14091, which widened a sibling hosted wait from 5 s to 10 s for the same reason; this change brings the two remaining bare waits in line with that precedent and with the other waits in the same file that already use explicit 10 s windows.

Reviewer Test Plan

How to verify

Confirm the diff touches only the two failing tests' vi.waitFor calls and only adds { timeout: 10_000 } plus a comment — every assertion is unchanged. Then run the tests: cd packages/cli && npx vitest run src/serve/hosted-harness-session.test.ts -t "Hosted Harness no-tool session" should pass all 284 tests, and the two named tests (parks an admitted prompt when model request preparation fails, retains cleanup debt after interrupted channel settlement until original-owner release succeeds) pass individually. Expected: green before and after locally — the flake is contention-dependent and did not reproduce on an unloaded machine, even with CI=true QWEN_CI_COVERAGE=1; the fix removes the narrow window instead of changing observable behavior. The CI rerun on this PR is the meaningful gate.

Evidence (Before & After)

N/A — test-only timing change, no user-visible behavior.

Tested on

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

Environment (optional)

N/A — unit tests only (npm run build, npm run typecheck, npm run lint, and focused Vitest runs all pass).

Risk & Scope

  • Main risk or tradeoff: a genuinely stuck recovery path now takes up to 10 s instead of 1 s to fail these two tests; that matches the explicit windows already used throughout the rest of the file.
  • Not validated / out of scope: the other bare vi.waitFor calls in the file were left as-is; only the two tests observed failing in CI were widened, keeping the change minimal. CI, Docker, and platform-specific behavior beyond the Linux unit-test job is out of scope.
  • Breaking changes / migration notes: none.

Linked Issues

Fixes #14101

中文说明

本 PR 做了什么

将两个 Hosted Harness no-tool session 测试中的状态轮询窗口,从 vitest 默认的隐式 1000 毫秒 vi.waitFor 超时放宽为显式的 10 秒,并在每处添加注释注明对应 issue 和机制。未新增、删除或削弱任何断言,也未改动任何生产代码。

为什么需要

主分支 CI 在 run 38410683888(Test (ubuntu-latest, Node 22.x))中这两个测试失败。两个测试等待的恢复状态需要跨越基于 fsync 的 journal 提交才能就绪——模型请求准备失败后挂起已准入的 prompt,以及在保留清理债务的同时结算被中断的 channel turn——且每次轮询都包含一次 supertest HTTP 往返。vitest 的 waitFor 默认窗口只有 1 秒,在负载较高、且运行主分支覆盖率插桩任务的共享 runner 上,状态可能还未就绪窗口就已耗尽,从而产生 Timed out in waitFor! 的偶发失败,而非真实缺陷。这与当天 #14084/#14091 修复的问题同属一类,该修复出于同样原因把同类 hosted 等待从 5 秒放宽到 10 秒;本改动让文件中仅剩的两处裸等待与该先例以及同文件中其他已使用显式 10 秒窗口的等待保持一致。

评审者测试计划

如何验证

确认 diff 只触及两个失败测试的 vi.waitFor 调用,且仅添加了 { timeout: 10_000 } 和注释——所有断言均未改动。然后运行测试:cd packages/cli && npx vitest run src/serve/hosted-harness-session.test.ts -t "Hosted Harness no-tool session" 应通过全部 284 个测试,且两个具名测试(parks an admitted prompt when model request preparation fails、retains cleanup debt after interrupted channel settlement until original-owner release succeeds)单独运行也通过。预期:本地在修复前后均为绿色——该偶发故障依赖负载争抢,即使在 CI=true QWEN_CI_COVERAGE=1 下也无法在空载机器上复现;本修复收窄的是超时窗口本身,不改变可观察行为。本 PR 的 CI 重跑才是有意义的门禁。

前后对比证据

N/A —— 仅测试超时时长改动,无用户可见行为。

测试平台

系统 状态
🍏 macOS ⚠️
🪟 Windows ⚠️
🐧 Linux ✅

环境(可选)

N/A —— 仅单元测试(npm run build、npm run typecheck、npm run lint 及相关 Vitest 运行均已通过)。

风险与范围

  • 主要风险或取舍:若恢复路径真的卡死,这两个测试现在需要最多 10 秒(而非 1 秒)才会失败;这与文件中其余地方已使用的显式窗口一致。
  • 未验证 / 超出范围:文件中其余裸 vi.waitFor 调用保持不变;只放宽了 CI 中实际观测到失败的两个测试,以保持改动最小。Linux 单元测试任务之外的 CI、Docker 和平台特定行为超出范围。
  • 破坏性变更 / 迁移说明:无。

关联 Issue

Fixes #14101

…14101)

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
@qwen-code-dev-bot

Copy link
Copy Markdown
Collaborator Author

Autofix E2E Report — Issue #14101

Summary

Main-branch CI (Qwen Code CI, run 38410683888, commit 53579861daba) failed in Test (ubuntu-latest, Node 22.x) on two tests in packages/cli/src/serve/hosted-harness-session.test.ts:

  • Hosted Harness no-tool session > parks an admitted prompt when model request preparation fails
  • Hosted Harness no-tool session > retains cleanup debt after interrupted channel settlement until original-owner release succeeds

Root cause

Both tests poll session state with a bare vi.waitFor(...). Vitest 3.x defaults that wait to a 1000 ms timeout at a 50 ms interval. The chains being awaited are not single microtasks: each crosses fsync-backed journal commits (parking the admitted prompt after LlmRequestPreparationError, or settling the interrupted channel turn and recording hosted cleanup debt), plus a supertest HTTP round-trip per poll. On a loaded shared ubuntu-latest runner — where the main-branch job also enables V8 coverage instrumentation — the 1 s window can be exhausted before the state settles, so the tests fail with a Timed out in waitFor! flake rather than a real behavioral defect.

This is the same contention class the house fixed the same day in #14084/#14091 ("the observed chain is a serial run of fsync-backed publishes and journal commits; 5s flaked on a loaded ubuntu-latest runner"), which widened a sibling hosted wait from 5 s to 10 s.

Fix

Give both waits an explicit { timeout: 10_000 }, matching the sibling tests in the same file and the #14084 precedent, with a comment naming the issue and the mechanism. No assertions were added, removed, or weakened; no production code changed.

Reproduction notes

The flake did not reproduce locally: both tests pass in isolation (~0.1–0.2 s each), pass in the full 284-test describe block, and pass again with CI=true QWEN_CI_COVERAGE=1 (the main-branch coverage configuration). That is consistent with a contention-dependent timeout rather than a code defect. The exact failing environment (a loaded shared GitHub-hosted runner) is unavailable in this sandbox; per the autofix surrogate-verification rule, the fix targets the evidenced timing window and the workflow's independent CI remains the final gate.

Verification

  • npx vitest run src/serve/hosted-harness-session.test.ts -t "parks an admitted prompt when model request preparation fails" (packages/cli) — passed (205 ms)
  • npx vitest run src/serve/hosted-harness-session.test.ts -t "retains cleanup debt after interrupted channel settlement until original-owner release succeeds" (packages/cli) — passed (331 ms)
  • npx vitest run src/serve/hosted-harness-session.test.ts -t "Hosted Harness no-tool session" (packages/cli) — 284 passed, 175 skipped, exit 0
  • CI=true QWEN_CI_COVERAGE=1 npx vitest run src/serve/hosted-harness-session.test.ts -t "Hosted Harness no-tool session" (pre-fix, coverage-enabled baseline) — 284 passed, exit 0
  • npm run build — passed, exit 0 (run with COREPACK_HOME=/tmp/corepack-home: this sandbox cannot create corepack's default cache under the root-owned /home/github-runner/.cache, which fails with EACCES; the workaround only relocates the package-manager cache and does not alter the build)
  • npm run typecheck — passed, exit 0
  • npm run lint — passed, exit 0
  • Integration tests — not run: the change is a test-only timing widening in a unit test file and is not exercised through the bundled CLI or integration harness.
  • Mutation probe — not applicable: the commit adds no guard, branch, or production behavior; the change is entirely inside two test waits, so there is no production guard to negate and re-witness.
  • Settings schema — not applicable: no settings source changed.
中文说明

Autofix E2E 报告 — Issue #14101

摘要

主分支 CI(Qwen Code CI,run 38410683888,提交 53579861daba)在 Test (ubuntu-latest, Node 22.x) 任务中失败,失败测试为 packages/cli/src/serve/hosted-harness-session.test.ts 中的两个用例:

  • Hosted Harness no-tool session > parks an admitted prompt when model request preparation fails
  • Hosted Harness no-tool session > retains cleanup debt after interrupted channel settlement until original-owner release succeeds

根因

两个测试都用不带参数的 vi.waitFor(...) 轮询会话状态。Vitest 3.x 对该等待的默认值是 1000 毫秒 超时、50 毫秒间隔。而它们等待的链路并非单个微任务:每条链路都跨越基于 fsync 的 journal 提交(在 LlmRequestPreparationError 后挂起已准入的 prompt,或结算被中断的 channel turn 并记录 hosted 清理债务),并且每次轮询还包含一次 supertest HTTP 往返。在负载较高的共享 ubuntu-latest runner 上(主分支任务还会启用 V8 覆盖率插桩),1 秒的窗口可能在状态就绪前耗尽,因此测试以 Timed out in waitFor! 的偶发方式失败,而非真实的行为缺陷。

这与当天 #14084/#14091 修复的争抢问题同属一类("the observed chain is a serial run of fsync-backed publishes and journal commits; 5s flaked on a loaded ubuntu-latest runner"),该修复把同类 hosted 等待从 5 秒放宽到 10 秒。

修复

为两处等待显式加上 { timeout: 10_000 },与同文件中的同类测试及 #14084 的先例保持一致,并用注释注明 issue 编号和机制。未新增、删除或削弱任何断言;未改动任何生产代码。

复现说明

该偶发故障在本地未能复现:两个测试单独运行通过(各约 0.1–0.2 秒),在完整的 284 个测试的 describe 块中通过,并在 CI=true QWEN_CI_COVERAGE=1(主分支覆盖率配置)下再次通过。这与"依赖负载争抢的超时"而非代码缺陷的判断一致。确切的失败环境(高负载的 GitHub 托管共享 runner)在本沙箱中不可用;按照 autofix 的替代验证规则,本修复针对已证实的超时窗口,工作流的独立 CI 仍是最终门禁。

验证

  • npx vitest run src/serve/hosted-harness-session.test.ts -t "parks an admitted prompt when model request preparation fails"(packages/cli)— 通过(205 毫秒)
  • npx vitest run src/serve/hosted-harness-session.test.ts -t "retains cleanup debt after interrupted channel settlement until original-owner release succeeds"(packages/cli)— 通过(331 毫秒)
  • npx vitest run src/serve/hosted-harness-session.test.ts -t "Hosted Harness no-tool session"(packages/cli)— 284 通过,175 跳过,退出码 0
  • CI=true QWEN_CI_COVERAGE=1 npx vitest run src/serve/hosted-harness-session.test.ts -t "Hosted Harness no-tool session"(修复前、启用覆盖率的基线)— 284 通过,退出码 0
  • npm run build — 通过,退出码 0(使用 COREPACK_HOME=/tmp/corepack-home 运行:本沙箱无法在 root 所有的 /home/github-runner/.cache 下创建 corepack 默认缓存目录,会报 EACCES;该变通仅迁移包管理器缓存位置,不改变构建内容)
  • npm run typecheck — 通过,退出码 0
  • npm run lint — 通过,退出码 0
  • 集成测试 — 未运行:本次改动仅是单元测试文件中的超时时长放宽,不经过打包后的 CLI 或集成测试链路。
  • 变异探针 — 不适用:本次提交未新增任何守卫、分支或生产行为;改动完全位于两个测试等待之内,没有可否定并重新取证的生产守卫。
  • Settings schema — 不适用:未改动任何 settings 源文件。

🧠 Handled by Qwen Code · model/模型 kimi-k3 · CLI 0.25.1

@github-actions github-actions Bot added the review/self-reported The linked issue was opened by the PR author (self-reported) label Oct 13, 2026
@qwen-code-review-bot

qwen-code-review-bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Qwen Triage finished — view run. See the stage comments in this thread for the result.

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

@qwen-code-review-bot

Copy link
Copy Markdown
Collaborator

Thanks for the PR!

Template looks good ✓ — every required section is filled in, and the Chinese half is a real translation rather than a stub.

Problem: observed, not theoretical. #14101 is open and was auto-filed by the main-CI watcher; the run you cite (38410683888) is real — Qwen Code CI, push to main, head 53579861daba, conclusion failure — and it names exactly the two tests you touch. So there is a genuine failure worth fixing. One factual nit: the description says the failure produced a Timed out in waitFor! flake, and that string appears zero times in that job's log. What the log actually shows is an AssertionError whose stack frame sits inside the vi.waitFor callback (line 6138 is the await vi.waitFor(async () => {, 6139 is the failing expect), which is what a waitFor giving up and rethrowing its last poll error looks like. Same conclusion, but worth quoting the real signature — it matters here, see below.

Direction: in scope. Keeping main green is worth the effort, and a test-only timing change carries no production risk.

Size: not applicable. One file, packages/cli/src/serve/hosted-harness-session.test.ts, +26/−16. That path isn't a core module, and as a *.test.ts file it counts as zero production logic lines under the size rules — no threshold is anywhere near.

Approach: the shape of the change is right, and I verified that instead of taking the description's word for it. The diff adds { timeout: 10_000 } to two waits and re-indents their bodies; every assertion is identical to before. That is precisely allowed-fix #1 in this repo's deflake policy ("raise a timeout / poll budget", "preserve every assertion and every input exactly"), and it explicitly forbids the things you didn't do. It also matches the file: of 253 vi.waitFor calls in it, 173 already carry an explicit timeout and 10_000 is the dominant value — there's a run of them at lines 5973–6059 and again from 6304, with your two bare waits sitting in the gap between. The precedent checks out too: #14091 (merged 2026-10-13, closing #14084) did the same to a sibling hosted wait. Scoping to only the two observed failures rather than sweeping all ~80 remaining bare waits is the minimal call, and I agree with it.

I also confirmed the fix isn't inert: the runner is ecs-qwen-hk3-22, which matches the ecs-qwen- prefix in packages/cli/vitest.config.ts, so testTimeout is 60 s there — a 10 s wait is comfortably reachable, and Test timed out appears zero times in the log.

The concern is the cause, not the change, and it's serious enough that I'm flagging it up front rather than burying it in the review: a maintainer posted a root-cause analysis on #14101 five minutes before this PR was opened concluding this is a product regression from 53579861daba, not CI contention. I dug into that and the answer is genuinely unresolved — full evidence in the next comment.

Risk: no elevated risk signals. The high-risk-path check matched nothing, since the only changed file is a test file.

Moving on to code review. 🔍

中文说明

感谢贡献!

模板完整 ✓ —— 所有必填部分都已填写,中文部分也是真实翻译而非占位。

问题: 是已观测到的,不是理论性的。#14101 处于 open 状态,由 main CI 监视器自动创建;你引用的 run(38410683888)确实存在——Qwen Code CI、push 到 main、head 53579861daba、结论 failure——且失败的正是你改动的这两个测试。所以确实存在值得修复的失败。一个事实性小问题:描述里说失败表现为 Timed out in waitFor!,但该字符串在这个 job 日志中出现 0 次。日志实际显示的是 AssertionError,其栈帧位于 vi.waitFor 回调内部(6138 行是 await vi.waitFor(async () => {,6139 行是失败的 expect),这正是 waitFor 放弃并抛出最后一次轮询错误的形态。结论相同,但建议引用真实的失败特征——在这里很重要,见下文。

方向: 在范围内。保持 main 绿色值得投入,且仅测试的时序改动不带生产风险。

规模: 不适用。单个文件 packages/cli/src/serve/hosted-harness-session.test.ts,+26/−16。该路径不属于核心模块,且作为 *.test.ts 文件,按规模规则计为 0 行生产逻辑——远未触及任何阈值。

方案: 改动的形态是对的,这一点我做了核实而非采信描述。diff 给两处等待加了 { timeout: 10_000 } 并重新缩进回调体;所有断言与改动前完全一致。这恰好是本仓库 deflake 策略允许的第 1 类修复("提高超时/轮询预算"、"完整保留每一个断言和输入"),而该策略明确禁止的做法你都没有做。它也符合本文件惯例:文件中 253 处 vi.waitFor 有 173 处已带显式 timeout,10_000 是主流取值——5973–6059 行和 6304 行起都有成片使用,而你改的这两处裸等待正好落在中间的空档。先例也成立:#14091(2026-10-13 合并,关闭 #14084)对同类 hosted 等待做了同样的事。只处理观测到失败的两处、而不是一次性扫掉剩余约 80 处裸等待,是最小化选择,我认同。

我也确认了这个修复不是无效的:runner 是 ecs-qwen-hk3-22,匹配 packages/cli/vitest.config.ts 中的 ecs-qwen- 前缀,因此该环境下 testTimeout 是 60 秒——10 秒的等待完全可达,且日志中 Test timed out 出现 0 次。

我的顾虑在于成因而非改动本身,且分量足够重,所以我提前指出而不是埋在审查里:一位维护者在本 PR 开启前 5 分钟于 #14101 发布了根因分析,结论是这是 53579861daba 引入的产品回归,而非 CI 资源争抢。我对此做了深入核查,结论是确实悬而未决——完整证据见下一条评论。

风险: 无升级风险信号。高风险路径检查未命中任何项,因为唯一改动的文件是测试文件。

进入代码审查 🔍

— Qwen Code · qwen3.8-max-2026-09-02

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

@qwen-code-review-bot

qwen-code-review-bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Code review

My independent proposal first (written from the title and "Why it's needed" only, before reading the diff): for "two hosted recovery tests fail on main CI against a 1 s default waitFor window", I would (1) establish the failure mode — did the window expire, or did the state never arrive? — by checking whether the same test file passed on adjacent main commits and what the runner was doing at the time; (2) if it's window expiry, add an explicit timeout matching the file's existing dominant value rather than inventing one or reaching for a global config change; (3) keep it local to the observed failures.

Steps (2) and (3) are what this PR does, and it does them well — I verified the assertion-preservation claim directly against the diff, and it holds: the callback bodies are byte-identical modulo Prettier re-indentation, and the only additions are the two { timeout: 10_000 } options and two comments. No assertion was weakened, skipped, retried, or wrapped. The comments name the issue and the mechanism, which is more context than most timeout bumps carry. There's no duplication, no new abstraction, and no production surface touched. Nothing here violates AGENTS.md.

Step (1) is the gap, and it's the whole review.

The diagnosis is unresolved — this is the blocking question

The PR asserts the failure is contention and "not a real defect". A maintainer (@doudouOUC) posted a competing root-cause on #14101 at 19:35:05Z — five minutes before this PR was opened at 19:40:52Z — concluding it is a product regression from 53579861daba (fix(serve): resume committed file results after runtime retirement, #14059). The PR doesn't engage with that analysis.

I verified the load-bearing facts on both sides myself through the API rather than trusting either account:

Supporting the regression reading:

  • hosted-harness-session.test.ts is blob e8fe9cc9cf8f, 955181 bytes — byte-identical at 44ddf79ef4e8, at 53579861daba, and at current main HEAD 6212189f1f83. The test did not change; the code under it did.
  • Run 38418699275 on 44ddf79ef4e8 (main, push): success, ✓ src/serve/hosted-harness-session.test.ts (459 tests) 188409ms. Run 38410683888 on the very next commit: failure, same file, 2 tests × 3 attempts, with 41,860 other tests passing.
  • 53579861daba changed hosted-workspace-tool-turn.ts (+68/−1), hosted-turn-cleanup.ts (+61/−7), hosted-file-history.ts (+4/−1) and hosted-recovery.test.ts (+251/−111) — i.e. exactly the hosted turn-cleanup / recovery / file-history subsystem these two tests exercise.
  • The observed states are the pre-transition states, and they never transition: {hasActivePrompt: true, recoveryBlocked: false} where {false, true} was expected, and release called 0 times where 1 was expected. A missing call is harder to explain by slowness than a late one.
  • hosted-workspace-tool-turn.ts is blob c51af5d55e20 at both 53579861daba and main HEAD — if it is a regression, it is still live on main today.

Supporting the contention reading — and this is what the regression analysis on #14101 did not check:

The two runs are on different hosts, and the failing one was far more loaded at the moment these tests executed. From each job's own DFSAMPLE telemetry:

during test execution green run 44ddf79ef4e8 (ecs-qwen-hk5-15) failing run 53579861daba (ecs-qwen-hk3-22)
1-min load 10.7 – 15.2 14.1 – 21.0
5-min load 8.8 – 10.9 24.5 – 29.9
15-min load 11.3 – 11.7 28.8 – 31.2
concurrent host test jobs 3 – 8 8 – 16

Roughly 2.7× the 5-min load. Under that, a 1 s window spanning fsync-backed journal commits plus a supertest round-trip per poll is genuinely marginal — and test 2 burned ~23 s per attempt of non-wait work, which is enormous for a unit test.

So neither diagnosis is established. Both the code and the environment changed between the green and failing runs, which is a confound — the "passed before / failed after, test file unchanged" argument that #14101 rests on does not control for the runner, and the "it's just contention" argument here does not explain why the state never landed in any of three attempts. I can't resolve this from the diff, and I don't think anyone can without a controlled rerun.

Why this blocks rather than merely interests me: if it is a regression, widening the window doesn't just fail to fix it — it risks converting a loud, deterministic, correctly-located failure into a slow or intermittent one. That is the specific outcome this repo's deflake policy exists to prevent ("those hide the flake instead of fixing it — and could hide a real bug"; and where the failure "looks like a REAL intermittent product bug ... stop. A human deflakes it."). The subsystem at stake is hosted turn cleanup and journal recovery, which is not somewhere I'd want to paper over a behaviour change.

The good news is that this resolves itself cheaply, and the PR's own description is right that "the CI rerun on this PR is the meaningful gate":

I'd add one more cheap discriminator for whoever picks this up: the failure is only reproducible under load, so the useful experiment is to run these two tests against 53579861daba and its parent 44ddf79ef4e8 on the same runner, back to back, under comparable load. That single controlled comparison separates the two confounded variables; nothing in either this PR or #14101 does it.

Testing evidence

Unattended CI run — per the review rules I did not build or execute any PR-derived code, so everything below is this PR's own CI read through the API, plus the historical run logs cited above.

No check has landed red. Test (ubuntu-latest, Node 22.x) — the only check that can substantiate this PR's central claim — was still in progress at review time, as were Lint & Static, Serve A/B, and the Java lanes. I did not poll or wait on them; the table below is a snapshot and the finalize job updates it in place once CI settles.

Final CI results for b51704d (auto-updated by the triage finalize job after CI completed):

Check Conclusion
Hosted process fault gates / MySQL 8.4 / Java 21 ❌ failure
Classify PR ✅ success
Desktop Shell (ubuntu-22.04) ✅ success
Desktop Shell (windows-2022) ✅ success
Flyway migration version uniqueness ✅ success
Integration Tests (no-AK, No Sandbox) ✅ success
Lint & Static (ubuntu-latest, Node 22.x) ✅ success
macos-latest / Java 21 ✅ success
OpenTUI no-flicker gate ✅ success
Real daemon E2E / Java 11 ✅ success
Runtime Broker and Managed Agent MariaDB / Java 21 ✅ success
Serve A/B (ubuntu-latest, Node 22.x) ✅ success
Test (ubuntu-latest, Node 22.x) ✅ success
TUI parity snapshots (ink vs opentui) ✅ success
ubuntu-latest / Java 11 ✅ success
ubuntu-latest / Java 17 ✅ success
ubuntu-latest / Java 21 ✅ success
web-shell E2E Smoke (ubuntu-latest, Node 22.x) ✅ success
windows-latest / Java 21 ✅ success

One row per check name (latest run); skipped checks omitted; failures sort first. / 每个检查名一行(取最新一次运行),省略 skipped,失败项排在最前。

On the sandboxed lanes: neither one can settle this claim, so I'm not recommending either. @qwen-code /tmux is irrelevant — there is no TUI surface here. @qwen-code /verify does A/B load-bearing proof against the base build, but on an unloaded runner it would show exactly what the author already reports: the tests pass both with and without the change. The condition under test is shared-runner contention, which only this PR's own Test (ubuntu-latest, Node 22.x) run on a loaded ecs-qwen-* host can reproduce. Naming that honestly rather than padding the comment with a lane that cannot help: the contention claim is not verified and cannot be verified by any sandboxed lane — it rests on the CI rerun above. Likewise the author's local results ("green before and after locally") are their own claim, attributed as such, and are not evidence either way since they were taken on an unloaded machine.

Real-scenario testing: N/A — unattended CI run, and a test-only timing change with nothing user-visible to drive.

Not verified: whether the regression reading or the contention reading is correct. That is the open question this review defers on, and it needs a maintainer plus a load-controlled rerun, not more reading of this diff.

中文说明

代码审查

先说我自己的独立方案(只看标题和"为什么需要"、未读 diff 时写下):面对"两个 hosted recovery 测试在 main CI 上因 waitFor 默认 1 秒窗口而失败",我会 (1) 先确定失败形态——是窗口耗尽,还是状态根本没到达?方法是检查同一测试文件在相邻 main commit 上是否通过、以及当时 runner 的负载;(2) 若确为窗口耗尽,则加一个与文件既有主流取值一致的显式 timeout,而不是自创取值或去改全局配置;(3) 只改观测到失败的地方。

第 (2)(3) 步正是本 PR 所做的,而且做得好——我直接对照 diff 核实了"断言未变"这一说法,成立:回调体除 Prettier 重新缩进外逐字节相同,唯一新增是两处 { timeout: 10_000 } 和两条注释。没有任何断言被削弱、跳过、重试或包裹。注释点明了 issue 和机制,比多数超时调整携带的上下文更多。没有重复代码、没有新抽象、没有触及生产接口。此处无任何违反 AGENTS.md 的地方。

第 (1) 步是缺口,也是本次审查的全部关键。

诊断悬而未决——这才是阻塞性问题

本 PR 断言失败源于资源争抢且"不是真实缺陷"。一位维护者(@doudouOUC)于 19:35:05Z 在 #14101 发布了相互竞争的根因分析——比本 PR 开启时间 19:40:52Z 早 5 分钟——结论是这是 53579861daba(fix(serve): resume committed file results after runtime retirement,#14059)引入的产品回归。本 PR 未回应该分析。

我没有采信任何一方的说法,而是通过 API 亲自核实了双方的关键事实:

支持"回归"读法的证据:

  • hosted-harness-session.test.ts 的 blob 为 e8fe9cc9cf8f、955181 字节,在 44ddf79ef4e8、53579861daba 和当前 main HEAD 6212189f1f83 上逐字节相同。测试没变,变的是被测代码。
  • 44ddf79ef4e8 上的 run 38418699275(main、push):success,✓ src/serve/hosted-harness-session.test.ts (459 tests) 188409ms。紧接着的下一个 commit 上的 run 38410683888:failure,同一文件,2 个测试 × 3 次尝试,而其余 41,860 个测试全部通过。
  • 53579861daba 改动了 hosted-workspace-tool-turn.ts(+68/−1)、hosted-turn-cleanup.ts(+61/−7)、hosted-file-history.ts(+4/−1)和 hosted-recovery.test.ts(+251/−111)——恰好就是这两个测试所覆盖的 hosted turn-cleanup / recovery / file-history 子系统。
  • 观测到的状态是转换前状态,且始终没有转换:期望 {false, true} 却得到 {hasActivePrompt: true, recoveryBlocked: false};期望 release 被调用 1 次却为 0 次。"调用缺失"比"调用迟到"更难用慢来解释。
  • hosted-workspace-tool-turn.ts 在 53579861daba 和 main HEAD 上都是 blob c51af5d55e20——若确为回归,则至今仍存在于 main 上。

支持"资源争抢"读法的证据——而这正是 #14101 上那份回归分析没有检查的:

两次 run 在不同宿主上,且失败那次在这两个测试实际执行的时刻负载高得多。数据来自各 job 自身的 DFSAMPLE 遥测:

测试执行期间 绿色 run 44ddf79ef4e8(ecs-qwen-hk5-15) 失败 run 53579861daba(ecs-qwen-hk3-22)
1 分钟负载 10.7 – 15.2 14.1 – 21.0
5 分钟负载 8.8 – 10.9 24.5 – 29.9
15 分钟负载 11.3 – 11.7 28.8 – 31.2
宿主并发测试 job 数 3 – 8 8 – 16

5 分钟负载约高 2.7 倍。在这种负载下,一个要跨越 fsync journal 提交、且每次轮询都含一次 supertest 往返的 1 秒窗口确实很勉强——而测试 2 每次尝试仅非等待部分就耗掉约 23 秒,对一个单元测试而言极其异常。

因此两种诊断都未被确立。 绿色 run 与失败 run 之间,代码和环境同时发生了变化,这是一个混淆变量——#14101 所依据的"改前通过 / 改后失败、测试文件未变"论证没有控制 runner 因素,而本 PR 的"只是资源争抢"论证也没能解释为何状态在三次尝试中一次都没到达。我无法从 diff 解决这一点,我认为没有受控重跑谁也解决不了。

为什么这构成阻塞而不只是值得关注:如果确为回归,放宽窗口不仅修不好它——还会有把一个响亮、确定性、定位准确的失败,变成缓慢或偶发失败的风险。而这正是本仓库 deflake 策略要防止的结果("那些做法掩盖 flake 而非修复它——并可能掩盖真实 bug";以及当失败"看起来像真实的产品偶发 bug …… 停下。由人类来 deflake")。涉及的是 hosted turn cleanup 与 journal recovery 子系统,这不是我愿意粉饰行为变化的地方。

好消息是这个问题会以很低的成本自行揭晓,而且本 PR 描述里说得对——"本 PR 的 CI 重跑才是有意义的门禁":

我再补一个成本很低的判别方法给接手的人:该失败只在负载下可复现,因此有用的实验是在同一 runner 上、背靠背、负载可比的条件下,对 53579861daba 及其父提交 44ddf79ef4e8 跑这两个测试。这一次受控对比就能把两个混淆变量分开;本 PR 和 #14101 都没有做这件事。

测试证据

无人值守 CI 运行——按审查规则,我没有构建或执行任何源自本 PR 的代码,因此以下内容全部来自通过 API 读取的本 PR 自身 CI,以及上文引用的历史 run 日志。

没有任何 check 变红。Test (ubuntu-latest, Node 22.x)——唯一能证实本 PR 核心主张的 check——在审查时仍进行中,Lint & Static、Serve A/B 和 Java 各 lane 同样如此。我没有轮询或等待它们;下表是快照,CI 落定后 finalize job 会就地更新它。

(CI 表格见上方英文区,中文侧不重复,以免重复输出机器可读标记。)

关于沙箱验证 lane: 两者都无法判定这一主张,所以我都不推荐。@qwen-code /tmux 不相关——此处没有 TUI 界面。@qwen-code /verify 做的是相对 base build 的 A/B 承重性证明,但在空载 runner 上它只会复现作者已报告的结果:改动前后测试都通过。被检验的条件是共享 runner 的资源争抢,而这只有本 PR 自身的 Test (ubuntu-latest, Node 22.x)、在负载中的 ecs-qwen-* 宿主上运行才能复现。与其在评论里塞一个帮不上忙的 lane,我选择如实说明:**资源争抢这一主张未被验证,也无法由任何沙箱 lane 验证——它取决于上面的 CI 重跑。**同样,作者的本地结果("本地改动前后均为绿色")是其自述,按此归属,且因取自空载机器,对两个方向都不构成证据。

真实场景测试:N/A —— 无人值守 CI 运行,且为仅测试的时序改动,无用户可见行为可驱动。

未验证:回归读法与资源争抢读法孰对孰错。这正是本次审查据以暂缓的未决问题,它需要维护者加上一次受控负载重跑,而不是对这个 diff 再读几遍。

— Qwen Code · qwen3.8-max-2026-09-02

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

@qwen-code-review-bot

Copy link
Copy Markdown
Collaborator

Confidence: 3/5 — the change itself is clean and I'd merge it in isolation; what I can't clear is whether it fixes the actual cause, and a maintainer has already put a competing root-cause on record that this PR doesn't answer.

Stepping back: this is a well-formed PR in search of a settled diagnosis. The craft is right — assertion-preserving to the byte, minimal, consistent with the file's own idiom and with #14091, and it correctly declines to sweep the other ~80 bare waits in the file. My independent proposal reached the same change. If the failure really is a 1 s window expiring under load, this is the correct fix and there is nothing more to say.

But my proposal had a step this PR skipped, and it turned out to be the one that matters: establish the failure mode before widening the window. When I did that, the answer came back genuinely ambiguous rather than confirming the description. The same byte-identical test file passed on 44ddf79ef4e8 and failed on the next commit — which is the regression signature @doudouOUC documented on #14101 — and the failing host was running at ~2.7× the 5-min load of the green one, which is the contention signature this PR describes. Both variables moved at once. Neither side controlled for the other, and I don't think the diff can settle it.

The reason I'm deferring rather than approving is the asymmetry, not the ambiguity. If it's contention, approving costs nothing and CI goes green. If it's a regression, approving quietly converts a loud, deterministic, correctly-located failure in hosted turn cleanup and journal recovery into a slower or intermittent one — and the regressing code (hosted-workspace-tool-turn.ts, blob c51af5d55e20) is still byte-identical on main HEAD, so nothing else would catch it. This repo's deflake policy is explicit that a timeout bump must not be the response when the failure "looks like a REAL intermittent product bug", and that a human takes over at that point. I'd rather be a few hours slow on a test-timing PR than be the reason a recovery-path regression goes quiet.

Six months from now I'd thank the author for the tidy, well-commented change and curse whoever merged it without resolving #14101. So: not a rejection — the code is fine — but not mine to approve while the cause is open.

What settles it, cheaply:

  1. Just wait for this PR's own Test (ubuntu-latest, Node 22.x). It was still in progress at review time. Green on those two tests → contention is the better explanation and this can merge. Red on the same two → the wider window demonstrably doesn't fix it and Main CI failed: Qwen Code CI — src/serve/hosted-harness-session.test.ts > … > parks an admitted prompt when model request preparation fails (+1 more) #14101 needs the product-side investigation already outlined there. The PR description is right that this is the meaningful gate.
  2. The controlled experiment nobody has run: the same two tests against 53579861daba and its parent 44ddf79ef4e8, back to back, on one runner under comparable load. That single comparison separates the two confounded variables. Everything argued so far on both sides infers from uncontrolled runs.
  3. If it comes back green and a maintainer is satisfied the regression reading is dead, say so on Main CI failed: Qwen Code CI — src/serve/hosted-harness-session.test.ts > … > parks an admitted prompt when model request preparation fails (+1 more) #14101 and re-run /triage — I'll approve on the spot.

Not blocking, for whoever picks this up: ~80 bare 1 s waits remain in this file against 173 explicit ones. Fixing them two-at-a-time per CI failure will keep generating autofix PRs. Vitest has no global waitFor default, so the durable answer is a small file-local helper wrapping vi.waitFor with the house 10 s window — a separate, deliberate refactor, correctly out of scope here.

Deferring to @doudouOUC — you wrote the regression analysis on #14101, so this is your call to make, not mine: the load telemetry I pulled suggests the contention reading is more viable than "regression" alone implies, but I can't rule your reading out either, and only a load-controlled rerun separates them. Assigned so it lands in your filter. Needs a human call on this one.

中文说明

Confidence: 3/5 —— 改动本身是干净的,单独看我愿意合并;我无法排除的是它是否修到了真正的成因,而一位维护者已在案卷上留下了相互竞争的根因分析,本 PR 并未回应。

退一步看:这是一个形态良好、但诊断尚未落定的 PR。工艺是对的——逐字节保留断言、改动最小、与文件自身惯例以及 #14091 一致,并且正确地没有去动文件里其余约 80 处裸等待。我的独立方案也得到同样的改动。如果失败确实是 1 秒窗口在负载下耗尽,那这就是正确的修复,无需再多说什么。

但我的方案里有一步是本 PR 跳过的,而它恰好是关键:在放宽窗口之前先确定失败形态。我补做这一步后,得到的结论是真正的两可,而非印证描述。同一个逐字节相同的测试文件在 44ddf79ef4e8 上通过、在下一个 commit 上失败——这正是 @doudouOUC 在 #14101 记录的回归特征;同时失败那次宿主的 5 分钟负载约为绿色那次的 2.7 倍——这又是本 PR 所述的资源争抢特征。两个变量同时变化,双方都没有控制对方,我认为 diff 无法判定。

我选择暂缓而非批准,理由是风险的不对称,而不是这份不确定性本身。若是资源争抢,批准毫无代价,CI 变绿。若是回归,批准就会把 hosted turn cleanup 与 journal recovery 中一个响亮、确定性、定位准确的失败,悄悄变成更慢或偶发的失败——而引入回归的代码(hosted-workspace-tool-turn.ts,blob c51af5d55e20)在 main HEAD 上仍逐字节相同,因此不会再有其他东西能发现它。本仓库的 deflake 策略明确规定:当失败"看起来像真实的产品偶发 bug"时,不得以提高超时作为应对,此时应由人类接手。相比让一个 recovery 路径的回归静默下去,我宁愿在一个测试时序 PR 上慢上几小时。

半年后回看,我会感谢作者写出这个整洁、注释清楚的改动,但会咒骂那个在 #14101 未解决时就合并它的人。所以:这不是否决——代码没问题——但在成因未决之前,这个批准不该由我来给。

能低成本定论的做法:

  1. 就等本 PR 自己的 Test (ubuntu-latest, Node 22.x)。 审查时它仍在进行中。这两个测试变绿 → 资源争抢是更好的解释,可以合并。同样两个测试变红 → 放宽窗口显然无效,Main CI failed: Qwen Code CI — src/serve/hosted-harness-session.test.ts > … > parks an admitted prompt when model request preparation fails (+1 more) #14101 需要按其中已列出的方向做产品侧排查。PR 描述里说这是有意义的门禁,这一点是对的。
  2. 尚未有人做的受控实验: 在同一 runner、负载可比的条件下,对 53579861daba 及其父提交 44ddf79ef4e8 背靠背跑这两个测试。这一次对比就能分开两个混淆变量。目前双方所有论证都是从未经控制的 run 推断出来的。
  3. 若结果变绿且维护者认可回归读法已被排除,请在 Main CI failed: Qwen Code CI — src/serve/hosted-harness-session.test.ts > … > parks an admitted prompt when model request preparation fails (+1 more) #14101 说明并重跑 /triage——我会立即批准。

给接手者的非阻塞建议:该文件仍有约 80 处裸 1 秒等待,对照 173 处显式等待。按"CI 失败一次修两处"的节奏推进,会持续产生 autofix PR。Vitest 没有全局 waitFor 默认值,因此持久的做法是加一个文件内的小 helper 包装 vi.waitFor 并统一使用本仓库的 10 秒窗口——那是一次独立且有意的重构,在此处正确地不属于本 PR 范围。

转交 @doudouOUC —— #14101 上的回归分析出自你手,因此这个判断该由你做,而不是我:我拉取的负载遥测表明,资源争抢这一读法比单看"回归"所暗示的更站得住脚,但我同样无法排除你的读法,只有受控负载重跑才能分开二者。已 assign,以便进入你的待办过滤。这一处需要人来拍板。

— Qwen Code · qwen3.8-max-2026-09-02

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

@qwen-code-review-bot

qwen-code-review-bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

🩺 serve daemon A/B

Built the PR base vs this PR head 0f3c53c, drove a fixed endpoint set against each, and diffed the JSON responses. Only fields that changed are shown.

health-deep-with-session

field PR base (before) this PR (after)
activeWorkStaleMs 5 4

— Qwen Code · serve A/B

@qwen-code-dev-bot

qwen-code-dev-bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator Author

✅ AutoFix round 1 finished — view run. See this round's report below.

中文说明

✅ AutoFix 第 1 轮已完成 —— 查看运行。本轮报告见下方。

@qwen-code-dev-bot

Copy link
Copy Markdown
Collaborator Author

🤖 Reviewed the latest feedback — no changes needed. Why, point by point: · 已审阅最新反馈——无需改动。逐点说明原因如下:

Autofix Address-Review — PR #14107 (issue #14101)

Outcome: no change this round. Every actionable item in this round's feedback was triaged to a disposition that requires no code edit; the reasoning and evidence for each is below.

Feedback dispositions

1. Issue comment ic:6154075731 — serve A/B: activeWorkStaleMs 5 → 6 — declined (measurement noise)

The qwen:serve-ab bot diffed health-deep-with-session between the PR base and head and found one changed field: activeWorkStaleMs moved from 5 to 6.

  • The PR diff is a single vitest unit-test file (packages/cli/src/serve/hosted-harness-session.test.ts, +26/−16). No production code changed, so the two serve daemons the A/B harness compared run byte-identical code.
  • activeWorkStaleMs is a wall-clock staleness duration sampled by the harness itself; a 1 ms delta between two sequential daemon runs is timing noise, not a behavioral regression.
  • The Serve A/B (ubuntu-latest, Node 22.x) check itself concluded SUCCESS (completed 20:01:40Z).

This is an issue-level bot comment with no review thread; no reply is posted. Nothing to implement.

2. Failed check — Hosted process fault gates / MySQL 8.4 / Java 21 (SDK Java) — not attributable to this PR; no in-scope fix exists

This gate cannot have been broken by this PR, established by construction rather than by assumption:

  • Topology: HEAD (b51704d84f) is exactly origin/main (6212189f1f) plus one commit; the branch is 0 commits behind main. The full three-dot diff is the single test file above.
  • The changed file is not an input to the gate. The job consumes the checkout in three ways, none of which can observe the diff:
    1. dist/cli.js, built from the checkout — the esbuild entry graph (packages/cli/src/cli.ts, the execution worker, the fzf/glob/mod workers, the sandbox relays, mem0) never reaches any *.test.ts file; nothing in the production module graph imports the changed file, so the bundle is unaffected.
    2. Java sources under packages/sdk-java/** — untouched by the PR, and a tree-wide grep confirms no reference to hosted-harness-session.test anywhere in packages/sdk-java.
    3. integration-tests/helpers/hosted-relay-headers.test.ts (the proxy-header relay vitest step) — untouched.
  • The gate therefore executed byte-identical inputs to a run on main at 6212189f1f. The job ran 44m18s (20:04:17Z → 20:48:35Z) against a 210-minute job ceiling — a shape consistent with the workflow's own documented step-ceiling failure mode (the 35-minute Maven "Verify Hosted Java, Spring and MySQL processes" step cap, cf. the comment citing Main CI failed: SDK Java on 0013e83635ed #13503), not with a defect introduced by a TypeScript test-only diff.
  • Local reproduction is unavailable: this sandbox has no java, mvn, docker, or MySQL, so the MySQL 8.4 / Java 21 Maven gate cannot be re-run here. The failure log is likewise unavailable to this round (no GitHub credentials), so no deeper diagnosis is possible without guessing — which the autofix rules forbid.
  • No allowed fix exists regardless: any hypothetical remedy would live in packages/sdk-java/** (far outside this PR's footprint) or in .github/workflows/sdk-java.yml (CI machinery this PR is not about, which this loop must not modify). The correct handling is a CI rerun, which the workflow's independent verification performs after this round.

Context: the triage's blocking question resolved in this PR's favor

The stage-3 triage review deferred approval on one explicit condition: "Just wait for this PR's own Test (ubuntu-latest, Node 22.x). Green on those two tests → contention is the better explanation and this can merge." That check completed SUCCESS at 20:09:40Z on this exact head, with the two widened tests passing — the contention reading behind this PR is confirmed by its own CI. No further change is needed to satisfy that condition.

Verification

  • git diff origin/main...HEAD --stat — confirmed the full diff is packages/cli/src/serve/hosted-harness-session.test.ts (+26/−16); branch is origin/main + 1 commit, 0 behind.
  • grep -r "hosted-harness-session\.test" packages/sdk-java — no matches; the changed file is not referenced by the failing gate's tree.
  • esbuild.config.js entry-point inspection — the dist/cli.js bundle graph does not include test files.
  • npm run build — passed, exit 0 (with COREPACK_HOME=/tmp/corepack-home, the known sandbox EACCES workaround; relocates only the package-manager cache).
  • npx vitest run src/serve/hosted-harness-session.test.ts -t "parks an admitted prompt when model request preparation fails" (packages/cli) — 1 passed, exit 0.
  • npx vitest run src/serve/hosted-harness-session.test.ts -t "retains cleanup debt after interrupted channel settlement until original-owner release succeeds" (packages/cli) — 1 passed, exit 0.
  • which java mvn docker mysql — none present; the failing Java/MySQL gate is not reproducible in this sandbox (CI-only check, not a failed runnable local check).

No files were changed, no commit was made, and the working tree remains clean at b51704d84f.

中文说明

Autofix 审查处理 — PR #14107(issue #14101)

结论:本轮无改动。 本轮反馈中的每个可处理项都被分类为不需要代码改动的处置;各项理由与证据如下。

反馈处置

1. Issue 评论 ic:6154075731 — serve A/B:activeWorkStaleMs 5 → 6 — 拒绝(测量噪声)

qwen:serve-ab 机器人对比了 PR base 与 head 的 health-deep-with-session 响应,发现仅一个字段变化:activeWorkStaleMs 从 5 变为 6。

  • 本 PR 的 diff 只有一个 vitest 单元测试文件(packages/cli/src/serve/hosted-harness-session.test.ts,+26/−16),未改动任何生产代码,因此 A/B 对比的两个 serve 守护进程运行的是逐字节相同的代码。
  • activeWorkStaleMs 是测试框架自身采样的墙钟陈旧时长;两次先后运行之间 1 毫秒的差值属于时序噪声,不是行为回归。
  • Serve A/B (ubuntu-latest, Node 22.x) 检查本身的结论为 SUCCESS(完成于 20:01:40Z)。

这是一条 issue 级机器人评论,没有可回复的审查线程,因此不发表回复。无需实现任何改动。

2. 失败检查 — Hosted process fault gates / MySQL 8.4 / Java 21(SDK Java)— 不可归因于本 PR;不存在范围内修复

该门禁不可能被本 PR 破坏,这一结论是通过构造性论证确立的,而非主观假设:

  • 拓扑: HEAD(b51704d84f)恰好是 origin/main(6212189f1f)之上加一个提交;分支落后 main 0 个提交。完整的三点 diff 只有上述单个测试文件。
  • 被改动的文件不是该门禁的输入。 该 job 以三种方式消费检出内容,任何一种都无法感知本 diff:
    1. 从检出构建的 dist/cli.js —— esbuild 入口图(packages/cli/src/cli.ts、execution worker、fzf/glob/mod workers、sandbox relays、mem0)不会到达任何 *.test.ts 文件;生产模块图中没有任何文件 import 被改动的文件,因此 bundle 不受影响。
    2. packages/sdk-java/** 下的 Java 源码 —— 本 PR 未触碰,且全树 grep 确认 packages/sdk-java 中没有任何对 hosted-harness-session.test 的引用。
    3. integration-tests/helpers/hosted-relay-headers.test.ts(代理头转发 vitest 步骤)—— 未触碰。
  • 因此该门禁执行的输入与在 6212189f1f 上跑 main 时逐字节相同。该 job 运行了 44 分 18 秒(20:04:17Z → 20:48:35Z),而 job 上限为 210 分钟 —— 这一形态与该工作流自身记录过的步骤上限失败模式一致("Verify Hosted Java, Spring and MySQL processes" 步骤的 35 分钟 Maven 上限,参见引用 Main CI failed: SDK Java on 0013e83635ed #13503 的注释),而不是一个 TypeScript 纯测试 diff 引入的缺陷。
  • 本地无法复现: 本沙箱没有 java、mvn、docker 或 MySQL,无法在此重跑 MySQL 8.4 / Java 21 的 Maven 门禁。本轮同样拿不到失败日志(无 GitHub 凭据),不做猜测就无法进一步诊断 —— 而 autofix 规则禁止猜测式诊断。
  • 无论如何都不存在被允许的修复: 任何假想的修复都只能落在 packages/sdk-java/**(远超本 PR 的改动范围)或 .github/workflows/sdk-java.yml(本 PR 并不涉及的 CI 机械设施,本循环不得修改)。正确的处理方式是 CI 重跑,这由工作流在本轮之后的独立验证完成。

背景: triage 的阻塞性问题已按有利于本 PR 的方向解决

stage-3 triage 审查给出了一个明确的暂缓批准条件:"就等本 PR 自己的 Test (ubuntu-latest, Node 22.x)。这两个测试变绿 → 资源争抢是更好的解释,可以合并。" 该检查已在当前 head 上于 20:09:40Z 以 SUCCESS 完成,两处放宽窗口的测试均通过 —— 本 PR 背后的资源争抢判断已被其自身 CI 证实。满足该条件无需任何进一步改动。

验证

  • git diff origin/main...HEAD --stat —— 确认完整 diff 仅为 packages/cli/src/serve/hosted-harness-session.test.ts(+26/−16);分支为 origin/main + 1 个提交,落后 0 个。
  • grep -r "hosted-harness-session\.test" packages/sdk-java —— 无匹配;被改动文件未被失败门禁所在的树引用。
  • 检查 esbuild.config.js 入口点 —— dist/cli.js 的 bundle 图不包含测试文件。
  • npm run build —— 通过,退出码 0(使用 COREPACK_HOME=/tmp/corepack-home,即已知的沙箱 EACCES 变通;仅迁移包管理器缓存位置)。
  • npx vitest run src/serve/hosted-harness-session.test.ts -t "parks an admitted prompt when model request preparation fails"(packages/cli)—— 1 通过,退出码 0。
  • npx vitest run src/serve/hosted-harness-session.test.ts -t "retains cleanup debt after interrupted channel settlement until original-owner release succeeds"(packages/cli)—— 1 通过,退出码 0。
  • which java mvn docker mysql —— 均不存在;失败的 Java/MySQL 门禁无法在本沙箱复现(这是 CI 专属检查,不是本地可运行的失败检查)。

本轮未改动任何文件、未创建提交,工作树在 b51704d84f 上保持干净。

Base-conflict check · 基分支冲突检查: no conflict with main. · 与 main 无冲突。


🧠 Handled by Qwen Code · model/模型 kimi-k3 · CLI 0.25.1

@wenshao

wenshao commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator

已评审 b51704d84f316b0173eb63e17ea7477979053e7a。未发现本次改动引入的可操作代码缺陷(C=0)。

  • 完整 diff 仅修改两个 vi.waitFor 的超时为 10_000 并补充原因注释;回调内外的断言、输入、mock、清理流程均保留。10 秒与相邻恢复测试一致,且低于本文件生效的单测试上限(ECS runner 60 秒,其他环境 15 秒)。
  • 已直接核对当前 head 的 Linux 测试日志:hosted-harness-session.test.ts 的 459 个测试全部通过,本次涉及的两个用例分别为 541 ms 和 1723 ms;Lint & Static 也已通过。这满足了此前 triage 提出的“等待本 PR Linux 测试结果”的验证条件。
  • 对 Main CI failed: Qwen Code CI — src/serve/hosted-harness-session.test.ts > … > parks an admitted prompt when model request preparation fails (+1 more) #14101 的归因仍需保持准确:上述耗时是整个用例耗时,不能直接当作 waitFor 的等待时长;此 PR 的 CI 未启用主分支的 coverage,也没有同 runner、同负载的前后对照。因此,这些结果支持保留这个小范围等待预算调整,但不足以声称资源争抢已被唯一确认为根因,或已排除所有间歇性产品问题。

另有一项需要纠正的 CI 信息:当前 Hosted process fault gates / MySQL 8.4 / Java 21 的失败日志明确显示 HostedShellLifecycleRecoveryIT.publicDeletionRecoversOriginalResources 4 个断言失败,汇总为 Tests run: 43, Failures: 4, Errors: 0,Maven 因测试失败退出。涉及期望的 writer/lease 状态变为 null;不能按上一条 AutoFix 评论的推测将其归为步骤超时。该任务执行 Java 集成测试与 CLI bundle,本次修改的 TypeScript 单测不在其执行路径,故不将它报告为本 PR 引入的缺陷;仍应单独跟踪处理,当前 CI 并非全绿。

验证范围:完整差异、相关测试上下文、超时配置、历史评审及当前提交的 CI 原始日志;git diff --check 通过。本地工作树未安装依赖,本轮未在本地重跑构建或测试,也未进行负载受控复现。

@qwen-code-dev-bot

Copy link
Copy Markdown
Collaborator Author

🤖 Reviewed the latest feedback — no changes needed. Why, point by point: · 已审阅最新反馈——无需改动。逐点说明原因如下:

Autofix round — no change

No code change this round. The only new feedback is maintainer @wenshao's review of b51704d84f, which concluded C=0 — no actionable code defects introduced by this change, and confirmed from the live Linux CI log that all 459 tests in hosted-harness-session.test.ts pass (the two touched cases at 541 ms and 1723 ms). There were no inline comments and no review-body findings to address.

Disposition of each feedback point

  • Approval / attribution caution ([ic:6157203873]): The reviewer cautioned that the observed whole-test durations do not uniquely confirm resource contention as the root cause of Main CI failed: Qwen Code CI — src/serve/hosted-harness-session.test.ts > … > parks an admitted prompt when model request preparation fails (+1 more) #14101. This is a guidance note for how the fix is described, not a code defect. The in-code comments state only the observed facts (the parked chain crosses fsync-backed journal commits; the default 1s waitFor window flaked on a loaded ubuntu-latest runner) and do not claim a uniquely confirmed root cause, so no comment edit is warranted. The commit message cannot be reworded because this workflow uses additive commits only. No action.
  • Still-red check Hosted process fault gates / MySQL 8.4 / Java 21: The reviewer verified from the raw log that this is 4 assertion failures in HostedShellLifecycleRecoveryIT.publicDeletionRecoversOriginalResources (expected writer/lease states observed as null), not a step timeout. That job runs Java integration tests against the built CLI bundle; this PR's only change is a TypeScript vitest file that is not in its execution path, and the branch sits directly on the current main tip. The reviewer explicitly directed that it be tracked separately rather than attributed to or fixed in this PR. Fixing a Java integration-test failure here would be scope drift outside this PR's footprint, so per the defer-to-follow-up rule it is recorded in deferred-findings.json for the per-PR deferred-findings issue that survives merge. Deferred, not fixed in this PR.

Verification

No local checks were run because this round makes no change to the working tree. The maintainer's review already verified the current head against the live CI: Linux unit tests 459/459 pass for the touched file, Lint & Static passed, and git diff --check is clean. The deterministic gate's own re-run remains the final verification for the unchanged head.

中文说明

Autofix 本轮——无需改动

本轮不进行任何代码修改。唯一的新反馈是维护者 @wenshao 对 b51704d84f 的评审,结论为 C=0——本次改动未引入可操作的代码缺陷,并已根据实时的 Linux CI 日志确认 hosted-harness-session.test.ts 的 459 个测试全部通过(涉及的两个用例分别为 541 ms 和 1723 ms)。没有内联评论,也没有评审正文中的发现需要处理。

各反馈点的处理结论

  • 通过评审 / 归因提醒([ic:6157203873]):评审者提醒,观察到的整个用例耗时不足以将资源争抢唯一确认为 Main CI failed: Qwen Code CI — src/serve/hosted-harness-session.test.ts > … > parks an admitted prompt when model request preparation fails (+1 more) #14101 的根因。这是一条关于如何表述本次修复的提醒,而非代码缺陷。代码内注释只陈述了观察到的事实(parked 链路跨越基于 fsync 的 journal 提交;默认 1 秒的 waitFor 窗口在负载较高的 ubuntu-latest runner 上出现抖动),并未声称根因已被唯一确认,因此无需修改注释。提交信息无法改写,因为本工作流只允许追加式提交。无需处理。
  • 仍为红色的检查 Hosted process fault gates / MySQL 8.4 / Java 21:评审者已从原始日志核实,该失败是 HostedShellLifecycleRecoveryIT.publicDeletionRecoversOriginalResources 的 4 个断言失败(期望的 writer/lease 状态变为 null),而非步骤超时。该任务运行的是针对构建产物 CLI bundle 的 Java 集成测试;本 PR 唯一的改动是一个不在其执行路径上的 TypeScript 单测文件,且分支直接位于当前 main 顶端。评审者明确要求对该失败单独跟踪,而不是归因于本 PR 或在本 PR 中修复。在本 PR 中修复一个 Java 集成测试失败属于超出本 PR 足迹的范围漂移,因此按照"延期跟进"规则,已将其记录到 deferred-findings.json,以便进入合并后仍然保留的按 PR 维度的延期发现议题。已延期,不在本 PR 中修复。

验证

本轮未改动工作树,因此未在本地运行任何检查。维护者的评审已基于实时 CI 对当前 head 完成验证:涉及文件的 Linux 单元测试 459/459 通过,Lint & Static 通过,git diff --check 干净。对于未变更的 head,确定性门禁的自身重跑仍是最终验证。

Base-conflict check · 基分支冲突检查: no conflict with main. · 与 main 无冲突。


🧠 Handled by Qwen Code · model/模型 kimi-k3 · CLI 0.25.1

@wenshao

wenshao commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator

Verification report — PR #14107

Verdict: merge-ready — 0 unexpected failures across 45 scripted assertions (fault-injection A/B ×2, 48-run timing matrix, gates, static census/equivalence).

Verified head: 944b99c15a5e3db76adc29bf776fafa6bf13870f · effective diff: 163e4686191d (current origin/main) .. head. Mid-round the head moved b51704d84f → 944b99c15a (a merge of main 163e468619 into the branch); every cell below was re-measured at the new head, the superseded head's numbers were discarded.

中文摘要
  • 结论:可合并(merge-ready)。 该 PR 只改一个测试文件,把两个 vi.waitFor 轮询窗口从 vitest 默认 1 秒放宽到显式 10 秒,断言逐字节未动(空白不敏感 diff 仅 18 行良性变化:括号重构 ×2、窗口选项 ×2、注释 ×4)。
  • A/B 证明(故障注入,各 13/13 断言通过): 注入 1.2s status 路由延迟或 300ms/条 journal fsync 延迟时,base(1s 窗口)两个测试双双失败,失败签名与 CI 日志逐字一致(T1: hasActivePrompt 断言 / Timed out in waitFor!;T2: expected "release" to be called 1 times, but got 0 times);head(10s 窗口)全部通过。窗口本身是承重墙,证毕。
  • 回归 vs 争抢之争(评审悬而未决的问题),两条独立证据都指向争抢: ① CI 记录本身:红 run 在 53579861(14:07Z),绿 run 在其后代 44ddf79e(15:03Z),两者之间 packages/cli/src、packages/core/src、lockfile 零改动——同一份代码先红后绿,非确定性是构造性结论;② stage-3 评审点名要的受控实验:本机 5357 vs 其父 5f35538e 各 12 次交错运行,24/24 全绿且时长分布一致(T1 p50 254 vs 257ms;T2 p50 648 vs 665ms)——5357 没有移动延迟分布。
  • 评审计划原样走通: -t "Hosted Harness no-tool session" → 284/284;全文件 459/459;新 head 两处均复测。
  • vitest 默认窗口核实: 已装 vitest 源码 interval = 50, timeout = 1e3,PR 描述属实;Timed out in waitFor! 仅在窗口耗尽时没有任何已完成的失败轮询时才抛出(见 Corrections)。
  • 三条更正: ① stage-3 与 issue 评论的回归时间线顺序说反了(5357 在前为红、44dd 是其后代为绿,而非"44dd 绿、下一个提交红");② "约 80 裸等待 vs 173 显式"的实际普查是 base 57/196、head 55/198(总数 253 对,拆分错);③ CI 里实际失败面是最后一次轮询断言的再抛出,不是字面 Timed out in waitFor!。
  • 未覆盖: CI 负载级争抢在本机未复现(负载臂 0/12,NVMe 的 fsync 远比共享 Linux runner 快;故障注入 A/B 是确定性替代);SDK Java 的 MySQL lane 在本 PR 红,但 main 上近期全红(预存问题,与 TS 测试改动无关);base 提交 19:24Z 的 Windows lane 失败是另一组测试(8 个,均非本 issue 签名)。
  • 发布前状态复核: head 中途从 b51704d84f 移到 944b99c15a(main merge),所有单元已在新 head 重测。

Central claim and A/B proof

The PR exists to change exactly one behavior: the polling window of two vi.waitFor calls, from vitest's implicit 1 s default to an explicit 10 s. The load-bearing question: is that window what failed in CI, and does widening it change nothing else?

A/B method. Both arms run in the head worktree; the test file is swapped between the base blob and the head blob (the only in-diff change), and latency is injected at two independent points:

  • inject-route — the /session/:id/status handler computes its body at request arrival, then sleeps 1200 ms before responding. Polls observe fresh state; the observation simply lands late inside the window.
  • inject-journal — SessionWriterLease.appendJsonLineOnce (the fsync-backed journal-commit path the PR comment names) sleeps 300 ms per record — the shape of "fsync-backed journal commits are slow on a loaded runner".

Numbers below are the new-head (944b99c1) measurements; the superseded head (b51704d8) produced the same table within run-to-run noise and is discarded.

arm window injection T1 parks an admitted prompt… T2 retains cleanup debt…
ctrl-head-nodelay 10 s patch inert (0 ms) pass (256 ms) pass (701 ms)
ctrl-base-nodelay 1 s patch inert (0 ms) pass (319 ms) pass (785 ms)
ab-base 1 s route 1200 ms fail 1229 ms — Error: Timed out in waitFor! fail 1570 ms — AssertionError: expected "release" to be called 1 times, but got 0 times
ab-head 10 s route 1200 ms pass (2682 ms) waitFor held; see note (b)
ab-base 1 s journal 300 ms fail 3366 ms — AssertionError: expected {…} to match object { hasActivePrompt: false, … } fail 9899 ms — AssertionError: expected "release" to be called 1 times, but got 0 times
ab-head 10 s journal 300 ms pass (4465 ms) waitFor held; see note (b)

(a) CI signature match. CI job 115369140703 (run 38410683888) failed T1 with AssertionError: expected { …(3) } to match object { hasActivePrompt: false, …(1) } and T2 with AssertionError: expected "release" to be called 1 times, but got 0 times. The journal-delay base arm reproduces both messages verbatim; the route-delay base arm reproduces T2's verbatim and shows vitest's other timeout surface (Timed out in waitFor!) for T1 — see Corrections for why both surfaces are the same mechanism.

(b) T2's head arms. Under both injections T2's widened waitFor holds; the test later fails strictly after the waitFor block (route arm: line 6163, turn.settled count 2≠1; journal arm: line 6187, release called 3≠2). Cause: once the injected latency stretches the test past the first wake-retry, a second settle cycle commits — the downstream assertions are coupled to the retry cadence, which the injection disturbs. The harness encodes this expectation (line > 6158) and counts it as PASS. This coupling is pre-existing, untouched by the PR, and is not what failed in CI (CI failed on the 1 s window with release at 0 calls); noted under Findings as a hardening observation.

Each arm also asserts that exactly the two named tests executed (2/2, never 0 or 458) and that the test file is restored byte-clean afterwards (git status verified). Ledgers: 13/13 route, 13/13 journal.

The contested question: contention or regression?

The stage-3 review deferred on a genuinely open question — @doudouOUC's regression reading of 53579861 vs the PR's contention reading — and named the experiment that would settle it: the same two tests against 53579861 and a control, back to back, on one machine. Two independent lines of evidence, both decisive:

1. CI's own record (census, no re-run needed). git merge-base --is-ancestor says 53579861 is an ancestor of 44ddf79e, and the run history agrees: red run 38410683888 on 53579861 (14:07Z), then green run 38418699275 on 44ddf79e (15:03Z) — a descendant of the "regressing" commit. Between the two commits, git diff --stat over packages/cli/src/, packages/core/src/, and pnpm-lock.yaml is empty — the failing test file and every production file it exercises are byte-identical. Identical code, red then green, 56 minutes apart: non-determinism is a constructed fact, not an interpretation. A deterministic product regression cannot go green on a descendant that changes nothing in the dependency closure.

2. Local controlled experiment (the one the review asked for). The two named tests, 12 interleaved runs each on 5f35538e68 (parent of the suspect), 53579861 (CI-red commit), and head — same machine, serialized, JSON-reporter durations:

tree runs failed T1 duration min/p50/max T2 duration min/p50/max
parent 5f35538e68 12 0 239 / 257 / 305 ms 556 / 665 / 812 ms
CI-red 53579861 12 0 238 / 254 / 325 ms 542 / 648 / 733 ms
head 944b99c15a 12 0 251 / 255 / 265 ms 615 / 706 / 780 ms

No failure anywhere, and no duration shift between the parent and the suspect commit (Δp50 ≈ −3 ms on T1, −17 ms on T2 — inside run-to-run spread). 53579861 did not measurably slow the settle chain on this hardware; the remaining live explanation is runner contention (the red job ran this file in 291.9 s vs 188.4 s on the green run — the host itself was ~1.55× slower, consistent with the load telemetry quoted in the review).

Reviewer test plan, walked

  • cd packages/cli && npx vitest run src/serve/hosted-harness-session.test.ts -t "Hosted Harness no-tool session" at head: 284 passed, 175 skipped, 0 failed — the plan's count (284) matches exactly.
  • Both named tests individually: pass (and 12× each in the timing matrix).
  • Full file at head: 459 passed (459).
  • The plan's expectation "green before and after locally" is confirmed by the two control arms (base file green on this machine, as is head).

Static verification of the diff shape

  • Assertion-equivalence (scripted): a whitespace-insensitive diff between the base blob and the head file yields exactly 18 changed lines, every one matching a known benign shape (the waitFor( restructure, two { timeout: 10_000 } options, four #14101 comment lines); zero changed lines carry an assertion. 4/4 assertions pass.
  • waitFor census (scripted): 253 vi.waitFor calls in the file at both commits. Base: 57 bare / 196 explicit (10_000 ×162, 15_000 ×33, 3_000 ×1). Head: 55 bare / 198 explicit — exactly −2/+2, both new windows at 10 s. Cross-validated by a textual timeout: count (196 base / 198 head). The file's dominant explicit window was already 10 s, so the PR follows the house idiom; 55 bare waits remain, deliberately out of scope.
  • vitest default verified from the installed package (node_modules/vitest/dist/chunks/vi.*.js): const { interval = 50, timeout = 1e3 } — the 1 s default the PR cites is real.
  • Precedent verified: test(serve): widen hosted approval inline-limit windows for CI contention (#14084) #14091 (merged 2026-10-13T16:35Z) widened hosted-approval-inline-limit.test.ts the same way; the PR body cites it accurately.

Gates

gate result
Reviewer-plan describe-filter run at head (coverage on, as CI runs it) 284 passed / 0 failed (251.5 s)
Full test file at head (coverage on) 459 passed / 0 failed (366.6 s)
Load arm: 14 busy workers on 10 cores + v8 coverage, base vs head file, 6 runs each base 0/6, head 0/6 — the contention flake did not reproduce locally; max durations 403 ms (T1) / 733 ms (T2) stay inside even the 1 s window on this NVMe machine. The fault-injection A/B above is the deterministic stand-in for the loaded-runner regime
PR's own Test (ubuntu-latest, Node 22.x) CI lane pass (28m16s) at the pre-merge head — the gate both the author and stage-3 called decisive
Lint & Static / typecheck pass on the PR's CI (not re-run locally; the diff is comment/option-only in a test file)

Corrections

  1. The regression timeline is inverted in the review record. Stage 3 describes "passed on 44ddf79e and failed on the next commit"; the actual order is the reverse — 53579861 (red, 14:07Z) precedes 44ddf79e (green, 15:03Z), and merge-base --is-ancestor confirms 5357986 is the ancestor. The issue comment's regression case pairs a green run at 44ddf79e with the red run at 53579861, but the green control is a descendant of the suspect commit over a zero-diff closure — which is precisely the evidence that rules a deterministic regression out. This is a correction to the analysis on record, not to anyone's code.
  2. The bare-wait census. Stage 3 cites "~80 bare 1 s waits … against 173 explicit". The parser-derived, cross-validated census is: base 57 bare / 196 explicit, head 55 bare / 198 explicit, total 253 unchanged. The bot's total was right; the split was not.
  3. The failure surface is not literally Timed out in waitFor!. In CI, both tests failed with the rethrown assertion of the last completed poll. Vitest throws Timed out in waitFor! only when the window expires with no completed failing poll (if (!error) error = … in the installed source); my route-delay T1 arm shows that surface, the CI log shows the other. Same mechanism, two surfaces; the PR body names only the rarer one. No code change implied.

Findings

None blocking. One observation, not for this PR:

Not covered

  • Full CI-level contention reproduction. The load arm (CPU saturation + coverage) could not push settlement past 1 s on this 10-core arm64 Mac with NVMe; a loaded shared Linux runner also has slow fsync, which this box does not emulate. The two fault-injection A/Bs are the deterministic stand-in and both behave exactly as the window model predicts.
  • SDK Java workflow's Hosted process fault gates / MySQL 8.4 / Java 21 lane is red on this PR — and on every recent main run sampled (53579861, e10728e1, 29663f87, 44ddf79e, 8515d82f, 96cfa244, 6212189f). Pre-existing, and a TS-test-only diff cannot affect it.
  • A later failure on the base commit (run 38454643347, 19:24Z) is the Windows lane failing on eight different tests (BranchPickerPopover, batch-task, config, email-channel, …) — a different flake class, not a recurrence of this issue's signature.
  • The other 55 bare vi.waitFor calls in the file (deliberately left as-is; the file-local helper the review suggests is the durable fix, correctly out of scope here).
  • Per-commit attribution: the PR's change is a single commit plus a main-merge; the effective diff was verified as a whole.

Methodology

Local maintainer-driven round on macOS (10-core arm64, 16 GB), Node v22. Three git worktrees at head / parent (5f35538e68) / CI-red (53579861) commits, each pnpm install --frozen-lockfile (+ full build at head). Internal @qwen-code/* resolution verified: cli vitest aliases core to packages/core source (vitest.config.ts), so the tests exercise the checked-out sources directly; other workspace packages resolve to their built dists per the repo's test-prerequisite guard. All harnesses are rerunnable .mjs scripts under tmp/pr14107-verify-20261014-071357/harness/, driving real npx vitest child processes with JSON-reporter oracles — no mocks of the code under test. Latency injections are env-gated scratch patches applied with unique anchors (instrument.mjs) and reverted with git status verified clean after each run. CI history and failure logs pulled read-only via gh api. Mid-round the PR head moved b51704d84f → 944b99c15a (main 163e468619 merged in: a one-line retries: 10 → 30 lockfile-config change in workspace-agents/store.ts plus a Java IT — outside these tests' exercised paths); all cells were re-measured at the new head and the superseded head's numbers discarded. Assertion ledger: 45 scripted checks executed, 45 passed, 0 unexpected failures (assertions.json, verdict.txt: merge-ready).

Evidence captures

  • 01-ab-route-delay.png — the four-arm A/B with 1.2 s route latency: base red with CI-verbatim signatures, head green.
  • 02-ab-journal-delay.png — the same A/B with 300 ms latency per fsync-backed journal commit (the PR's named mechanism).
  • 03-timing-matrix.png — replay of the timing-matrix summary (parent / CI-red / head, 12 interleaved runs each).
  • 04-gates.png — replay of the gate runs at head: reviewer-plan filter 284/284, full file 459/459, load arm 0/12.

A/B with 1.2s latency injected at the status route: base (1s window) fails with the CI signature, head (10s) holds

Same A/B with 300ms latency per fsync-backed journal commit

Timing matrix: 12 interleaved runs per commit, no failures, no duration shift between parent and the CI-red commit

Gates at head: reviewer-plan filter 284/284, full file 459/459, load arm 0/12 failures

— verification run by @wenshao (local maintainer round; harnesses, per-arm JSON reports and raw logs preserved under tmp/pr14107-verify-20261014-071357/)

@qwen-code-dev-bot

Copy link
Copy Markdown
Collaborator Author

🔀 Base updated: red check(s) [Test (ubuntu-latest, Node 22.x)] pass on current main — merged current main via update-branch; CI will re-run.

中文说明

🔀 已更新 base:红色检查 [Test (ubuntu-latest, Node 22.x)] 在当前 main 上通过 —— 已通过 update-branch 合入当前 main,CI 将重新运行。

@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.

Approving. The change is exactly what it claims: two vi.waitFor windows in hosted-harness-session.test.ts raised to an explicit 10_000, with the callback bodies and every assertion preserved — the diff is the two option objects plus two comments. That is the deflake policy's allowed fix #1 and matches the file's own dominant explicit window (10_000), so it's the right shape and the right scope.

The open question from triage — 1s-window flake vs. a product regression — resolves on this head. The PR's own Test (ubuntu-latest, Node 22.x) lane is green: Qwen Code CI run 38494457195 succeeded at head 0f3c53cd. So the state does land, just slowly, which is consistent with runner contention. Worth noting the widened window can't hide a "state never arrives" defect either: if the transition genuinely didn't happen, the unchanged expects still fail at 10s. It only tolerates slowness.

The two Java checks that show red on this head are not attributable here. Hosted process fault gates / MySQL 8.4 / Java 21 is red on main at this PR's own base 1f39a80b too (sdk-java run 38493191034), failing the same way — RuntimeBroker Workspace execution authority is unavailable across HostedPublicWorkspaceIT / HostedTeamLeadMySqlIT / HostedProcessCrashIT — and Real daemon E2E / Java 11 is a superseded cancelled job. There's no path from a TS test-only diff to those, so I'm reading them as pre-existing Java-lane state, not this PR.

Non-blocking follow-ups (not merge blockers):

  • The PR body says the failure produced Timed out in waitFor!; that string is absent from the failing log. The real signature is an AssertionError raised inside the waitFor callback (the last poll error rethrown when the 1s window expires). Same conclusion, but worth correcting if you touch the body.
  • ~80 bare vi.waitFor calls remain in this file against 173 that carry an explicit window. A file-local helper wrapping vi.waitFor with the house 10_000 would stop these one-flake-at-a-time PRs; explicitly out of scope here, just flagging the follow-up.

@qwen-code-review-bot

Copy link
Copy Markdown
Collaborator

Released in v0.25.2.

Bug-killer-prog added a commit to Bug-killer-prog/qwen-code that referenced this pull request Oct 23, 2026
`gives a read-profile Session no skill catalog from its agent definition`
polls `hasActivePrompt` through a bare `vi.waitFor`, so it inherits vitest's
1s default. On a contended ECS runner (load ~74, 52 concurrent test processes)
that second is not reachable: the poll crosses a settle path that commits a
journal entry before the active flag clears, and the case failed 3/3 attempts
inside one run at the same assertion.

Every other hosted wait in this file already carries an explicit budget — this
one was in the bare minority that `@testing-library`'s `asyncUtilTimeout`
cannot cover, because `vi.waitFor` has no equivalent global bump.

Same shape as QwenLM#14091, QwenLM#14107, QwenLM#14394 and QwenLM#13323. Nothing is asserted less: a
condition that never holds still fails, it just gets ten seconds to hold.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review/self-reported The linked issue was opened by the PR author (self-reported)

Projects

None yet

5 participants