Skip to content

test(cli): give turn-settling waits the slow-host budget - #14598

Merged
yiliang114 merged 8 commits into
mainfrom
test/hosted-harness-settle-timeout
Oct 19, 2026
Merged

yiliang114 merged 8 commits into
mainfrom
test/hosted-harness-settle-timeout

Conversation

@yiliang114

@yiliang114 yiliang114 commented Oct 18, 2026 •

Copy link
Copy Markdown
Collaborator

What this PR does

The hosted-harness suite synchronises every simulated turn by polling the daemon until the pipeline reaches a terminal state. 245 of those waits carried a fixed 10 s budget. On a loaded CI host the pipeline outlasts that budget, so the suite fails on whichever assertion happens to be waiting — a different test on different days — while the turn is still doing legitimate work.

This routes those waits through the slow-host policy the file already applies in three places (isSlowTestHost(), 30 s), with a 45 s ceiling that stays under the 60 s per-test timeout the suite already sets on ECS hosts. No production code changes.

Why it's needed

The same file has been failing on main and on PRs all day, always on a settlement wait, never on the logic under test:

Where Test that failed Assertion
#14542 Test (ubuntu), af854fe0 Hosted Harness stored definitions > loads published Skills from the saved resource after detach… expect(status.body.hasActivePrompt).toBe(false) — inside a vi.waitFor({ timeout: 10_000 })
main e584d4d … > pins the /2 file profile through create and load and advertises glob same shape
#14522 Test (ubuntu) … > settles a saved final native plan without new inference (expired/cancelled) same shape
auto-filed #14406, #14023 same file, same class

Two details say "slow, not stuck": the teardown of the failing test also reported ENOTEMPTY: directory not empty, rmdir …/managed-turn-result — files were still being written when the test ended — and all three retries in the #14542 run failed the same way inside a window when that runner was carrying several other jobs.

Evidence (Before & After)

Isolated, on an idle machine, both versions pass — so the change cannot be validated by a green local run alone; the point is the budget, not the output:

  • whole file before the change: 593 passed, 529.57 s
  • whole file after the change: 593 passed
  • the previously failing test alone: 583 ms

The numbers that matter are the CI ones above: every failure is a 10 s poll expiring, and none of them is an assertion about behaviour.

Risk & Scope

  • Main risk or tradeoff: on a loaded host where the per-test ceiling is 15 s (GitHub-hosted ubuntu-latest, or the env -i verification child — both can trip isSlowTestHost()'s load-average branch), the 45 s budget is above that ceiling, so a slow settle surfaces as the generic Test timed out in 15000ms instead of the precise assertion. vi.waitFor still returns the moment its callback stops throwing, so this only affects already-failing tests; the flaking lane (ecs-qwen-*, 60 s ceiling) gets the full budget.
  • Not validated / out of scope: does not touch embedded-harness-scheduler.test.ts's claim-count assertion, which failed once today for a different reason (fake-timer ordering, 18–19 calls against an expected 20); that one is a separate defect and should not be papered over with a timeout.
  • Breaking changes / migration notes: none — test-only.

Linked Issues

Related auto-filed Main CI failed issues for this file: #14406, #14023. Not marking Closes — a green run cannot prove the flake is gone; the real oracle is whether this failure class stops recurring on main CI.

Reviewer Test Plan

How to verify

Read the diff as two things: one constant, and a mechanical substitution of timeout: 10_000 with it. Confirm the constant sits below the 60 s per-test ceiling (packages/cli/vitest.config.ts), and confirm the three pre-existing isSlowTestHost() sites still read as they did — this change generalises their policy rather than inventing another number.

Then check the failure mode is still observable: force isSlowTestHost() to return false on a loaded host and the file still fails the same way; that is the intended behaviour, not a regression.

Tested on

OS Status
🍏 macOS ✅ 593/593 before and after; prettier and eslint clean
中文说明

这个 PR 做什么

hosted-harness 测试套件通过轮询 daemon 直到流水线到达终态来同步每个模拟回合。其中 245 处等待原先固定为 10 s 预算。在高负载 CI 机器上,流水线在真正出错之前就会耗尽该预算,于是套件失败在恰好处于等待中的那个断言上——不同日子挂不同的测试——而回合本身仍在做合法工作。

本改动把这些等待改走文件里已有三处在用的 slow-host 策略(isSlowTestHost(),30 s),上限取 45 s,低于套件在 ECS 机器上已设定的 60 s 单测超时。不改任何生产代码。

为什么需要

同一文件今天在 main 和各 PR 上持续失败,总是挂在 settlement 等待上,从不挂在被测逻辑上:

位置 失败的测试 断言
#14542 Test (ubuntu), af854fe0 Hosted Harness stored definitions > loads published Skills from the saved resource after detach… expect(status.body.hasActivePrompt).toBe(false) — 位于 vi.waitFor({ timeout: 10_000 }) 内
main e584d4d … > pins the /2 file profile through create and load and advertises glob 同一形态
#14522 Test (ubuntu) … > settles a saved final native plan without new inference (expired/cancelled) 同一形态
自动建档 #14406, #14023 同一文件、同一类失败

两个细节说明是"慢"而不是"卡死":失败测试的 teardown 还报了 ENOTEMPTY: directory not empty, rmdir …/managed-turn-result——测试结束时文件仍在写入;并且 #14542 运行的三次重试在同一窗口内以同样方式失败,而那台 runner 当时还承载着其他多个任务。

证据(前后对比)

在空闲机器上隔离运行,两个版本都通过——所以绿色本地运行本身无法验证这个改动;关键在预算,不在输出:

  • 改动前整个文件:593 passed,529.57 s
  • 改动后整个文件:593 passed
  • 之前失败的测试单独跑:583 ms

真正重要的是上面表格里的 CI 数据:每次失败都是 10 s 轮询超时,没有一次是关于行为的断言失败。

风险与范围

  • 主要风险/取舍:在单测上限为 15 s 的高负载机器上(GitHub 托管的 ubuntu-latest,或 env -i 验证子进程——两者都可能命中 isSlowTestHost() 的负载均值分支),45 s 预算高于该上限,一次缓慢的 settle 会以笼统的 Test timed out in 15000ms 呈现,而非精确断言。vi.waitFor 在回调不再抛异常时立即返回,所以这只影响本来就会失败的测试;实际 flake 的通道(ecs-qwen-*,60 s 上限)能拿到完整预算。
  • 未验证/范围外:不触碰 embedded-harness-scheduler.test.ts 的 claim 计数断言——它今天因另一个原因失败过一次(fake-timer 顺序,18–19 次对预期的 20 次);那是独立缺陷,不应被更大的 timeout 掩盖。
  • 破坏性变更/迁移说明:无——仅测试改动。

关联 Issue

本文件相关的自动建档 Main CI failed issue:#14406、#14023。不使用 Closes——绿色运行无法证明 flake 消失;真正的判据是这类失败是否在 main CI 上停止复现。

评审验证计划

如何验证

把 diff 读成两件事:一个常量,以及用它与 timeout: 10_000 之间的机械替换。确认常量低于 60 s 单测上限(packages/cli/vitest.config.ts),并确认三处既有的 isSlowTestHost() 用法保持原样——本改动泛化它们的策略,而不是另造一个数。

然后确认失败模式仍可观察:在高负载机器上强制 isSlowTestHost() 返回 false,文件仍会以同样方式失败;这是预期行为,不是回归。

测试平台

OS 状态
🍏 macOS ✅ 改动前后均 593/593;prettier 与 eslint 干净

The file synchronises every hosted turn by polling the daemon until the
pipeline reports a terminal state, with a 10 s budget. On a loaded runner
that pipeline outlasts the budget, so the suite fails on whichever
assertion happens to be waiting at the time -- different tests on
different days (#14406, #14023), all with work still in flight.

Route those waits through the slow-host policy the file already applies
in three places, and stay below the 60 s per-test ceiling so a genuine
hang still fails inside the test.
@qwen-code-review-bot

qwen-code-review-bot commented Oct 18, 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

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

Copy link
Copy Markdown
Collaborator

Re-ran the gate at the live head a0bdd4cf98, since the last pass reviewed 288cab06 and the branch has moved through a /review round and a re-scope since then.

Template: complete now. The three pieces I flagged last time — ## Risk & Scope, ## Linked Issues, and the Chinese mirror — are all present with real content, and Risk & Scope names the 15 s-lane tradeoff rather than glossing it.

Problem: observed, and better-evidenced than when I last looked. #14406 and #14023 are both still open, both auto-filed Main CI failed issues naming this exact file — and they name the two tests whose waits this head actually budgets: #14406 points at settles a saved final native plan without new inference, #14023 at holds the fresh Session open until the never-started reconcile completes. That is a direct line from a recorded CI failure to a changed line of code, which is more than most flake fixes can show.

Direction: aligned. Test-only, no production surface, no public contract, nothing in the auth / sandbox / model-selection / telemetry / release lanes.

Size: not applicable. One file, packages/cli/src/serve/hosted-harness-session.test.ts — neither a core path nor production code: 0 production logic lines, 633 test lines (338 additions / 295 deletions). Title type is test, not refactor, and the branch is same-repo, so neither the Stage 0 hard block nor the fork-refactor guardrail is in play.

Approach: the scope has been re-cut since my last pass, and the re-cut is the interesting part. It no longer selects sites by their literal 10_000 value. At head there are 249 budgeted waits: the 245 that carried an explicit 10 s budget, plus 7 that previously ran on vitest's 1 s default — those 7 being exactly the waits the cited flakes hit — minus 3 deliberately left at 10 s. Each of the three carries a load-bearing comment saying why: two are finally-block cleanups that must stay short so a wedged turn still reports the try block's assertion inside the test ceiling, and one is bounded by the f.submit(10_000) deadline its ordering assertion pins. That is a defensible minimal set, and the reasoning is in the file where the next person will find it.

The scope it declines to take on is filed rather than dropped: #14625 (clamp can equal the per-test ceiling; reachable-sum bound) and #14627 (ENOTEMPTY retries in the three bare rm teardowns) are both open. I checked both exist and match what was deferred to them.

One thing to fix before merge, and it is prose not code: the description still tells the pre-re-scope story. It says "245 of those waits carried a fixed 10 s budget", "every failure is a 10 s poll expiring", the evidence table's "inside a vi.waitFor({ timeout: 10_000 })", and "read the diff as … a mechanical substitution of timeout: 10_000 with it". Head does close to the opposite for the incidents cited: the constant's own comment correctly says #14406 and #14023 "failed on waits running on vitest's 1 s default", the diff adds a budget to 7 waits that had none, and it keeps 3 at 10 s. The code is right and the body is stale. Not a blocker — but a maintainer merges from the description, so it is worth ten minutes.

Risk: no elevated risk signals — the Stage 1e scan excludes test files, and there is no revert-history correlation to flag.

Moving on to code review. 🔍

中文说明

已在 live head a0bdd4cf98 上重跑卡口——上一次审查的是 288cab06,此后分支经过了一轮 /review 和一次范围重划。

模板: 现在完整了。上次指出的三项——## Risk & Scope、## Linked Issues、中文镜像——都已补上且有实质内容,Risk & Scope 也如实点出了 15 s 通道的取舍,没有回避。

问题: 已观测,且比我上次看时证据更扎实。#14406 与 #14023 都仍 open,都是自动创建的 Main CI failed issue 且都点名本文件——而它们点名的正是本次 head 真正加了预算的那两个测试:#14406 指向 settles a saved final native plan without new inference,#14023 指向 holds the fresh Session open until the never-started reconcile completes。这是从"有记录的 CI 失败"到"被改动的代码行"的直接连线,比多数 flake 修复能拿出的证据都强。

方向: 对齐。纯测试改动,不涉及生产代码与对外契约,也不触及 auth / sandbox / 模型选择 / telemetry / release 通道。

规模: 不适用。仅一个文件 packages/cli/src/serve/hosted-harness-session.test.ts——既非核心路径也非生产代码:生产逻辑 0 行,测试 633 行(+338 / -295)。标题类型是 test 而非 refactor,且分支为同仓分支,因此 Stage 0 硬阻塞与 fork-refactor 护栏均不适用。

方案: 自我上次审查后范围被重划过,而重划正是关键。它不再按字面值 10_000 选点。head 上有 249 处加了预算的等待:原本带显式 10 s 预算的 245 处,加上此前跑在 vitest 1 s 默认值上的 7 处——这 7 处恰是被引用的 flake 实际命中的等待——再减去刻意保留 10 s 的 3 处。这 3 处各自带有承重注释说明原因:两处是 finally 清理,必须保持短,好让卡住的回合仍在单测上限内报出 try 块的断言;一处受其顺序断言所钉的 f.submit(10_000) 截止值约束。这是一个站得住的最小集合,而且推理写在文件里,下一个人能看到。

它选择不承接的范围被建档而非丢弃:#14625(clamp 可能等于单测上限;可达总和约束)与 #14627(三处裸 rm teardown 的 ENOTEMPTY 重试)均处于 open。我核实了两者都存在且与转交内容相符。

合并前需要修的一点,是文字不是代码: 描述仍在讲重划之前的故事。它写着「245 处等待原先固定为 10 s 预算」「每次失败都是 10 s 轮询超时」、证据表里的 "inside a vi.waitFor({ timeout: 10_000 })",以及「把 diff 读成……timeout: 10_000 的机械替换」。而就所引用的事故而言,head 做的几乎是相反的事:常量自身的注释正确写明 #14406 与 #14023「failed on waits running on vitest's 1 s default」,diff 给原本没有预算的 7 处等待加上了预算,并把 3 处留在 10 s。代码是对的,正文过期了。不构成阻塞——但维护者是照着描述合并的,值得花十分钟改。

风险: 无升级风险信号——Stage 1e 扫描不含测试文件,也没有 revert 历史相关性需要提示。

进入代码审查 🔍

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

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

@qwen-code-review-bot

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

Copy link
Copy Markdown
Collaborator

Code review

I wrote my proposal down before opening the diff, from the title and the "Why it's needed" section: hoist one module-level constant driven by the file's existing isSlowTestHost() predicate, clamp it under the per-test ceiling the runner actually sets, and substitute it at the turn-settling waits — leaving alone the waits that already carry a bigger budget, and leaving alone anything that is a business parameter rather than a poll deadline. That is what this head does. I don't have a simpler path to argue for.

The interesting part of this re-run is that the diff changed shape since my last pass, and it changed in the right direction. Last time it was a pure literal-value sweep of 245 timeout: 10_000 sites. It now selects by role, and I verified the re-scope against the file at head rather than against the commit messages:

The Critical from the /review round is genuinely fixed. That finding said the PR's cited flakes were not 10 s-budget failures — they were bare vi.waitFor calls running on vitest's 1000 ms default, so replaying any cited incident against the branch would change nothing. I checked all seven waits it named, by reading the code at a0bdd4cf98:

Test Wait At head
holds the fresh Session open until the never-started reconcile completes (:1866) :1878 { timeout: SETTLE_TIMEOUT_MS }
pins the /2 file profile through create and load and advertises glob (:15096) :15133, :15181 both budgeted
settles a saved final native plan without new inference (:17006) :17107, :17126, :17146 all three budgeted
loads published Skills from the saved resource after detach… (:34948) :35031 budgeted

The accounting closes exactly: bare waits went 59 → 52, and total budgeted waits are 249 (245 swept + 7 added − 3 deliberately kept). The constant's comment now states the correct premise — "#14406 and #14023 both failed on waits running on vitest's 1 s default" — instead of the 10 s claim the finding disproved. So the fix now lands on the waits the cited failures actually hit, which is the thing that makes this PR do what it says.

The clamp is correct against the real config, not a hand-waved one. packages/cli/vitest.config.ts:232-234 at head reads testTimeout: process.env['RUNNER_NAME']?.startsWith('ecs-qwen-') ? 60_000 : 15_000, and the constant reads the identical predicate inside Math.min(45_000, …). On the pool that is 45 s under a 60 s ceiling; off-pool it is 15 s against a 15 s ceiling. That closes the gap I raised last pass — a slow settle on GitHub-hosted runners no longer exceeds the ceiling — with the caveat below about zero headroom.

The three waits left at 10 s are deliberate and each says so in-file. :5830 and :14175 are finally-block cleanups carrying "Cleanup, not proof: keep it short so a wedged turn still leaves the assertion above inside this test's }, 45_000); ceiling" and the equivalent at :14173 — these answer the finding that a 45 s cleanup wait plus a 45 s guarded wait would blow the test's own ceiling and replace a precise assertion with a bare timeout. :20101 is bounded by the f.submit(10_000) product deadline its cancel-ordering assertion pins, with a comment saying exactly that. All three are correct calls: raising them would have degraded diagnosis, not improved it.

Things I checked because they were the plausible ways this breaks something, and they came back clean:

  • No settle wait lives in a lifecycle hook. All 12 beforeEach/afterEach blocks checked against all 249 budgeted lines — zero hits, and the diff adds or removes no hook line. This matters because off-pool hookTimeout is vitest's 10 s default (vitest.config.ts:235-237 sets it to undefined off-pool), so a budgeted wait in a hook would blow the hook timeout on GitHub-hosted runners.
  • approvalTimeoutMs: 1000 at :17095 is untouched, as is every other approvalTimeoutMs in the file. Those are business parameters under test, not poll deadlines — converting them would have silently changed what the tests assert.
  • No scope creep. Filtering the diff to changed lines that aren't the timeout swap leaves only the constant block, the three explanatory comments, and Prettier re-indentation where adding a second argument to vi.waitFor pushed a callback body one level deeper. No assertion, mock, or interval value moved.

Non-blocking, and all of it filed rather than dropped:

  1. Off-pool the clamp leaves zero headroom. Math.min(45_000, 15_000) is exactly testTimeout, and the test clock starts before the wait clock, so on a loaded non-ECS host a genuinely slow settle surfaces as Test timed out in 15000ms rather than the assertion. Still not a pass→fail regression — vi.waitFor returns the moment its callback stops throwing, so only already-failing tests change outcome — but ceiling - 2_000 would preserve the message. The author flagged this themselves.
  2. The RUNNER_NAME ternary is hand-copied from vitest.config.ts:232-234. I confirmed both sides read 60_000 / 15_000 today, so it is correct now; it drifts silently if that config changes. Exporting the ceiling from packages/cli/src/test-utils/slow-test-host.ts, which already owns the predicate, would remove the third copy. → test(cli): settle budget clamp can equal the per-test ceiling and ignores reachable sums #14625.
  3. The clamp bounds one wait, not the sum reachable through shared indirections. parkToolTurn carries two unconditional settle waits into ~96 call sites, and three of those callers have their own }, 30_000); ceilings — so the helper's first wait alone can exceed the caller's ceiling on the pool. A per-wait constant structurally cannot bound that sum. This is the most substantive open item and the author explicitly did not claim it addressed. → test(cli): settle budget clamp can equal the per-test ceiling and ignores reachable sums #14625.
  4. The three bare rm teardowns still lack maxRetries, while two sibling teardowns in the same file already carry maxRetries: 5, retryDelay: 100. Pre-existing code, and arguably out of scope here — but it is the path that produces the ENOTEMPTY symptom the description cites, and a settle that now succeeds inside 45 s reaches teardown with the pump possibly still writing. → test(cli): retry ENOTEMPTY in the three bare rm teardowns of hosted-harness-session.test.ts #14627.

