Repository navigation
fix(ci): route post-merge classifier to ECS and yield CLI workers - #14293
Conversation
Yield with a captured real timer so synchronous test batches cannot starve progress acknowledgements, even when fake timers are installed. Keep unhandled errors fatal on Linux.
|
CI closeout: merged current main to include the required CI-budget script, and fixed the reproduced progressive-replay test failure by unmounting each test fixture. The unchanged regression assertion still fails under a deliberate replay-reset mutation. Two final runs passed 37/37 tests each; routing 39/39, build, typecheck, lint and CI budget passed locally. Fresh hosted checks remain a separate gate. Scope remains CI routing and test infrastructure; no application behavior was changed. |
|
Local verification: PASS for the CI-routing and test-infrastructure scope. Application UI: N/A. Tested candidate:
The application UI route is N/A because the changed workflow is consumed by GitHub Actions and the setup/cleanup files are consumed only by Vitest. The cleanup unmounts test renderings after each test; no application renderer, service protocol, persisted user state, or outbound application request was changed. Screenshots or a normal CLI launch would not observe the changed contract. The root agent reported the full build, repository typecheck, formatting, ESLint, routing and CI-budget gates passed. The old-head Linux CI log still contains the valid 203/103 failure and no RPC timeout; local results do not retroactively turn that run green or establish the status of fresh hosted checks. The historical 650-case/65-second RPC starvation benchmark was not independently rerun or relied on here. The four timer controls establish the yield boundary only, not throughput or immunity to every RPC timeout. Evidence is retained under 本地验证:CI 路由和测试基础设施范围内 PASS;应用 UI 不适用。 最终验证候选为 最终候选的两次独立目标运行均为 37/37 通过,包括未放宽的 203 项断言,以及 real/fake timer 下真实宏任务在下一测试前执行的 4 项控制。根 agent 注入模型切换触发 replay reset 的负对照使原断言以 203/53 失败;我检查了该日志,并未亲自执行 mutation。根 agent 的 39 项路由验证及构建、类型、格式、lint、CI budget 检查也已通过。 本次未修改应用代码,因此没有可对应的应用 UI、协议或用户持久化状态变化。没有重新调度真实 Actions 队列,也没有独立重跑 650 case、65 秒 RPC 压力实验;宏任务控制只证明测试边界会让出执行机会。旧 head 的 Linux CI 红灯仍是有效历史结果,新 head 的远程 CI 状态须另行确认。证据、命令和可重放脚本均已保留,临时文件已删除,验证后工作树干净。 |
|
✅ Qwen Triage finished — CI landed green on ✅ Qwen Triage 已完成 —— |
|
Thanks for the PR! Template looks good ✓ Problem — the routing half is an observed bug, not a hypothesis. #14219 is open and carries a concrete run: the post-merge classifier queued 49m32s and then did four seconds of work. I checked the mechanism against the base YAML rather than taking the description's word for it — The worker-yield half has no linked issue and no failing run behind it, and your own description says "Separately" — more under Approach. Direction — aligned, and the trust boundary is not widened. Size — not applicable, no core paths touched. For the record: 12 changed lines in the workflow, 5 in Approach — the routing fix is the minimal version of itself: one clause added to an expression that already existed, no new indirection. Swapping the test that pinned the old asymmetry for one that evaluates the real expression text, executes the real Two genuine questions before the code review:
Risk — no elevated risk signals; the revert-correlated path scan matched nothing. Moving on to code review. 🔍 中文说明感谢贡献! 模板完整 ✓ 问题:路由这一半是已观测到的 bug,不是假设。#14219 处于 open 状态,并附有具体的 run:合并后的分类任务排队 49 分 32 秒,实际只执行了四秒。我没有只采信描述,而是对照 base 分支的 YAML 核实了机制—— worker yield 那一半没有关联 issue,也没有失败 run 作为支撑,而且你自己的描述里写的是"另一个问题"(Separately)——见"方案"部分。 方向:对齐,且没有放宽信任边界。 规模:不适用,未触及核心路径。仅供参考:workflow 改动 12 行, 方案:路由修复已是最小实现——只在既有表达式上加一个分支,没有引入新的间接层。把原本"固定旧的非对称行为"的测试,换成一个真实求值表达式文本、真实执行 进入代码审查前,有两个真实的问题:
风险:无升级风险信号;与 revert 相关的高风险路径扫描无命中。 进入代码审查 🔍 — Qwen Code · qwen3.8-max-2026-09-02 Reviewed at |
|
Two scope clarifications for the stage-1 questions:
No application behavior or manual-dispatch policy was changed during this closeout. 中文:本次路由修复针对 #14219 已观测到的 main push;手动 dispatch 的既有非对称没有修改,也没有声称测量其排队耗时。CLI yield 是同 PR 中的第二项测试基础设施修改,不是路由表达式的必要条件,不能据此推断路由造成 RPC 饥饿。本地证明了真实/假时钟下测试之间会让出宏任务,复现并修复了 yield 暴露的旧 render 实例污染,负对照也确认原 replay 断言仍有效;没有独立验证历史压力实验或 Linux 超时率改善。当前 Linux CI 仍在运行,验证报告保留这些边界。 |
Code reviewMy independent proposal before opening the diff was: reuse the runner-selection expression the downstream jobs already read, add the one missing event arm, and don't build new machinery. That is exactly what this does — one clause appended to an expression that already existed, with the comment updated to match. On the test-infra half I would have reached for a captured-real-timer yield in the package's setup file, and it turns out the repo already has that pattern, documented, in No blocking issues. What I verified rather than assumed:
Non-blocking, but worth your attention:
I skipped the sequence diagram and the changed-files table — five files, CI config and test infrastructure, no runtime flow to trace and no navigation problem for a reviewer to solve. Test evidenceUnattended CI run: I did not build, run, or check out any of this PR's code. Everything below is the PR's own CI, read through the API for Final CI results for
One row per check name (latest run); skipped checks omitted; failures sort first. / 每个检查名一行(取最新一次运行),省略 skipped,失败项排在最前。 No check is red at the time of writing. Two honest gaps in what CI can tell us here:
On sandboxed lanes: neither 中文说明代码审查我在看 diff 之前的独立方案是:复用下游任务已经在读的那个 runner 选择表达式,补上缺失的那一个事件分支,不要引入新机制。这个 PR 做的正是如此——只在既有表达式后追加一个分支,并同步更新了注释。测试基础设施那一半,我本来会想到在包的 setup 文件里用"捕获真实定时器再 yield"的做法,而仓库里其实已经有这个模式,并且带完整文档,就在 没有阻断性问题。以下是我核实过、而非默认成立的几点:
不阻断、但值得注意:
我省略了时序图和改动文件总览表——五个文件、CI 配置与测试基础设施,没有需要梳理的运行时流程,也不存在需要为 reviewer 解决的导航问题。 测试证据无人值守 CI 运行:我没有构建、运行或检出本 PR 的任何代码。以下全部内容来自 PR 自身的 CI,通过 API 读取 (CI 表格见上方英文部分的机器可读区域。) 撰写时没有任何检查为红。 关于 CI 在此处能告诉我们什么,有两个诚实的缺口:
关于沙箱验证 lane: — Qwen Code · qwen3.8-max-2026-09-02 Reviewed at |
yiliang114
left a comment
There was a problem hiding this comment.
COMMENT — code review on head 3066a0e12a. Two disjoint scopes share this PR; both are clean.
Scope 1 — CI routing fix. The push event is added to classify_pr's runs-on expression so the post-merge classifier goes to the same ECS pool as the Test job it feeds. The old "keep push out of the expression" test is correctly removed and replaced with a "both halves agree on push" assertion. The comment about the deliberate asymmetry is also removed from ci.yml. Both changes are coherent and the test rewrite is tighter than the original.
Scope 2 — Test infrastructure hardening. MainContent.test.tsx gains afterEach(cleanup) (prevents cross-test fixture leaks in the progressive-replay suite), test-setup.ts gains a beforeEach macrotask drain (lets worker RPC replies settle between tests), and event-loop-yield.test.ts is a new 33-line harness that proves the drain works under both real and fake timers. The harness is a nice minimal witness — it would fail under a regression that breaks the drain.
No blockers. Both scopes are PR-caused and bounded. The verification report at 10-16 07:51 records 37/37 passes on the CI-routing test plus the new yield harness.
中文
COMMENT — 在 head 3066a0e12a 上的代码评审。两个不相关的范围共享这张 PR;两边都干净。
范围 1 — CI 路由修复。 push 事件被加进 classify_pr 的 runs-on 表达式,让 post-merge 分类器跟它喂的 Test job 走同一个 ECS 池。旧的「push 故意留在 hosted」测试被正确删掉,换成「两半在 push 上一致」的断言。ci.yml 里关于故意不对称的注释也一并删掉。两边改动一致,测试重写比原版更紧。
范围 2 — 测试基建加固。 MainContent.test.tsx 加了 afterEach(cleanup),test-setup.ts 加了 beforeEach 宏任务 drain,event-loop-yield.test.ts 是新的 33 行 harness。无阻塞,两个范围都是 PR 引入且有界。
|
Confidence: 4/5 — clean, minimal, and it reuses a mitigation this repo already proved rather than inventing one; the nits are real but none is a reason to hold it, and the only thing between this and an approval is the Linux suite still running. Stepping back, the scope question I raised at the gate turned out to be my misreading, not the PR's. The routing fix I would merge without hesitation. I traced the mechanism in the base YAML instead of trusting the description, and the story holds: the gate had no What keeps this at 4 rather than 5 is small, and I don't want to overstate it:
None of that is worth another round, and I'd rather name it than manufacture a blocker out of it. Verdict: approve. The Linux 中文说明Confidence: 4/5 —— 干净、最小化,并且复用了本仓库已经验证过的缓解手段而非另造一套;那些小问题是真实存在的,但没有一个构成拦下它的理由,而它与"批准"之间唯一的距离就是仍在运行的 Linux 套件。 退一步看,我在 gate 阶段提出的"范围"问题,结果是我读错了,而不是 PR 的问题。 路由修复我会毫不犹豫地合入。我是在 base 分支的 YAML 里自己追出了机制,而不是采信描述,而这个故事是成立的:闸口任务没有 让它停在 4 分而不是 5 分的地方都很小,我也不想夸大:
这些都不值得再来一轮,我更愿意把它们说出来,而不是从中硬造一个阻断项。 结论:批准。该提交上的 Linux — Qwen Code · qwen3.8-max-2026-09-02 Reviewed at |
chiga0
left a comment
There was a problem hiding this comment.
No blocking findings.
Approval blockers: none.
Tier: Standard — two independent scopes: CI YAML routing and test infrastructure.
Checked:
- CI routing correctness (Class 10 / stated intent): Adding
|| github.event_name == 'push'toclassify_pr'sruns-onexpression aligns the classifier with the downstreamTestjobs. The old asymmetry (classifier hosted, jobs on ECS) caused ECS-bound jobs to queue behind a late classifier, confirmed by the "49m32s" wait cited in the PR body. - Test expression coverage (Class 5): The
evalRunsOnsubstitution table now includes[/github\.event_name == 'push'/, ...], which was previously absent — meaning the old routing tests silently skipped evaluating the push condition in the expression. The updated testroutes the push classifier and downstream jobs to the same poolevaluates bothevalRunsOnandrunPickRunnerunder ECS-enabled and kill-switched modes. - Event-loop yield (
test-setup.ts):realSetTimeoutis captured before any test suite can install fake timers. ThebeforeEachmacrotask boundary runs after each test, allowing queued worker RPC replies to drain before the next assertion window opens. The newevent-loop-yield.test.tsproves the boundary works under both real and fake timer modes with a concretemacrotaskRanflag. MainContent.test.tsxcleanup:afterEach(cleanup)prevents stale ink renders from leaking across tests. Consistent with Ink testing best practice.- Cross-check: yiliang114 COMMENTED (no blockers) confirming 37/37 passes on the CI-routing test and the new yield harness.
Not covered: Windows runner behavior not exercised (no test coverage claimed for Windows); workflow_dispatch routing asymmetry explicitly scoped out per author.
Reviewed with AI assistance.
qwen-code-review-bot
left a comment
There was a problem hiding this comment.
LGTM, looks ready to ship — CI landed green after the review. ✅
|
Released in v0.25.3. |
What this PR does
Run the post-merge classifier on the ECS Linux pool when ECS is enabled, matching downstream Linux jobs. The existing disable switch still selects GitHub-hosted Linux.
Let CLI test workers take a real event-loop turn between tests so queued progress replies can drain, including when a suite installs fake timers. Clean up mounted replay-test fixtures between tests so the yield cannot expose stale renders from an earlier test. Unhandled errors remain fatal.
Why it's needed
A main push queued its classifier on hosted Linux for 49m32s before doing four seconds of work, blocking the downstream ECS jobs. Separately, synchronous test batches can prevent workers from processing progress replies. The worker-yield change also exposed a reproducible fixture leak: earlier mounted components wrote to a shared spy during a later model-change assertion.
Reviewer Test Plan
How to verify
For a main push, the classifier and downstream Linux jobs should both choose ECS when enabled and hosted Linux when disabled. Trusted/untrusted PR routing should retain its existing behavior.
A real macrotask queued by one synchronous CLI test should finish before the next test, both with real and fake timers. The progressive-replay model-change guard should still retain all 203 items; a real model-triggered reset must fail it.
Evidence (Before & After)
The historical push classifier queued 49m32s and executed for four seconds. The local routing regression evaluates the real workflow expression and executes the downstream shell selector (39 checks pass).
At
fffb13ace0, the model-change fixture failed 3/3 paired runs with worker yielding, and passed 3/3 with the original setup. Adding fixture cleanup makes all 33 replay tests and four yield tests pass. A controlled mutation that actually resets replay on model change still fails the retained 203-item assertion (53 received), so cleanup does not weaken the guard.Application UI verification: N/A. The changed consumers are the Actions scheduler and Vitest's test-only setup; no product CLI/Web renderer or outbound product protocol changes. Live post-merge queue latency needs this workflow to land.
Tested on
Environment (optional)
Node 22.23.2, Vitest 3.2.7, isolated worktree. The current main was merged to supply the CI-budget script invoked by the base workflow. Full Linux CLI CI is not claimed locally. A fresh source review found no blocker. The earlier Qwen automated review timed out and remains unverified.
Risk & Scope
Linked Issues
Fixes #14219
中文说明
本 PR 的修改
ECS 开启时,将合并后的分类任务放到 ECS Linux 池,与下游 Linux 任务一致;既有禁用开关仍选择 GitHub 托管 Linux。
让 CLI 测试 worker 在测试之间运行一轮真实事件循环,以处理排队的进度回复,安装虚拟时钟也适用。同时在每个测试后清理已挂载的 replay 测试组件,防止新增 yield 暴露上一个测试的旧渲染。未捕获错误仍然阻断。
修改原因
一次 main push 的分类任务在托管 Linux 排队 49 分 32 秒,实际只执行四秒,下游 ECS 任务必须等待。另一个问题是同步测试批次可能阻塞进度回复的处理。新增 worker yield 还暴露了可复现的 fixture 泄漏:早先挂载的组件在后一个模型切换断言中继续写共享 spy。
Reviewer Test Plan
如何验证
main push 在 ECS 开启时,分类与下游 Linux 任务均应选择 ECS;禁用时均应选择托管 Linux。可信及不可信 PR 路由保持既有行为。
一个同步 CLI 测试排入的真实宏任务应在下一个测试前完成,真实和虚拟时钟均适用。渐进回放的模型切换 guard 应保留全部 203 项;真实的模型触发重置必须使它失败。
前后证据
历史 push 分类任务 排队 49 分 32 秒,执行四秒。本地路由回归直接求值真实 workflow 表达式,并执行下游 shell 选择器,39 项检查通过。
fffb13ace0上,模型切换 fixture 在 worker yield 下连续三次失败,使用原 setup 则连续三次通过。补充 fixture cleanup 后,33 项 replay 测试及四项 yield 测试通过。受控注入真实的模型切换重置后,保留的 203 项断言仍失败(实际 53 项),证明 cleanup 没有削弱 guard。应用 UI 验证不适用:消费者是 Actions 调度器及 Vitest 专用 setup,不改变产品 CLI/Web 渲染或产品出站协议。真实的合并后排队延迟需等工作流合入。
测试平台
环境
Node 22.23.2、Vitest 3.2.7,独立 worktree。已合并当前 main,补齐 base workflow 调用的 CI 预算脚本。不声称本地运行了完整 Linux CLI CI。新的源码 review 未发现阻塞问题;此前 Qwen 自动 review 超时,仍为未验证。
风险与范围
关联 Issue
Fixes #14219