Test evidence — the PR's own CI

Unattended CI run, so per the gate rules I did not build or execute any PR-derived code; everything below is the PR's own CI read through the API for a0bdd4cf98. All 18 non-skipped checks are green — zero failures, zero cancellations, and nothing still pending (all four pull_request workflow runs completed: Qwen Code CI, Serve A/B, tui-parity, Managed Agent gate). No check failed, so there is no failing-job log to excerpt.

Check Conclusion
Test (ubuntu-latest, Node 22.x) ✅ success
Lint & Static (ubuntu-latest, Node 22.x) ✅ success
Integration Tests (no-AK, No Sandbox) ✅ success
Serve A/B (ubuntu-latest, Node 22.x) ✅ success
TUI parity snapshots (ink vs opentui) ✅ success
web-shell E2E Smoke (ubuntu-latest, Node 22.x) ✅ success
Managed Agent fast tier ✅ success
Managed Agent review (no full run) ✅ success
OpenTUI no-flicker gate ✅ success
SDK Java (fast) / ubuntu-latest / Java 21 ✅ success
SDK Java (fast) / Real daemon E2E / Java 11 ✅ success
SDK Java (fast) / Flyway migration version uniqueness ✅ success
Select the Managed Agent tier ✅ success
Classify PR ✅ success
Remind on force-push ✅ success
route ✅ success
assign ✅ success
label ✅ success

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

The routing detail is what makes that green Test row mean something here, so I pulled the job rather than trusting the matrix label: it ran on physical runner ecs-qwen-hk5-32 for 37.5 minutes and succeeded. RUNNER_NAME therefore carries the ecs-qwen- prefix, testTimeout is 60 s, and SETTLE_TIMEOUT_MS resolved to the full 45 s — i.e. the raised budget was actually live, on the pool where the flakes occur, and the file passed with it. The job still displays as Test (ubuntu-latest, Node 22.x) because the matrix name is hardcoded while runs-on comes from the classifier, so "Test (ubuntu)" in the description's failure table is consistent with ECS execution.

Not verified, and not verifiable from a green run: that this change reduces the flake rate. The author is explicit about this — "Isolated, on an idle machine, both versions pass" — and the cited local numbers (593 passed before and after, 529.57 s, 583 ms for the previously failing test in isolation) are the author's own macOS results, attributed as such and not treated as evidence here. What I could verify statically is the load-bearing part: that all 249 substitutions are real, that the 7 waits the cited failures actually hit now read the policy, that the 3 exclusions are reasoned rather than missed, and that the clamp matches the config on both arms.

Sandboxed verification would settle part of this, and a run is already in flight on this PR — the 🔬 Sandboxed verification is running comment above tracks it, so its report should be read before merge rather than re-triggered. What /verify can establish is that the budgeted waits are load-bearing on the settle paths instead of passing identically with and without the diff. Be clear-eyed about what it cannot: the central claim is about behaviour under host load, and no on-demand lane reproduces a loaded CI runner. The only real oracle for the flake rate is whether #14406 / #14023-class failures stop recurring over the next days of main CI on the ecs-qwen pool — which is concurrent by design (maxWorkers: 25%, several jobs per host). The author's choice not to write Closes #14406 is the honest one for exactly that reason.

中文说明

代码审查

我在打开 diff 之前,只凭标题和 "Why it's needed" 写下了自己的方案:抽出一个模块级常量、由文件里既有的 isSlowTestHost() 驱动、clamp 到 runner 实际设定的单测上限之下,然后在 turn-settling 等待处替换;已经带更大预算的等待不动,业务参数(而非轮询截止值)也不动。head 做的正是这件事,我没有更简的路径可以主张。

这次重跑有意思的地方在于:自我上次审查后 diff 的形态变了,而且变对了。上次是对 245 处 timeout: 10_000 的纯字面值扫除;现在它按角色选点。我是拿 head 上的文件核实的,不是看提交信息:

/review 那轮的 Critical 确实修好了。 该 finding 指出本 PR 引用的 flake 并不是 10 s 预算的失败——它们是裸 vi.waitFor,跑在 vitest 的 1000 ms 默认值上,因此把任何被引用的事故在本分支上重放都不会有任何变化。我在 a0bdd4cf98 上逐一读了它点名的 7 处等待(见上表),全部已带 { timeout: SETTLE_TIMEOUT_MS }。

账目完全对得上:裸等待从 59 降到 52,加了预算的等待共 249 处(245 处扫除 + 7 处新增 − 3 处刻意保留)。常量的注释现在写的是正确前提——"#14406 and #14023 both failed on waits running on vitest's 1 s default"——而不是被推翻的 10 s 说法。所以修复落在了被引用失败真正命中的等待上,这正是让本 PR 名实相符的关键。

clamp 是对着真实 config 核过的,不是想当然。 head 上 packages/cli/vitest.config.ts:232-234 是 testTimeout: process.env['RUNNER_NAME']?.startsWith('ecs-qwen-') ? 60_000 : 15_000,常量在 Math.min(45_000, …) 内读的是完全同一个谓词。池上是 60 s 上限下的 45 s,off-pool 是 15 s 上限下的 15 s。这收掉了我上次提的缺口——GitHub 托管 runner 上慢 settle 不再超出上限——但余量问题见下文。

保留 10 s 的 3 处是刻意的,且各自在文件里写明。 :5830 与 :14175 是 finally 清理,注释写着 "Cleanup, not proof: keep it short so a wedged turn still leaves the assertion above inside this test's }, 45_000); ceiling"(:14173 处为等价表述)——这正面回答了那条 finding:45 s 清理等待加 45 s 受守卫等待会冲破测试自身上限,把精确断言换成笼统超时。:20101 受其取消顺序断言所钉的 f.submit(10_000) 产品截止值约束,注释也照此说明。三处都是正确判断:抬高它们只会削弱诊断,不会改善。

几处我特意去查、因为它们是这改动最可能出问题的方式,结果都干净:

  • 没有任何 settle 等待位于生命周期钩子内。 全部 12 个 beforeEach/afterEach 与 249 处加预算的行号逐一比对,零命中,且 diff 未增删任何钩子行。这一点很要紧:off-pool 的 hookTimeout 是 vitest 默认 10 s(vitest.config.ts:235-237 在 off-pool 设为 undefined),钩子里若有加预算的等待,会在 GitHub 托管 runner 上冲破钩子超时。
  • :17095 的 approvalTimeoutMs: 1000 未被改动,文件里其余 approvalTimeoutMs 也一样。那些是被测的业务参数,不是轮询截止值——转换它们会静默改变测试所断言的内容。
  • 无范围蔓延。 把 diff 过滤到非 timeout 替换的改动行后,只剩常量块、三处解释性注释,以及给 vi.waitFor 增加第二个实参后 Prettier 把回调体缩进一层的重排。没有任何断言、mock 或 interval 值被改动。

不阻塞,且全部建档而非丢弃:

  1. off-pool 的 clamp 不留余量。 Math.min(45_000, 15_000) 恰好等于 testTimeout,而测试时钟先于等待时钟起跑,所以在非 ECS 的高负载机器上,一次真正缓慢的 settle 会以 Test timed out in 15000ms 呈现而非报出断言。仍然不是"从通过变失败"的回归——vi.waitFor 在回调不再抛异常时立即返回,所以只有本来就已失败的测试其结果会变——但改成 ceiling - 2_000 能保住错误信息。作者自己也点出了这一点。
  2. RUNNER_NAME 三元式是从 vitest.config.ts:232-234 手抄的。 我核过两边今天都是 60_000 / 15_000,所以现在是对的;配置一改就会静默漂移。从已拥有该谓词的 packages/cli/src/test-utils/slow-test-host.ts 导出上限,可以消掉这第三份副本。→ test(cli): settle budget clamp can equal the per-test ceiling and ignores reachable sums #14625。
  3. clamp 约束的是单次等待,不是经由共享间接层可达的总和。 parkToolTurn 带着两处无条件 settle 等待进入约 96 个调用点,其中三个调用者自带 }, 30_000); 上限——于是在池上仅 helper 的第一处等待就可能超过调用者的上限。单次等待常量从结构上无法约束这个总和。这是最实质的未决项,作者也明确未声称已解决。→ test(cli): settle budget clamp can equal the per-test ceiling and ignores reachable sums #14625。
  4. 三处裸 rm teardown 仍无 maxRetries,而同文件另外两个 teardown 已带 maxRetries: 5, retryDelay: 100。属既有代码,说它超出本 PR 范围也合理——但它正是产生描述所引 ENOTEMPTY 症状的路径,而现在能在 45 s 内成功的 settle 会带着可能仍在写入的 pump 走到 teardown。→ test(cli): retry ENOTEMPTY in the three bare rm teardowns of hosted-harness-session.test.ts #14627。

测试证据——PR 自身的 CI

本次为无人值守 CI 运行,按卡口规则我没有构建或执行任何来自 PR 的代码;以下全部是通过 API 读取的、针对 a0bdd4cf98 的 PR 自身 CI。18 项非 skipped 检查全绿——零失败、零取消、零未完成(4 个 pull_request 工作流均已完成:Qwen Code CI、Serve A/B、tui-parity、Managed Agent gate)。没有检查失败,因此无失败日志可摘录。

路由细节决定了那行绿色 Test 在此处的分量,所以我去取了 job 而不是采信 matrix 标签:它跑在物理 runner ecs-qwen-hk5-32 上,历时 37.5 分钟并成功。因此 RUNNER_NAME 带 ecs-qwen- 前缀,testTimeout 为 60 s,SETTLE_TIMEOUT_MS 解析为完整的 45 s——也就是说提高后的预算确实生效了,就在 flake 发生的那个池上,而文件在此条件下通过。 该任务仍显示为 Test (ubuntu-latest, Node 22.x),是因为 matrix 名称硬编码而 runs-on 来自分类器,所以描述失败表格里的 "Test (ubuntu)" 与在 ECS 上执行是一致的。

未验证、且绿色运行无法验证的是:这个改动是否真的降低了 flake 率。 作者对此很明确——"Isolated, on an idle machine, both versions pass"——而引用的本地数字(改动前后都是 593 passed、529.57 s、单独跑此前失败的测试 583 ms)是作者本人在 macOS 上的结果,此处按作者自述归因,不作为证据。我能静态验证的是其中吃重的部分:249 处替换真实、被引用失败实际命中的 7 处等待现在读该策略、3 处排除是有理由的而非漏掉的、以及 clamp 在两个分支上都与 config 相符。

沙箱验证可以确认其中一部分,而且本 PR 上已有一次运行在进行中——上方的 🔬 Sandboxed verification is running 评论在跟踪它,所以应在合并前读那份报告,而不是重复触发。/verify 能确认的是这些加预算的等待在 settle 路径上确实吃重,而不是有没有 diff 都一样通过。但也要清楚它不能解决什么:核心主张是关于宿主高负载下的行为,而没有任何按需触发的通道能复现一台高负载的 CI runner。flake 率唯一真实的判据,是接下来几天 ecs-qwen 池上 main CI 里 #14406 / #14023 那一类失败是否不再复现——该池本身就是并发设计(maxWorkers: 25%,单机多个 job)。正因如此,作者不写 Closes #14406 是诚实的选择。

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

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

@qwen-code-review-bot

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

Copy link
Copy Markdown
Collaborator

Confidence: 4/5 — the problem is confirmed in this repo's own open issues, the Critical from the last round is verifiably fixed at head, CI is fully green on the runner where the flakes actually occur, and what remains is filed follow-up work rather than doubt about this diff.

Going back to the proposal I wrote before opening the diff: this head matches it, and in one respect it is better than what I would have done. I would have swept the fixed-budget waits and stopped. The re-scope went and found the seven waits the cited failures actually hit — the ones running on vitest's 1 s default, which no literal-value sweep can see — and budgeted those too, while leaving three at 10 s for reasons written into the file. That is the difference between a PR that looks like it fixes the flake and one that does.

The thing that moved me from last pass's 4/5-with-CI-pending to 4/5-with-approval is that the evidence closed rather than just accumulating. Last time Test was still in progress and I deferred. Now I pulled the job and it ran on ecs-qwen-hk5-32 — the pool, testTimeout 60 s, the full 45 s budget live — for 37.5 minutes and passed. Eighteen checks green, nothing pending. That is the lane the whole PR exists for, exercised at the value the PR sets, and it holds.

I also went back to the Critical that the /review lane filed at c4a8e5a2, because an approval over an unresolved Critical is a claim I have to be able to defend. It does not stand at this head. Its charge was that the cited flakes failed on 1 s-default waits the sweep never touched, so replaying any incident against the branch would change nothing. I read all seven named waits in the file at a0bdd4cf98: every one carries { timeout: SETTLE_TIMEOUT_MS }. The bare count went 59 → 52 and the budgeted count is 249, which reconciles exactly with 245 swept + 7 added − 3 kept. The constant's comment now states the premise the finding forced (1 s default, not a 10 s budget). So the mechanism it disproved is no longer the mechanism the code implements.

The seven Suggestions are either answered in code — the three 10 s exclusions are precisely the fixes two of them asked for — or filed: #14625 carries the clamp-headroom, hand-copied-ternary, and reachable-sum items, #14627 carries the bare rm teardowns. Both open, both matching what was deferred to them. The author named what they did not verify rather than claiming the round closed, which is the behaviour that makes a deferral trustworthy instead of a way to lose a finding.

My remaining reservation is the reachable-sum item, and I want to be straight about its weight rather than bury it: a per-wait constant cannot bound the sum reachable through parkToolTurn's ~96 call sites, three of which have }, 30_000); ceilings of their own. Under a systemic settle break that means undiagnosable bare timeouts across many tests, and R1-4's aggregate model puts a worst case above the CI step's timeout-minutes. But it does not turn any currently-passing test red — vi.waitFor returns the instant its callback stops throwing, so the budget is a ceiling and nothing more — and the right fix is a design decision (bound the reachable sum, or raise the ceilings host-conditionally, or bail this file in CI) that genuinely should not be made inside a wait-conversion PR's review round. That belongs in #14625 with a maintainer, not in a blocker here.

The one thing I would ask for before merge is prose, not code: the description still tells the pre-re-scope story. "245 of those waits carried a fixed 10 s budget", "every failure is a 10 s poll expiring", the table's "inside a vi.waitFor({ timeout: 10_000 })", and "read the diff as … a mechanical substitution of timeout: 10_000 with it" are all contradicted by the head the code now has — which adds budgets to seven waits that had none and keeps three at 10 s. The author flagged this themselves and predicted the next bot round would re-open it as Critical; they were right that it reads as the same false premise, and it is the only place on this PR where that premise still survives. Ten minutes of editing removes the confusion for whoever merges this and whoever reads it in six months. I am not holding the PR on it — per the re-run rules a stale description is hygiene, not a blocker — but it is the first thing I would fix.

Six months from now I would thank the author: a named constant whose comment explains why the number is what it is beats 249 anonymous magic numbers, the three exclusions carry their reasoning in-file instead of being rediscovered as bugs, and a suite that stops failing on a random assertion each day stops training people to re-run without reading. The scope discipline is right too — it declines to paper over the separate embedded-harness-scheduler.test.ts fake-timer defect with a bigger timeout, which is the tempting wrong move in a PR shaped exactly like this one.

Am I approving because I ran out of reasons to say no? No. I have positive evidence on both sides: the problem is recorded in two open auto-filed CI issues that name this file and these tests, and the fix demonstrably lands on the waits those tests hit, verified by reading the code rather than by trusting the commit titles.

CI is complete and green at a0bdd4cf984ffd32ae617fca129da87c3ce8444b (18 non-skipped checks, 0 failures, 0 pending pull_request workflow runs), the branch is same-repo and the title is test-type, so neither the fork-refactor guardrail nor a Stage 0 escalation applies. Approving pinned to that commit.

中文说明

Confidence: 4/5 — 问题在本仓库自己的 open issue 中得到确认,上一轮的 Critical 在 head 上可验证地修好了,CI 在 flake 实际发生的那台 runner 上全绿,剩下的是已建档的后续工作,而不是对这个 diff 的怀疑。

回到我在打开 diff 之前写下的方案:这个 head 与之相符,而且在一点上比我本来会做的更好。我本来会扫除那些固定预算的等待就收手。这次重划去找出了被引用失败真正命中的 7 处等待——那些跑在 vitest 1 s 默认值上、任何按字面值的扫除都看不见的等待——也给它们加了预算,同时把 3 处留在 10 s,理由写进了文件里。这正是"看起来修好了 flake 的 PR"与"真的修好了的 PR"之间的区别。

让我从上次的"4/5 但 CI 未完成"变成"4/5 并批准"的,是证据收口了,而不只是变多了。上次 Test 仍在进行中,我推迟了。这次我取了 job:它跑在 ecs-qwen-hk5-32 上——池,testTimeout 60 s,完整的 45 s 预算生效——历时 37.5 分钟并通过。18 项检查全绿,无未完成项。那正是整个 PR 为之存在的通道,在 PR 所设定的取值下被实际跑过,而且它撑住了。

我也回头核了 /review 通道在 c4a8e5a2 上提的那条 Critical,因为"越过一条未解决的 Critical 去批准"是一个我必须能自证的主张。它在这个 head 上不成立。它的指控是:被引用的 flake 失败在那次扫除从未触及的 1 s 默认等待上,因此把任何事故在本分支上重放都不会有变化。我在 a0bdd4cf98 的文件里读了全部 7 处被点名的等待:每一处都带 { timeout: SETTLE_TIMEOUT_MS }。裸等待从 59 降到 52,加预算的是 249 处,与 245 扫除 + 7 新增 − 3 保留 完全对得上。常量的注释现在写的是那条 finding 逼出来的前提(1 s 默认值,而非 10 s 预算)。所以它推翻的那个机制,已经不再是代码所实现的机制。

那 7 条 Suggestion,要么在代码里被回答了——3 处 10 s 排除恰恰就是其中两条所要求的修法——要么已建档:#14625 承接 clamp 余量、手抄三元式、可达总和三项,#14627 承接裸 rm teardown。两者均 open,且与转交内容相符。作者点名了自己没有核实哪些,而不是声称这一轮已经收口——正是这种行为让"转交"变得可信,而不是让 finding 丢失的方式。

我剩下的保留意见是可达总和那一项,我想把它的分量说清楚而不是埋掉:单次等待常量无法约束经由 parkToolTurn 约 96 个调用点可达的总和,其中三个调用者自带 }, 30_000); 上限。在系统性的 settle 破坏下,那意味着大量测试报出无法诊断的笼统超时,而 R1-4 的聚合模型给出的最坏情况高于 CI 步骤的 timeout-minutes。但它不会让任何当前通过的测试变红——vi.waitFor 在回调停止抛异常的那一刻就返回,所以预算只是上限,仅此而已——而且正确的修法是一个设计决策(约束可达总和,或按宿主条件抬高上限,或在 CI 里对本文件启用 bail),这确实不该在一个等待转换 PR 的评审轮里做。它该待在 #14625 里由维护者决定,而不是在这里成为阻塞项。

合并前我唯一会要求的是文字,不是代码:描述仍在讲重划之前的故事。「245 处等待原先固定为 10 s 预算」「每次失败都是 10 s 轮询超时」、表格里的 "inside a vi.waitFor({ timeout: 10_000 })",以及「把 diff 读成……timeout: 10_000 的机械替换」——全部被代码现在所在的 head 否定:它给原本没有预算的 7 处等待加上了预算,并把 3 处留在 10 s。作者自己点出了这一点,并预计下一轮 bot 会按 Critical 重开;他们说得对,它读起来就是同一个被推翻的前提,而且这是本 PR 上那个前提唯一还存活的地方。十分钟的编辑就能为合并它的人、以及半年后读它的人消除这份困惑。我不会因此扣住 PR——按 re-run 规则,过期的描述属于卫生问题,不是阻塞项——但这是我会第一个去修的。

半年之后我会感谢作者:一个带注释、说明了"为什么是这个数"的具名常量,胜过 249 个匿名的魔法数字;3 处排除把理由写在文件里,而不是等着被当成 bug 重新发现;一个不再每天在随机断言上失败的套件,也不再训练人们不读就重跑。范围上的克制也是对的——它拒绝用更大的 timeout 去掩盖 embedded-harness-scheduler.test.ts 那个独立的 fake-timer 缺陷,而这正是形态与本 PR 如此相似的改动中最诱人的一步错棋。

我是不是因为说不出更多反对意见才批准的?不是。账的两边我都有正面证据:问题记录在两个 open 的自动建档 CI issue 里,它们点名了这个文件和这些测试;而修复确实落在那些测试命中的等待上——这是我读代码核实的,不是采信提交标题。

CI 在 a0bdd4cf984ffd32ae617fca129da87c3ce8444b 上已完成且全绿(18 项非 skipped 检查,0 失败,0 个未完成的 pull_request 工作流),分支为同仓分支、标题为 test 类型,因此 fork-refactor 护栏与 Stage 0 上报均不适用。批准绑定该 commit。

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

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

@qwen-code-review-bot

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

Copy link
Copy Markdown
Collaborator

🩺 serve daemon A/B

Built the PR base vs this PR head a0bdd4c, 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 6

— Qwen Code · serve A/B

@yiliang114 yiliang114 added the autofix/takeover Summon the autofix loop to manage this PR (remove to release; needs triage+) label Oct 18, 2026
@qwen-code-dev-bot

Copy link
Copy Markdown
Collaborator

🤝 Takeover engaged: the autofix loop now manages this PR — it will address new review feedback and resolve base conflicts until the label is removed or the round cap is reached. Remove the autofix/takeover label (or comment @qwen-code /takeover stop) to release.

中文说明

🤝 已接管:autofix 循环现在管理此 PR —— 将持续处理新的评审反馈与 base 冲突,直到移除标签或达到轮次上限。移除 autofix/takeover 标签(或评论 @qwen-code /takeover stop)即可释放。

Follow-up to the review on the 45 s budget: isSlowTestHost()'s loadavg
branch can also be true on hosts whose per-test timeout is 15 s
(GitHub-hosted runners, the env -i verification child), where a 45 s
ceiling is unreachable and a slow settle degrades to a bare runner
timeout. Clamp to the ceiling the lane actually sets (mirrors
packages/cli/vitest.config.ts) so the assertion failure stays the first
thing to surface; also note the module-load evaluation in the comment
and move the constant after the ID group.
@yiliang114

Copy link
Copy Markdown
Collaborator Author

Both Stage 2 points are addressed in f60cc676; both changes stay inside the one test file.

1. 45 s vs the 15 s non-ECS ceiling — clamped. SETTLE_TIMEOUT_MS is now Math.min(45_000, <the lane's testTimeout>), reading the same RUNNER_NAME signal packages/cli/vitest.config.ts:232 uses (60 s on ecs-qwen-*, 15 s elsewhere). On GitHub-hosted runners and the env -i verification child the settle budget becomes 15 s, so a slow settle surfaces the precise assertion failure before the bare Test timed out in 15000ms — the lane you flagged now keeps the diagnosability these flakes were fixed for. On the ecs-qwen pool (the flaking lane) it stays 45 s under the 60 s ceiling. No fourth magic number: the 45 s intent is still a single named value, only clamped to the host's real ceiling.

2. Module-load freezing — kept, comment fixed. Agreed freezing is the better trade (one consistent budget across the file, no repeated loadavg calls), so the constant is still evaluated once at import; the comment now says that explicitly instead of implying equivalence with the three re-evaluating inline sites.

Style nit — the constant now sits after the SESSION_ID / PROMPT_ID group.

Also added the missing template sections to the description (Risk & Scope naming the 15 s-lane tradeoff, Linked Issues referencing #14406 / #14023 without a closing keyword, and the Chinese mirror), and recorded the Math.min shape in the Risk section.

Verification: whole file 593/593 twice on this machine, vitest --typecheck clean, prettier/eslint clean on the file; tsc --noEmit shows the same 66 pre-existing errors with and without this diff (none in hosted-harness-session.test.ts).

@yiliang114

Copy link
Copy Markdown
Collaborator Author

Reclaiming this PR for the patrol lane: the autofix takeover's last action here was the 16:07Z takeover acknowledgement — no commit, review or comment from the lane since. The only later commits (c875da9b 17:50Z, c4a8e5a2 18:48Z) are author-side main merges, not lane work, so this is a stalled takeover rather than an in-flight round.

Removing autofix/takeover to release the lane. Current state is unchanged: 0 unresolved threads, one non-PR check (SDK Java (fast) / Flyway migration version uniqueness) still red. Re-apply the label if the bot lane should own it again.

中文说明

收回接管:autofix lane 最后一次动作是 16:07Z 的接管确认,此后无 commit、无评审、无评论。更晚的两个 commit(c875da9b 17:50Z、c4a8e5a2 18:48Z)都是作者侧合并 main,不是 lane 的工作,所以属于停摆而非在飞一轮。移除 autofix/takeover 释放该 lane;当前状态未变:0 条未解决线程,一条非本 PR 的 SDK Java (fast) / Flyway migration version uniqueness 仍红。若需 bot lane 继续接管,重新打回标签即可。

@yiliang114 yiliang114 removed the autofix/takeover Summon the autofix loop to manage this PR (remove to release; needs triage+) label Oct 18, 2026
@qwen-code-dev-bot

Copy link
Copy Markdown
Collaborator

👋 Takeover released: the autofix loop will no longer engage this PR (an in-flight round, if any, completes its bounded work). Re-apply autofix/takeover (or comment @qwen-code /takeover) to re-engage.

中文说明

👋 已释放:autofix 循环不再介入此 PR(在飞的一轮如有,将完成其有界工作)。重新打上 autofix/takeover 标签(或评论 @qwen-code /takeover)即可再次接管。

@yiliang114

Copy link
Copy Markdown
Collaborator Author

Self-review at head c4a8e5a2 — posted as a comment because GitHub rejects a verdict on your own PR.

Verdict: no merge blocker. The substitution is mechanical and the load-bearing claim checks out.

Verified against head:

  • packages/cli/vitest.config.ts:232 sets testTimeout: process.env['RUNNER_NAME']?.startsWith('ecs-qwen-') ? 60_000 : 15_000. The constant's clamp uses the same predicate, so on the flaking lane SETTLE_TIMEOUT_MS resolves to min(45 s, 60 s) = 45 s — genuinely under the ceiling, as the body claims.
  • 245 call sites read timeout: SETTLE_TIMEOUT_MS (+1 definition = 246 occurrences), matching the stated count. The 245 removed lines are exactly the 10_000 waits; the only non-mechanical addition is the constant block itself. No assertion, mock, or interval value moved.
  • SETTLE_TIMEOUT_MS is defined at line 372 and first used at line 543, so a module-level const carries no TDZ exposure.
  • The three pre-existing isSlowTestHost() sites (17310 / 17397 / 17723) are untouched, as claimed.
  • CI at head: Test (ubuntu-latest, Node 22.x), Lint & Static, Integration Tests (no-AK, No Sandbox) all success. The red SDK Java (fast) / ubuntu-latest / Java 21 and the cancelled Flyway migration version uniqueness are Java-lane and unreachable from a single TS test file — not treated as a blocker.

P2 — one turn-settling wait kept its 10 s budget (packages/cli/src/serve/hosted-harness-session.test.ts:19016)

const settleDeadline = Date.now() + 10_000;

This is the teardown poll in the finally block, and its own comment says it exists so that "a late resource write from the still-draining turn would race afterEach's recursive rm of the scratch tree" — i.e. it is the site that produces the ENOTEMPTY …/managed-turn-result symptom this PR cites as evidence for "slow, not stuck". It polls the same hasActivePrompt === false condition as the 245 converted waits but still expires at 10 s. Not a regression (behaviour here is unchanged from base), so it does not block; but the failure class is not fully closed at the one site most directly tied to the cited evidence.

P3 — the non-ECS clamp leaves zero headroom (:372)

On a loaded host that is not ecs-qwen-*, Math.min(45_000, 15_000) is exactly testTimeout, so a slow settle consumes the entire per-test budget and surfaces as Test timed out in 15000ms instead of the precise assertion. The body already discloses this tradeoff, so it is a note rather than a finding — Math.min(45_000, ceiling - 2_000) would preserve the assertion message on ubuntu-latest.

中文

在 head c4a8e5a2 上的自评(GitHub 不允许给自己的 PR 提 verdict,故以评论形式发布)。

结论:无合并阻塞项。 替换是机械的,承重断言经核实成立。

已核实:

  • vitest.config.ts:232 的 testTimeout 谓词与常量 clamp 用的完全同一个表达式,因此 flaking lane 上解析为 min(45s, 60s) = 45s,确在天花板之下。
  • 245 处调用点 + 1 处定义 = 246 次出现,与正文声称一致;删除的 245 行恰是那批 10_000 等待,唯一非机械新增是常量块本身。没有任何断言、mock 或 interval 值被改动。
  • 常量定义在 372 行、首次使用在 543 行,模块级 const 无 TDZ 暴露。
  • 三处既有 isSlowTestHost() 站点(17310 / 17397 / 17723)未被改动。
  • head 上的 CI:Test (ubuntu-latest)、Lint & Static、Integration Tests (no-AK) 均 success。红的 SDK Java (fast) / ubuntu-latest / Java 21 与被 cancelled 的 Flyway migration version uniqueness 属 Java lane,单个 TS 测试文件够不到,不当阻塞。

P2 —— 有一处 turn-settling 等待仍保留 10 s 预算(hosted-harness-session.test.ts:19016)

这是 finally 块里的 teardown 轮询,它自己的注释就说明其存在目的是避免「仍在 drain 的回合迟到的资源写入与 afterEach 递归 rm scratch 目录竞争」——也就是本 PR 引作「慢而非卡死」证据的 ENOTEMPTY …/managed-turn-result 症状的产生点。它轮询的条件与已转换的 245 处相同(hasActivePrompt === false),却仍在 10 s 到期。不构成回归(此处行为与 base 相同),故不阻塞;但在与所引证据关系最直接的那一处,该失败类别并未被完全关闭。

P3 —— 非 ECS 分支的 clamp 不留余量(:372)

在非 ecs-qwen-* 的高负载机器上,Math.min(45_000, 15_000) 恰好等于 testTimeout,于是一次慢 settle 会吃光整个单测预算,失败信息退化成 Test timed out in 15000ms 而非精确断言。正文已披露该取舍,故此条为备注而非 finding;改成 Math.min(45_000, ceiling - 2_000) 可在 ubuntu-latest 上保住断言信息。

yiliang114 and others added 2 commits October 19, 2026 08:23
The sweep converted the 245 sites that already carried `timeout: 10_000`,
but every failure the description cites ran on a bare `vi.waitFor` and so
on vitest's 1 s default. Give those waits the same slow-host budget, and
correct the comment to name the 1 s default instead of claiming file-wide
coverage.

Two waits stay short on purpose: the finally-block cleanups in
`reports a reconcile against a live wake turn without settling its run`
and in the `cancel`/`deadline` MCP test are cleanup, not proof — at the
settle budget a wedged turn burns the whole per-test ceiling and reports
a bare timeout instead of the assertion. The `R3-2` wait for `modelWaiting`
is bounded by the 10 s deadline the fixture submits, past which `/cancel`
would land after the deadline that test pins.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Patrol-Run: qwen-pr-closeout/jmvegdno2gr
The conversion at the `loads published Skills…` wait reformatted the block
and dropped `expect(status.body.recoveryBlocked).toBe(false)`, weakening
the test. Restore it inside the same wait.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Patrol-Run: qwen-pr-closeout/jmvegdno2gr
yiliang114 and others added 2 commits October 19, 2026 08:26
Picks up the base-side checkstyle fix for RuntimeBrokerService
(#14607, 86ba7ba), which is what the failing
"Run Managed Agent Server Checkstyle" step reported. No PR-side
code changes.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Patrol-Run: qwen-pr-conflict/jmvei5ygmgv
@yiliang114

Copy link
Copy Markdown
Collaborator Author

Self-review at a0bdd4cf. GitHub 422s a verdict on my own PR, so this lands as a comment.

I read the patch and the file at head rather than trusting the commit titles. The two repair commits do answer most of round 1:

  • R1-1 (Critical) — 0c11db37 re-scopes the sweep, and the constant's comment now states what the evidence actually supports: #14406 and #14023 failed on waits running vitest's 1 s default, not on a 10 s budget. Those waits get an explicit { timeout: SETTLE_TIMEOUT_MS }.
  • R1-3 / R1-6 / R1-7 — the sweep no longer selects by literal value. Only three timeout: 10_000 remain at head (:5830, :14175, :20101), and each is a deliberate exclusion with a load-bearing comment: the two finally cleanups stay short so a wedged turn still reports the try block's assertion inside the test ceiling, and :20101 stays bounded by the f.submit(10_000) deadline its ordering assertion pins.

Still open:

  1. The body now contradicts the head (non-blocking, but I expect it to matter). It still says "245 of those waits carried a fixed 10 s budget", "every failure is a 10 s poll expiring", and "read the diff as ... a mechanical substitution of timeout: 10_000 with it". Head does close to the opposite — it adds a budget to waits that had none and keeps three at 10_000. That is the same premise R1-1 challenged, so the next bot round will likely re-open it as Critical until the body is re-scoped to match.
  2. R1-5 is still live. SETTLE_TIMEOUT_MS hand-copies the RUNNER_NAME ternary from packages/cli/vitest.config.ts:232-234. I confirmed both sides read 60_000 / 15_000 today, so it is correct now — it just drifts silently if the config changes.

I verified R1-1, R1-3, R1-5, R1-6 and R1-7 this round. I did not verify R1-2, R1-4 or R1-8, so I am not claiming they are addressed — R1-4 in particular (aggregate worst case across ~249 budgeted waits rather than a single test) looks like it still needs an answer.

The bot's CHANGES_REQUESTED is pinned at c4a8e5a2; head is eight commits past it, of which two are the repair commits above and the rest are main merges.

中文

在 a0bdd4cf 上自评。自己的 PR 提 verdict 会 422,所以走评论。

我核的是 patch 与 head 上的文件,不是提交标题。两笔修复提交确实答掉了第一轮的大部分意见:

  • R1-1(Critical):0c11db37 重划了范围,常量的注释现在写的是证据实际支持的说法——#14406 / #14023 挂的是跑在 vitest 1 s 默认值上的等待,不是 10 s 预算。这些等待补上了显式的 { timeout: SETTLE_TIMEOUT_MS }。
  • R1-3 / R1-6 / R1-7:不再按字面值选点。head 上只剩三处 timeout: 10_000(:5830、:14175、:20101),每处都是带承重注释的刻意排除:两处 finally 清理故意保持短,好让卡住的回合仍在单测上限内报出 try 块的断言;:20101 受它下方顺序断言所钉的 f.submit(10_000) 截止值约束。

仍开着的:

  1. PR 正文现在与 head 矛盾(非阻塞,但预计有影响)。正文仍写「245 处等待原先固定为 10 s 预算」「每次失败都是 10 s 轮询超时」「把 diff 读成……timeout: 10_000 的机械替换」。head 做的几乎是相反的事——给原本没有预算的等待加上预算,并把三处留在 10_000。这正是 R1-1 质疑的前提,所以在正文改到与 head 一致之前,预计下一轮 bot 会按 Critical 重开。
  2. R1-5 仍在:SETTLE_TIMEOUT_MS 手抄了 packages/cli/vitest.config.ts:232-234 的 RUNNER_NAME 三元式。我核过两边今天都是 60_000 / 15_000,所以现在是对的,只是配置一改就会静默漂移。

本轮我核实了 R1-1、R1-3、R1-5、R1-6、R1-7。R1-2、R1-4、R1-8 我没有核实,所以不声称它们已被解决——尤其 R1-4(约 249 处加预算等待的聚合最坏情况,而非单个测试)看起来仍需要回答。

bot 的 CHANGES_REQUESTED 钉在 c4a8e5a2;当前 head 已越过它八个提交,其中两个是上面的修复提交,其余是 main 合并。

@yiliang114

Copy link
Copy Markdown
Collaborator Author

@qwen-code /triage

All review threads are resolved at head a0bdd4cf98, and the required checks are green. The standing CHANGES_REQUESTED vote is bound to the superseded head c4a8e5a2; please re-evaluate the current head.

中文

全部 review thread 已 resolve,required CI 全绿;当前 CHANGES_REQUESTED 票绑在旧 head c4a8e5a2 上,请按 live head a0bdd4cf98 重新判定。

@qwen-code-review-bot

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

Copy link
Copy Markdown
Collaborator

Sandboxed verification: ❌ not passed — findings reported (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: 44 passed · 4 failed · 48 total

Flakiness gate: ⚠️ timeout — 1 invocation(s) ended in a timeout/signal exit — infrastructure, not test nondeterminism, so these rounds carry no flakiness signal

中文 — 判定:❌ 不通过 · 报告了发现(agent 判定)

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

脚本断言:44 通过 · 4 失败 · 48 总计

抖动门:⚠️ timeout — 1 invocation(s) ended in a timeout/signal exit — infrastructure, not test nondeterminism, so these rounds carry no flakiness signal

Verification report

Verdict: findings — 44 pass / 4 fail / 48 scripted assertions. Verified head a0bdd4cf984ffd32ae617fca129da87c3ce8444b (HEAD^2), base 35a293576e93a0dcd38d63d2fee4e34551fd72b2 (HEAD^1).

The central claim is proven load-bearing: an identical slow-settle injection turns the control red and the PR green, on both budget classes. No regression reproduced. The 4 failing assertions are a real defect class in the clamp: it is compared against the lane default per-test ceiling but never against the 41 explicit per-test ceilings in the same file, so on the ecs-qwen lane the PR targets, 21 waits across 11 tests can no longer report their own assertion.

中文摘要

结论:findings —— 44 通过 / 4 失败 / 共 48 条脚本化断言。已验证 head a0bdd4cf,base 35a29357。

A/B 结论(核心主张成立):对两个 arm 注入完全相同的"慢结算"门控,唯一差异是预算。在 ecs-qwen 预算元组(SETTLE=45s、testTimeout=60s)下:被 PR 引用的 1s 默认档位(延迟 2s)base 红 / head 绿;固定 10s 档位(延迟 12s)base 红 / head 绿;500ms 对照两 arm 皆绿(证明注入本身无害);50s 探针 head 仍失败且失败在断言本身而非 runner 超时(证明预算确实是 45s、并非无上限,且 ecs 档位的余量按设计生效)。整文件 A/B:对照 593/593,head 592/593。

Findings(按严重度):

  1. Math.min 的钳制只对照档位默认上限(60s/15s),从未对照文件内 41 处显式单测上限。ecs 档位下 SETTLE=45s 超过 15 处所在的 }, 30_000) 与 6 处所在的 }, 45_000),共 11 个测试的 21 处等待再也无法报出自己的断言(base 预算 10s 时可以)。新增代码注释声称钳制正是为了"让真正的卡死仍然失败在测试内部的断言上,而不是裸 runner 超时"——在其主打档位上未成立。最尖锐的一例:}, 45_000) 那个测试里,作者自己新加的注释写着"keep it short so a wedged turn still leaves the assertion above inside this test's }, 45_000); ceiling",并把清理等待保留在 10s;但"上面那个断言"本身被改成了 45s,恰好等于上限,因此它无法在上限内报出。改动违反了它紧邻注释所陈述的规则。
  2. 在高负载非 ecs 档位,钳制结果 15s 与 testTimeout 15s 完全相等,余量为 0:236 处等待无法报出断言,其中 223 处为新增(涉及 131 个测试;另 13 处在 base 已因既有 timeout: 15_000 站点而失效)。hookTimeout 在该档位走 vitest 默认 10s,余量为 −5s;不过实测 249 处 SETTLE 等待中 0 处位于 hook 内,所以这一项目前是潜在约束而非现行缺陷。
  3. 完整性:仍有 52 处等待跑在 vitest 1s 默认值上(分布在 30 个测试),其中 17 处断言的正是 PR 所引用的同一形态(hasActivePrompt / recoveryBlocked)。本轮验证中 head 整文件 arm 的唯一红点,就发生在这样一处未被本 PR 触碰的 1s 站点上。

已度量的候选修复:把上限从 45_000 收到 25_000(严格低于承载 SETTLE 等待的最小显式上限 30s)。补丁只改 1 行、零附带;ecs 档位 newly-blind 由 21 → 0;并且行为上仍然保持修复效果(12s 慢结算在 capped 版本下依旧通过,单测实测耗时 12306ms)。代价是预算从 45s 降到 25s。

未覆盖:#14542 / #14522 那两次 Test (ubuntu) 究竟跑在 ecs 还是 GitHub 托管 runner(需要 API,本环境无 token);高负载非 ecs 档位未能行为化复现(需在模块加载瞬间 loadavg[0] ≥ 64,本机为 23–55 且不由我控制),其数字由真实表达式计算得出而非实测;逐 commit 归因(浅克隆 depth 2,rev-list HEAD^1..HEAD^2 在浅边界返回 1 而快照为 8);Windows / macOS 档位;未跑 packages/cli 全量套件与仓库级门禁。

Central claim and A/B

Central claim. Turn-settling waits that previously ran on a fixed budget are routed through one slow-host-aware constant, so on the ecs-qwen lane a settle that is merely slow (not stuck) no longer expires its budget — without changing any test's outcome.

The PR is test-only: one file, packages/cli/src/serve/hosted-harness-session.test.ts, +338/−294. It contains 365 vi.waitFor call sites (identical count on both arms). Measured transitions (transitions.log, 8/8 assertions):

base budget class head n
timeout: 10_000 SETTLE_TIMEOUT_MS 242
(no options → vitest 1 s default) SETTLE_TIMEOUT_MS 7
timeout: 10_000 unchanged 3
(no options → 1 s default) unchanged 52
timeout: 15_000 / 30_000 / 3000 unchanged 51 / 6 / 1
isSlowTestHost() ? 30_000 : 1_000 / : 10_000 unchanged 2 / 1

Nothing lost budget on any lane (budget-decreased=0 on all three), and none of the 7 newly-budgeted waits is a negative/absence assertion, so lengthening them cannot invert a meaning.

A/B instrument. Both arms ran in the same tree with the same node_modules; the control is a byte-identical copy of HEAD^1's file (diff against git show HEAD^1:… empty; positive control: it differs from head by 1134 diff lines). RUNNER_NAME=ecs-qwen-verify-01 pins the flaking lane's real tuple. Into each arm I injected an identical gate making one real settle wait unable to succeed until SLOW_SETTLE_MS had elapsed — a faithful model of "the pipeline is still doing legitimate work when the budget expires". Only the budget differs.

Flip A/B: identical slow-settle injection, only the budget differs

cell budget class delay control (HEAD^1) head (PR) oracle
A-control cited 1 s class 500 ms pass (2345 ms) pass (1899 ms) Tests 1 passed | 592 skipped
B-cited-1s 1 s → 45 s 2000 ms fail — Error: simulated slow settle at injected L15111 pass (5203 ms) exit code + failure text
C-10s 10 s → 45 s 12000 ms fail — same error at L6785 pass (12345 ms) exit code + failure text
D-headroom headroom probe 50000 ms fail fail-assertion, runnerTimeout=false failure mode

8/8 cells matched expectation; 16/16 assertions. Cell D is the bound on the claim: head's budget is genuinely 45 s, not unbounded, and because the lane ceiling is 60 s the failure surfaces as the wait's own error rather than a bare Test timed out — the headroom mechanism does work where headroom exists.

Budget matrix (every expression extracted verbatim from the tree and evaluated against pinned tuples; positive control asserts the four extractions differ):

Real expressions x lane tuples: budget matrix, headroom and newly-blind waits

lane SETTLE_TIMEOUT_MS testTimeout hookTimeout headroom (test / hook)
ecs-qwen-* 45 000 60 000 60 000 15 000 / 15 000
loaded non-ecs 15 000 15 000 10 000 (vitest default) 0 / −5 000
idle non-ecs 10 000 15 000 10 000 5 000 / 0

Real isSlowTestHost() measured directly: true for RUNNER_NAME=ecs-qwen-verify-01. The idle arm is a behavioural no-op (SETTLE == 10_000 == base), so nothing changes for local runs. The Math.min clamp is not dead code — it is what moves the loaded non-ecs result from 45 000 to 15 000.

Full-file A/B (ecs tuple, 593 tests each arm):

Full-file A/B: control 593/593, head 592/593

arm result duration
control HEAD^1 593 passed (593) 327.87 s
head (PR) 592 passed, 1 failed (593) 342.72 s

The single red is not attributable to this PR (measured, not inferred):

  • The test body is byte-identical between arms — sha256 7acbb7677e3a0fa9dedf9f84874c87d1ba6df29d3d75c9aba86b0cd2d5697b18 on both, 179 lines each. Positive control: a one-token edit to the same extracted body is reported as different.
  • All three of its waits run on vitest's 1 s default in both arms (base L16768/16793/16834, head L16796/16821/16862) — sites this PR does not touch.
  • It does not reproduce in isolation on either arm: 5/5 pass on base and 5/5 on head, interleaved so both saw the same load (loadavg1 39.2–45.2). 4/4 assertions.

Flake attribution: the head-arm red does not reproduce on either arm

Corrections to the PR description

These are corrections to the description, not requests to change the code.

  1. The three cited CI failures were not 10 s-budget failures. The body's table gives each cited assertion as "inside a vi.waitFor({ timeout: 10_000 })" and concludes "every failure is a 10 s poll expiring". Measured against HEAD^1, all three cited tests' waits carried no timeout option at all — vitest's 1 s default:

    cited failure test base wait budgets
    fix(managed-agent): bound publication placement waits #14542 Test (ubuntu) loads published Skills from the saved resource after detach… base L34989 — none (1 s)
    main e584d4d pins the /2 file profile through create and load and advertises glob base L15110, L15156 — none (1 s)
    fix(ci): repair Java gates and report failures on PRs #14522 Test (ubuntu) settles a saved final native plan without new inference (%s) (it.each) base L17079/17095/17111 — none (1 s)

    The three cited failures ran on vitest's 1s default

    The new code comment states this correctly ("Main CI failed: Qwen Code CI — src/serve/hosted-harness-session.test.ts > … > settles a saved final native plan without new inference (expir… (+1 more) #14406 and Main CI failed: Qwen Code CI — src/serve/hosted-harness-session.test.ts > … > holds the fresh Session open until the never-started reconcile… #14023 both failed on waits running on vitest's 1 s default"), so the body and the comment disagree. This matters for reading the diff: the 7 gained-budget sites are what the cited evidence actually supports, while the 242 substitutions — the bulk of the change — have no cited failure behind them. They are still a reasonable preventive generalisation, and cell C above proves they work; they are just not what the evidence in the body demonstrates.

  2. "a mechanical substitution of timeout: 10_000 with it" understates the diff: it is 242 substitutions plus 7 waits that gained a budget from none. The other Reviewer Test Plan step — "confirm the three pre-existing isSlowTestHost() sites still read as they did" — is executable and passes: they survive verbatim at head L17330, L17417, L17743.

  3. "this change generalises their policy rather than inventing another number" is not what landed. The three ternary sites survive, so the file now carries two different slow-host budgets for the same kind of wait: SETTLE_TIMEOUT_MS (45 s / 15 s / 10 s) and isSlowTestHost() ? 30_000 : 1_000. On a loaded non-ecs lane a ternary wait gets 30 s while an adjacent settle wait gets 15 s — and 30 s exceeds that lane's 15 s ceiling (pre-existing at base, not introduced here).

  4. The body's risk section explains the 15 s case with the pre-clamp number. It says "the 45 s budget is above that ceiling"; after the clamp the budget equals the ceiling, and equality is already enough to lose (see Finding 2).

Findings

1. On the ecs-qwen lane the PR targets, 21 waits across 11 tests can no longer report their own assertion

Severity: significant — contradicts the new code comment, degrades the target lane. Not a pass/fail regression. (measured)

The comment on the new constant says the clamp exists so that "a genuine hang still fails on the assertion inside the test rather than as a bare runner timeout", clamped to "the per-test ceiling the runner actually sets (60 s on the ecs-qwen pool, 15 s elsewhere)". But that is the lane default from packages/cli/vitest.config.ts. The file also declares 41 explicit per-test ceilings, and an explicit ceiling replaces the lane default. SETTLE_TIMEOUT_MS = 45 000 overshoots two of them:

explicit ceiling newly-blind waits base budget could report at base?
}, 30_000) 15 10 000 yes (10 s < 30 s)
}, 45_000) 6 10 000 yes (10 s < 45 s)
total 21 across 11 tests base had 0 blind waits on this lane

A wait can only surface its assertion when budget < ceiling; at budget >= ceiling the runner's timer — which starts at test start, earlier than the wait's own clock — always fires first. Reproduce:

node tmp/pr14598-verify-20261019-032225/static-budget-audit.mjs   # ecs-qwen: head 21/364 blind | base 0/364

Sharpest instance. In the test ending }, 45_000); at L5859, the author added this comment beside a cleanup wait they deliberately left at timeout: 10_000:

// Cleanup, not proof: keep it short so a wedged turn still leaves the
// assertion above inside this test's `}, 45_000);` ceiling.

The rule is right — but "the assertion above" (L5791) was itself given SETTLE_TIMEOUT_MS = 45 s, exactly equal to the 45 s ceiling, so it cannot report inside it. The same test's final wait (L5835) is in the same position. The change defeats the rule its own adjacent comment states. Two further sites the author handled correctly show the intent was understood: L14166 (// Cleanup, not proof: a wedged turn must still report the try block's assertion) and L20100 both kept 10 s.

Why it is more than cosmetics. The PR body's own evidence describes the consequence: the cited failure's teardown also reported ENOTEMPTY: rmdir …/managed-turn-result, i.e. files were still being written when the test ended. A bare runner timeout aborts mid-body and leaves the turn running into a teardown that — per this file's own comment — "refuses an active turn". The assertion path instead lets the test's cleanup wait run. So losing the assertion makes the failure noisier and more likely to cascade, plus it costs 30 s of CI per failure instead of 10 s.

What this is not: no test that passed now fails, and a settle that completes inside the ceiling still benefits (a 20 s settle under a 30 s ceiling now passes where base's 10 s budget failed it). The regression is confined to failure-mode quality.

Measured candidate fix

Cap the budget strictly below the smallest explicit ceiling that holds a SETTLE wait (30 000), i.e. 45_000 → 25_000:

 const SETTLE_TIMEOUT_MS = isSlowTestHost()
   ? Math.min(
-      45_000,
+      25_000,
       process.env['RUNNER_NAME']?.startsWith('ecs-qwen-') ? 60_000 : 15_000,
     )
   : 10_000;

Measured in a scratch copy (tree never modified), 6/6 assertions:

  • zero collateral — the patch changes exactly 1 line; newly-blind 21 → 0, tests affected 11 → 0.
  • still fixes — re-running flip cell C (12 s injected settle) against the capped build: Tests 1 passed, per-test duration 12 306 ms, so it genuinely waited out the delay rather than bailing fast. Base still fails that cell at 10 s.
  • still above base — 25 s > 10 s, so the fix intent survives.

Trade-off: a settle legitimately taking 25–45 s would now fail where the shipped 45 s would have passed. The alternative that preserves 45 s is to raise the 11 affected tests' explicit ceilings instead; that is 11 edits rather than 1. Note this cap does not fix Finding 2, whose ceiling is the 15 s lane default.

2. On a loaded non-ecs lane the clamp buys zero headroom, so the comment's stated purpose does not hold there either

Severity: moderate — inaccurate comment; affects the lane the body names as a risk. (computed from the real expressions, not observed in a run — see Not covered)

Math.min(45_000, 15_000) = 15 000, and testTimeout on that lane is also 15 000. Headroom is exactly 0, so 236 waits cannot report their assertion — 223 of them newly, spanning 131 distinct tests (the other 13 were already blind at base via pre-existing timeout: 15_000 sites). Base total blind on this lane was 16. The comment's claim that clamping means "a genuine hang still fails on the assertion inside the test rather than as a bare runner timeout" is false at equality, for the same reason as Finding 1.

node tmp/pr14598-verify-20261019-032225/static-budget-audit.mjs   # loaded-non-ecs: head 239/364 blind | base 16/364

Latent, not live: hookTimeout is left undefined on non-ecs lanes, so it falls back to vitest's documented default of 10 000 (read from node_modules/vitest/dist/chunks/reporters.d.*.d.ts), giving headroom −5 000. I measured that 0 of the 249 SETTLE waits sit inside a hook, and the one helper-scoped site (L535, parkBlockedTextTurn) is called only from it(...) tests (L22471, L33356, L33375). So this cannot bite today; it becomes a guaranteed Hook timed out in 10000ms the moment someone moves a settle wait into a hook on that lane.

3. The flake class the PR exists to close is still open at 17 same-shape waits

Severity: moderate — completeness. (measured, with a live reproduction)

52 waits still run on vitest's 1 s default at head, across 30 tests. 17 of them assert exactly the shape the PR cites (hasActivePrompt / recoveryBlocked), at lines 1574, 1591, 16796, 16821, 16862, 16947, 16981, 17468, 23238, 26756, 26809, 26908, 27012, 35109, 35192, 35286, 35317.

The new comment scopes this out as "Waits still carrying a fixed budget are outside this change" — but these carry no budget, which is the tighter and more flake-prone case, and the same comment names the 1 s default as the mechanism behind #14406 and #14023. So the PR fixes 7 of the 24 same-shape 1 s-default waits and leaves 17.

This is not hypothetical: the one red test in my head full-file arm is precisely such a site (L16796, clears predispatch partial intent file history before the cancelled terminal), and it failed with the exact symptom the body describes — an assertion about hasActivePrompt at 1765 ms, on a loaded host, in a test whose logic is fine. It is pre-existing (byte-identical body, 5/5 green in isolation on both arms), but it demonstrates the class surviving the change.

node tmp/pr14598-verify-20261019-032225/cited-tests.mjs   # "waits STILL on vitest 1s default at head"

Not covered

  • Which runner the cited Test (ubuntu) runs used. No GitHub token in this lane, so I could not resolve author_association for fix(managed-agent): bound publication placement waits #14542/fix(ci): repair Java gates and report failures on PRs #14522. I read the routing logic instead: .github/workflows/ci.yml sends pull_request from a fork whose author is not OWNER|MEMBER|COLLABORATOR to GitHub-hosted ubuntu-latest (15 s ceiling), while push to main goes to ecs-qwen. So the main e584d4d failure certainly ran on the 60 s lane; the two PR runs are inferred, not measured, and depend on their authors' association. A maintainer can settle it with gh run view <id> --json ....
  • The loaded non-ecs tuple was never exercised behaviourally. It requires os.loadavg()[0] >= os.availableParallelism() (64 on this box) at module-import time; this container sat at 23–55 and its load is not mine to raise. Findings 2's numbers are computed by evaluating the real expressions under a pinned tuple, which is deterministic arithmetic, but no vitest run observed them. The ecs and idle tuples are pinned via RUNNER_NAME and were exercised in real runs.
  • Per-commit attribution. The checkout is depth 2 (git rev-parse --is-shallow-repository = true). git rev-list HEAD^1..HEAD^2 returns 1 commit at the shallow boundary while the metadata snapshot lists 8 — the plausible-number trap, not a real count. I verified the aggregate HEAD^1..HEAD diff only; the 8 commits' individual claims (e.g. clamp the settle budget to the lane's per-test ceiling, keep the recoveryBlocked assertion on the Skills wait) were not separately exercised.
  • Gates I did not run: the full packages/cli suite (only this file), repo-wide npm run lint / npm run test, integration tests, and the Windows/macOS lanes. I ran tsc --noEmit -p packages/cli/tsconfig.json → exit 0, plus prettier --check and eslint on the changed file → both clean, each with a live-gate positive control (a planted formatting break produced [warn]; a planted any produced exit 1 naming @typescript-eslint/no-explicit-any; both removed, file re-verified clean and byte-identical to HEAD).
  • The author's own measurements — 529.57 s for the whole file, and 593/593 on macOS — were not reproduced. My ecs-tuple runs took 342.72 s (head) and 327.87 s (control); the difference in absolute time is expected, since this container is not the author's machine.
  • Whether raising these budgets slows a genuinely wedged suite. On the ecs lane a hang now costs up to 45 s per wait instead of 10 s. I measured the passing-path cost (342.72 s vs 327.87 s, i.e. no meaningful slowdown when nothing hangs) but did not construct a multi-wait wedge to price the failing path.
  • Trial merge into current main. The CI checkout already is the merge ref, so this was not needed; its depth-2 history cannot list what main added since the merge-base.

Methodology

Environment: the CI verify lane container (node:22-bookworm, node v22.23.3, 64 CPUs, loadavg 23–55 during the round), working tree at the merge commit d4bd211a, npm ci and npm run build already complete; QWEN_VERIFY_JAVA unset and no Java surface in the diff. No GitHub token, so the metadata snapshot at $QWEN_VERIFY_CONTEXT plus the local tree were the whole world.

Five harnesses, all .mjs in the artifact directory so a maintainer can rerun them. scan.mjs is a shared character-level scanner that matches every vi.waitFor call — including prettier's split form await vi\n .waitFor(, which a naive literal match misses (a positive control asserts the split-form site at L5823 is found) — pairs each with its budget expression, and pairs it to its enclosing it()/hook by indentation, recovering that owner's explicit ceiling. static-budget-audit.mjs extracts the SETTLE_TIMEOUT_MS, testTimeout, hookTimeout and maxWorkers expressions verbatim by regex from the tree and evaluates them under three pinned lane tuples, supplying isSlowTestHost pinned (this box's load is not controllable) while the real arithmetic and the real process.env read run unmodified; it then computes, per lane, whether each wait's budget can expire inside its owner's ceiling. transitions.mjs pairs all 365 sites between arms by owner + ordinal and reports budget-class transitions. cited-tests.mjs looks up the base budget of each test the body cites. flip-ab.mjs builds the A/B: it injects an identical wall-clock gate into one real settle wait in each arm's scratch copy, runs the single test under the ecs tuple, and records per-cell logs; score-flip.mjs re-scores those logs ANSI-stripped. candidate-fix.mjs patches a scratch copy and re-runs the identical headroom analysis, and writes a runnable copy so the flip cell could be re-run against the cap.

The full-file arms ran via run-ab.sh (arm-head-ecs.log, arm-base-ecs.log, plus junit XML per arm); the control was a byte-identical copy of HEAD^1's file placed in the head tree, so no workspace symlink could leak head code into it, and it was deleted afterwards (git status --porcelain clean). Flake attribution ran 5 iterations per arm interleaved (flake-attribution.log); its in-loop grep was ANSI-blind and printed FAIL for every iteration, so score-flake.mjs re-scores from the authoritative rc= column and says so. Raw per-cell output is in flip-*.log; harness results in the matching .json files; assertions.json is generated from those files, never by hand. Expected base-arm reds are encoded as passing assertions, so the 4 fails are all genuine PR findings.

Flakiness gate log

rounds=5 files=1 skipped=0
file packages/cli/src/serve/hosted-harness-session.test.ts: (cd packages/cli) npx --no-install vitest run ./src/serve/hosted-harness-session.test.ts


per-file results (P=pass F=fail I=infra-exit, one letter per run):
  packages/cli/src/serve/hosted-harness-session.test.ts: PIP

verdict: timeout
summary: 1 invocation(s) ended in a timeout/signal exit — infrastructure, not test nondeterminism, so these rounds carry no flakiness signal

--- per-invocation detail (full copy in the artifact) ---
round 1 · packages/cli/src/serve/hosted-harness-session.test.ts: P (exit 0)
round 2 · packages/cli/src/serve/hosted-harness-session.test.ts: I (exit 124)
--- output tail · round 2 · packages/cli/src/serve/hosted-harness-session.test.ts ---
3-3333-4333-8333-333333333333 is recovery blocked: Error: aborted
qwen serve: Hosted Session 22222222-2222-4222-8222-222222222222 could not restore its held Runtimes: TypeError: fetch failed
qwen serve: Hosted Harness recovery re-answer of session 22222222-2222-4222-8222-222222222222 failed: Error: journal down
qwen serve: Hosted Session 22222222-2222-4222-8222-222222222222 close failed: ManagedSessionWritesStoppedError: session log writes stopped after an earlier failure: journal down
qwen serve: Hosted Session 22222222-2222-4222-8222-222222222222 could not restore its held Runtimes: TypeError: fetch failed
qwen serve: Hosted Harness turn 33333333-3333-4333-8333-333333333333 is recovery blocked: Error: aborted
qwen serve: Hosted Session 22222222-2222-4222-8222-222222222222 could not restore its held Runtimes: TypeError: fetch failed
qwen serve: Hosted Harness turn 33333333-3333-4333-8333-333333333333 is recovery blocked: Error: aborted
qwen serve: Hosted Session 22222222-2222-4222-8222-222222222222 could not restore its held Runtimes: TypeError: fetch failed
qwen serve: Hosted Harness turn 33333333-3333-4333-8333-333333333333 could not settle the cancellation: Error: broker transport blip
qwen serve: Hosted Harness turn 33333333-3333-4333-8333-333333333333 is recovery blocked: Error: aborted
qwen serve: Hosted Harness turn 33333333-3333-4333-8333-333333333333 is recovery blocked: Error: aborted
qwen serve: Hosted Session 22222222-2222-4222-8222-222222222222 could not restore its held Runtimes: TypeError: fetch failed
qwen serve: Hosted Harness turn 33333333-3333-4333-8333-333333333333 could not settle the cancellation: Error: store hiccup
qwen serve: Hosted Harness turn 33333333-3333-4333-8333-333333333333 is recovery blocked: Error: aborted
qwen serve: Hosted Harness turn 33333333-3333-4333-8333-333333333333 is recovery blocked: Error: aborted
qwen serve: Hosted Harness turn 33333333-3333-4333-8333-333333333333 is recovery blocked: Error: aborted
qwen serve: Hosted Session 22222222-2222-4222-8222-222222222222 could not restore its held Runtimes: TypeError: fetch failed
qwen serve: Hosted Harness turn 33333333-3333-4333-8333-333333333333 is recovery blocked: Error: store gone
qwen serve: Hosted Harness turn 33333333-3333-4333-8333-333333333333 is recovery blocked: Error: aborted
qwen serve: Hosted Session 22222222-2222-4222-8222-222222222222 could not restore its held Runtimes: TypeError: fetch failed
qwen serve: Hosted Harness turn 33333333-3333-4333-8333-333333333333 is recovery blocked: Error: store gone
qwen serve: Hosted Harness turn 33333333-3333-4333-8333-333333333333 is recovery blocked: Error: aborted
qwen serve: Hosted Session 22222222-2222-4222-8222-222222222222 could not restore its held Runtimes: TypeError: fetch failed
qwen serve: Hosted Harness release of recovered Runtime 33333333-3333-4333-8333-333333333333 failed after the cancellation settled: Error: broker unreachable
qwen serve: Hosted Harness turn 33333333-3333-4333-8333-333333333333 is recovery blocked: Error: aborted
qwen serve: Hosted Session 22222222-2222-4222-8222-222222222222 could not restore its held Runtimes: TypeError: fetch failed
qwen serve: Hosted Harness turn 33333333-3333-4333-8333-333333333333 could not settle the cancellation: Error: broker gone
qwen serve: Hosted Harness turn 33333333-3333-4333-8333-333333333333 is recovery blocked: Error: aborted
qwen serve: Hosted Session 22222222-2222-4222-8222-222222222222 could not restore its held Runtimes: TypeError: fetch failed
qwen serve: Hosted Harness turn 33333333-3333-4333-8333-333333333333 could not settle the cancellation: Error: Runtime execution outcome is unknown.
qwen serve: Hosted Harness turn 33333333-3333-4333-8333-333333333333 is recovery blocked: Error: aborted
qwen serve: Hosted Session 22222222-2222-4222-8222-222222222222 could not restore its held Runtimes: TypeError: fetch failed
qwen serve: Hosted Harness turn 33333333-3333-4333-8333-333333333333 could not settle the cancellation: Error: Cancelled settle cannot verify the park (authorization not runnable).
qwen serve: Hosted Harness turn 33333333-3333-4333-8333-333333333333 is recovery blocked: Error: aborted
qwen serve: Hosted Session 22222222-2222-4222-8222-222222222222 could not restore its held Runtimes: TypeError: fetch failed
qwen serve: Hosted Harness turn 33333333-3333-4333-8333-333333333333 is recovery blocked: Error: aborted
qwen serve: Hosted Session 22222222-2222-4222-8222-222222222222 could not restore its held Runtimes: TypeError: fetch failed
qwen serve: Hosted Harness turn 33333333-3333-4333-8333-333333333333 is recovery blocked: Error: aborted
qwen serve: Hosted Session 22222222-2222-4222-8222-222222222222 could not restore its held Runtimes: TypeError: fetch failed
qwen serve: Hosted Harness turn 33333333-3333-4333-8333-333333333333 is recovery blocked: Error: aborted
qwen serve: Hosted Session 22222222-2222-4222-8222-222222222222 could not restore its held Runtimes: TypeError: fetch failed
qwen serve: Hosted Harness turn 33333333-3333-4333-8333-333333333333 is recovery blocked: Error: aborted
qwen serve: Hosted Session 22222222-2222-4222-8222-222222222222 could not restore its held Runtimes: TypeError: fetch failed
qwen serve: Hosted Harness turn 33333333-3333-4333-8333-333333333333 is recovery blocked: Error: aborted
qwen serve: Hosted Session 22222222-2222-4222-8222-222222222222 could not restore its held Runtimes: TypeError: fetch failed
qwen serve: Hosted Harness turn 33333333-3333-4333-8333-333333333333 could not settle the cancellation: Error: broker gone
qwen serve: Hosted Harness refused a fresh prompt while recovered Turn 33333333-3333-4333-8333-333333333333 is undriven.
qwen serve: Hosted Harness turn 33333333-3333-4333-8333-333333333333 is recovery blocked: Error: aborted
qwen serve: Hosted Session 22222222-2222-4222-8222-222222222222 could not restore its held Runtimes: TypeError: fetch failed
qwen serve: Hosted Harness turn 33333333-3333-4333-8333-333333333333 could not settle the cancellation: Error: history write rejected
qwen serve: Hosted Session 22222222-2222-4222-8222-222222222222 could not restore its held Runtimes: TypeError: fetch failed
qwen serve: Hosted Harness turn 33333333-3333-4333-8333-333333333333 is recovery blocked: Error: aborted
qwen serve: Hosted Session 22222222-2222-4222-8222-222222222222 could not restore its held Runtimes: TypeError: fetch failed
qwen serve: Hosted Harness turn 33333333-3333-4333-8333-333333333333 could not settle the cancellation: Error: acknowledgement lost
qwen serve: Hosted Harness turn 33333333-3333-4333-8333-333333333333 settled the cancellation but its terminal record was refused: ManagedSessionConflictError: event id turn:33333333-3333-4333-8333-333333333333 is already committed.
qwen serve: Hosted Harness turn 33333333-3333-4333-8333-333333333333 is recovery blocked: Error: aborted
qwen serve: Hosted Session 22222222-2222-4222-8222-222222222222 could not restore its held Runtimes: TypeError: fetch failed
qwen serve: Hosted Harness turn 33333333-3333-4333-8333-333333333333 could not settle the cancellation: Error: terminal record write rejected
qwen serve: Hosted Harness turn 33333333-3333-4333-8333-333333333333 settled the cancellation but its terminal record was refused: Error: terminal record write rejected
qwen serve: Hosted Harness turn 33333333-3333-4333-8333-333333333333 could not settle the cancellation: Error: terminal record acknowledgement lost
qwen serve: Hosted Harness turn 33333333-3333-4333-8333-333333333333 is recovery blocked: Error: aborted
qwen serve: Hosted Session 22222222-2222-4222-8222-222222222222 could not restore its held Runtimes: TypeError: fetch failed
qwen serve: Hosted Harness turn 33333333-3333-4333-8333-333333333333 could not settle the cancellation: Error: history write rejected
qwen serve: Hosted Harness turn 33333333-3333-4333-8333-333333333333 is recovery blocked: Error: aborted

Session terminated, killing shell... ...killed.

round 3 · packages/cli/src/serve/hosted-harness-session.test.ts: P (exit 0)

Evidence images

01-flip-ab-base-red-head-green

02-budget-matrix-and-headroom

03-full-file-ab-base-593-head-592

04-cited-failures-were-1s-defaults

05-flake-attribution-both-arms-green

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

— Qwen Code · sandboxed verification

@qqqys qqqys 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 at head a0bdd4cf. Comment, not approve — the sweep itself is mechanically clean and I could not find a weakened assertion in it, but the one Critical on this PR is only partially addressed at this head and I could not confirm the rest inside budget. A CHANGES_REQUESTED also still governs reviewDecision; it is anchored at c4a8e5a2 and so is stale by head, but it has not been lifted.

What I verified positively: nothing was loosened

A 245-site timeout sweep is exactly where an assertion gets dropped by accident, so I counted rather than read. Base 35a29357 against head a0bdd4cf, same file:

base head
expect( 3479 3479
it(/test( 334 334
vi.waitFor( 364 364
timeout: 10_000 literals 245 3
SETTLE_TIMEOUT_MS uses 0 250

Identical assertion, test and wait counts with 242 literal budgets replaced is strong evidence the change is the substitution it claims to be and not a quiet narrowing. The three surviving timeout: 10_000 literals are consistent with the description's statement that waits already carrying a fixed budget are out of scope. CI is green across the board at this head, including Test (ubuntu-latest, Node 22.x) at 37m29s.

R1-1: partially addressed, and I could not confirm the remainder

The Critical's substance was that the cited flakes ran on bare vi.waitFor calls taking vitest's 1000 ms default, while the sweep converted only sites that already had timeout: 10_000. At this head that has been acted on in two ways: the module comment at :364-365 now states the corrected premise ("#14406 and #14023 both failed on waits running on vitest's 1 s default"), and some bare waits were converted — holds the fresh Session open until the never-started reconcile completes, named in the finding as bare at :1878, now reads { timeout: SETTLE_TIMEOUT_MS } at :1878-1881.

But an argument-count scan of every vi.waitFor( call shows 57 bare waits at base and 51 at head — six converted, fifty-one still running on the 1 s default. The finding named four tests as motivation; I confirmed one is fixed and did not have budget to confirm whether pins the /2 file profile…, settles a saved final native plan… and loads published Skills from the saved resource after detach… are among the 51 or among the six. Until that is settled, the PR's own justification is unverified for three of its four cited incidents, and replaying those incidents against this branch is still the test that decides it.

One concrete arithmetic point on the clamp

SETTLE_TIMEOUT_MS at :372-378 is isSlowTestHost() ? Math.min(45_000, RUNNER_NAME.startsWith('ecs-qwen-') ? 60_000 : 15_000) : 10_000, and packages/cli/vitest.config.ts:212-214 sets testTimeout to 60_000 on that pool and 15_000 elsewhere. On the ECS pool the clamp gives 45 s against a 60 s ceiling — the intended headroom, and a genuine hang still fails on the assertion. On a non-ECS host that trips isSlowTestHost(), Math.min(45_000, 15_000) yields exactly 15_000, equal to the per-test timeout rather than below it. The comment's stated goal is that a hang "still fails on the assertion inside the test rather than as a bare runner timeout"; at equality the two race, and which one wins is timing-dependent. The Risk section discloses the same symptom from the other direction (it describes 45 s as sitting above the 15 s ceiling, which the clamp prevents). Worth a subtraction — a strict inequality against the effective ceiling, or a note that equality is accepted — rather than a re-derivation. Non-blocking either way, since it only affects tests that were already failing.

Next step

Settle whether the four cited tests read SETTLE_TIMEOUT_MS at this head; the six-vs-fifty-one split says some bare waits were converted deliberately and some were not, and the PR needs to say which and why. If the remaining 51 are intentionally out of scope, that scoping belongs in the description, because the finding turns entirely on which waits the cited incidents actually hit. Then re-request review so the change-request state is re-evaluated against this head.

@qwen-code-dev-bot qwen-code-dev-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.

Final gate review at head a0bdd4c.

Historical blockers resolved — verified in code at this head:

  • R1-1 (Critical, certifies-falsely): the seven waits the cited flakes actually hit now carry the settle budget — :1895, :15129, :15178, :17107, :17126, :17145 (all three it.each arms), :35030. The constant comment no longer claims a 10 s budget was exceeded; it names the vitest 1 s default behind #14406 / #14023 and states that waits still on a fixed budget are outside this change.
  • R1-6: both finally-resident cleanup waits are back to { timeout: 10_000 } (:5830, :14175), each with a cleanup-not-proof note.
  • R1-7: the modelWaiting wait (:20101) is back to 10_000, so it can no longer outlive the f.submit(10_000) deadline and the cancel-ordering assertion keeps its honest failure mode.

Deferred Suggestions (R1-2 to #14627; R1-3, R1-4, R1-5, R1-8 to #14625) are recorded in open issues together with the reviewer numbers. They are clamp and per-test-ceiling design decisions rather than defects in this diff, so they do not block a test-only wait-budget change.

CI: every check on a0bdd4c is completed — success or skipped-by-design; none pending, failed or cancelled.

Independent check — no new Critical: isSlowTestHost is already imported (:115); none of the newly converted waits sits inside a hook, so the off-pool 10 s hookTimeout is not exposed; the diff touches only packages/cli/src/serve/hosted-harness-session.test.ts, no production code; approvalTimeoutMs: 1000 (:17084) is untouched.

Head SHA and required checks were re-read immediately before submitting: SHA unchanged, checks green.

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

Review — test(cli): give turn-settling waits the slow-host budget

Verdict: APPROVE. No blocking findings.

Tier

Standard — test-only change, no production code affected. Risk answer 5 (silent failure) is mild: flaky tests that never fail in the fast path are the failure mode.

What was checked

R1-1 from prior review (Critical — "cited failing tests not fixed"): Verified resolved at current head a0bdd4cf.

The tests named as motivation:

  • 'holds the fresh Session open until the never-started reconcile completes' (line 1866): vi.waitFor(() => ..., { timeout: SETTLE_TIMEOUT_MS }) ✓
  • 'pins the /2 file profile through create and load...' (line ~15132, ~15182): both vi.waitFor calls carry { timeout: SETTLE_TIMEOUT_MS } ✓
  • 'loads published Skills from the saved resource after detach...' (line ~35031): { timeout: SETTLE_TIMEOUT_MS } ✓

R1-7 from prior review (deadline-bounded wait): The vi.waitFor(() => expect(modelWaiting).toBe(true), { timeout: 10_000 }) at line ~20100 is intentionally kept at 10_000 with an explanatory comment. The cancel-deadline ordering assertion remains valid.

R1-6 from prior review (finally block double-spend): The finally block's cleanup wait in 'reports a reconcile against a live wake turn' carries { timeout: 10_000 } (not SETTLE_TIMEOUT_MS), with comment "keep it short so a wedged turn still leaves the assertion above inside this test's }, 45_000); ceiling."

SETTLE_TIMEOUT_MS formula:

  • ecs-qwen pool (slow host): Math.min(45_000, 60_000) = 45_000 — 15 s buffer before the 60 s pool ceiling ✓
  • Non-ecs-qwen slow host: Math.min(45_000, 15_000) = 15_000 — equals the 15 s vitest ceiling. The test clock starts before the waitFor, so the runner timeout fires first on a genuine hang; the assertion does not surface. This limitation is noted in R1-5 from the prior round and remains; it is not a blocker (non-ecs-qwen slow runners were already timing out at 10 s — a 15 s ceiling is an improvement).
  • Fast host: 10_000 — unchanged from pre-diff behavior ✓

Mechanical consistency:
All 28 { timeout: 10_000 } sites that are turn-settling waits were replaced. Sites deliberately excluded: { timeout: 15_000 }, { timeout: 30_000 } (same-class but outside the literal-value sweep scope — not a regression), { timeout: 10_000 } with deadline constraints (correctly preserved).

Not covered

  • R1-3 (15_000 and 30_000 waits not swept): acknowledged in prior review, out of scope for this PR
  • R1-4 (aggregate worst-case CI ceiling): systemic concern, not a correctness defect in this diff
  • R1-8 (parkToolTurn helper budget math): flagged in prior review; not addressed here; not a blocker

Cross-check

Prior review's only blocker (R1-1) is resolved. Remaining items are non-blocking suggestions carried forward.

Reviewed with AI assistance.

@qwen-code-review-bot qwen-code-review-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. ✅

Re-reviewed at a0bdd4cf98. The Critical from the round pinned at c4a8e5a2 no longer stands at this head: all seven waits the cited flakes actually hit now carry { timeout: SETTLE_TIMEOUT_MS }, bare waits went 59 → 52, and the clamp matches packages/cli/vitest.config.ts:232-234 on both arms. Test ran green on physical runner ecs-qwen-hk5-32, so the full 45 s budget was live on the pool where the flakes occur.

Remaining items are filed follow-ups, not blockers: #14625 (clamp headroom, hand-copied RUNNER_NAME ternary, reachable-sum bound) and #14627 (bare rm teardowns).

One pre-merge ask, and it is prose rather than code: the description still describes the pre-re-scope literal-value sweep — "245 of those waits carried a fixed 10 s budget", "every failure is a 10 s poll expiring", and "read the diff as … a mechanical substitution of timeout: 10_000 with it" — while the head adds a budget to seven waits that had none and keeps three at 10 s. Worth ten minutes so whoever merges this reads an account that matches the diff. Details in the stage 3 comment.

@yiliang114
yiliang114 merged commit d998cd4 into main Oct 19, 2026
110 of 116 checks passed
yiliang114 added a commit that referenced this pull request Oct 19, 2026
Resolve hosted-harness-session.test.ts by taking main's side: #14598
replaced the per-test waitOptions budget with the file-level
SETTLE_TIMEOUT_MS, so this PR's identical local constant is subsumed.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Patrol-Run: qwen-pr-conflict/jmvepo0oyh9
@qwen-code-review-bot

Copy link
Copy Markdown
Collaborator

Released in v0.26.0.

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.

5 participants