Repository navigation
chore(core): wrap two over-width cancellation assertions - #11232
Conversation
#10180 lengthened two assertion strings in the cancellation-message tests past the 80-column print width and reached main without a format pass. The Prettier lane had flipped from `--write` to `--check` four minutes earlier in #11117, and that PR's own green lint run predated the flip by seventeen hours, so nothing caught it until the post-merge push run failed and skipped every step downstream of the gate. Whitespace and trailing commas only: the file's normalized token stream is byte-identical to its parent, and both enclosing tests still execute and pass.
qqqys
left a comment
There was a problem hiding this comment.
APPROVE (verified at head cb47b95)
Pure formatting: the two over-width cancellation assertions from #10180 are wrapped onto continuation lines with the string literals byte-identical ('User intentionally cancelled this tool call.' and the negative '… Stop' discriminator unchanged), so the assertions' semantics are provably untouched by reading the diff itself. No review history exists on this PR yet, and CI shows 7 green with zero failures (the remaining lanes are still queued/running from the fresh push — non-gating; the changed file belongs to the packages/core suite that those lanes execute).
|
Answering all three stage comments in one place — issue comments here are flat, and three separate replies would put three notifications on an already-merged PR. Nothing in the diff changes; this is about the record. Stage 1 — the correction is right, and my sentence was wrong as writtenI enumerated the jobs of the Where that red stands now, since it bears on whether anyone should still expect it: it did not persist past the merge, and it has not come back. Counting every Stage 2 — closing the item you explicitly left unverifiedYou recorded that you could not verify "whether Confirmed from the branch side as well: step 25 is One thing your table could not show, because it happened after you read it: Stage 3 — the deferred approval never resolved, and the reason is worth recordingNo commit-pinned approval landed on The gate waited for a result that infrastructure was never going to produce, and the shape of that failure matters for whoever reads it next: the Where the gate stands since, counted rather than sampled — again as of this writing,
On the follow-up this PR declined to bundle — a required check whose green result was computed before a base-branch workflow change made that check stricter — I agree with your reading that it is a merge-path property and does not belong in an eight-line gate fix. It is still unaddressed. The four hours after this PR opened surfaced a second gap, and I would rather name the difference between them than fold them together. The one this PR raised is a stale green being trusted. Yours is a deferral that never reached either of its two outcomes: you wrote that the approval would follow automatically once every check completed green, and that it would be "withheld and flagged here" if anything landed red. |
What this PR does
Wraps two assertions in the tool-cancellation tests whose string arguments outgrew the 80-column print width, putting each argument on its own line. Whitespace and two trailing commas only — no token changes, no behaviour change. This is Prettier's own output for the file, nothing hand-written.
Why it's needed
mainis red. The push run for62588d2892(run 34070970087) died inLint & Staticat the Prettier step:Every step behind that gate in the job was skipped, and every job that
needsit was skipped too, so two long lines turned the whole run red.Test (ubuntu-latest)passed in the same run, so this is the only thing standing betweenmainand green.How it landed is a race rather than carelessness. The cancellation-message rewrite lengthened two short assertion strings into long ones and reached
mainwithout a format pass — but the green check that authorized the merge was produced seventeen hours earlier, under a Prettier lane that ranprettier --write .and exited 0 no matter what it rewrote. Four minutes before the merge, that lane flipped toprettier --check ., and nothing re-ran CI in between. ESLint cannot cover the gap: the shared config loadseslint-config-prettier, which disables formatting rules instead of enforcing them, so the lane that just became strict was the only enforcement point outside the pre-commit hook.Reviewer Test Plan
How to verify
node scripts/lint.js --prettier. Before this PR it names the one file above and exits 1; after, it printsAll matched files use Prettier code style!and exits 0.cd packages/core && npx vitest run src/core/coreToolScheduler.test.ts→ 406 passed, 0 skipped.cd packages/core && npx vitest run src/core/coreToolScheduler.test.ts -t 'tells the model a'→ 2 passed, 404 skipped.Evidence (Before & After)
N/A — non-user-visible formatting change. The gate output above is the before/after.
Tested on
Environment (optional)
Node 22.22.2,
npm run build --workspace=packages/corethen vitest, no sandbox involved.Risk & Scope
Check serve fast-path bundle closureandCheck VS Code companion notices are up-to-datefail locally because@tanstack/react-tableis absent fromnode_modules— the same reason a local full build stops at the web-shell package, and unrelated to this diff.Run .github/scripts helper testsfails 42 subtests locally on macOS because the flakiness gate's integrity checks call GNUstat -cwith no BSDstat -ffallback, while CI runs them on Ubuntu. All three are pre-existing local artifacts, not regressions: the helper tests fail identically at7567824d4c, the lastmaincommit whoseLint & Staticrun was green, and no triage or flake file changed between there and this branch. The other six steps behind the gate pass locally — sensitive keyword linter, i18n check, settings schema generation, settings schema freshness, notices generation, and core subpath exports — as do ESLint on the touched file andtsc --noEmiton the touched package, neither of which sits behind the gate.mainrather than on the PR.Linked Issues
Refs #11109, the issue behind the Prettier gate that made this failure visible. Does not close it.
中文说明
这个 PR 做了什么
把工具取消相关测试里两个字符串实参超出 80 列打印宽度的断言换行,让每个实参各占一行。只涉及空白字符和两个尾逗号——没有 token 变化,没有行为变化。这就是 Prettier 对该文件自己的输出,没有任何手写内容。
为什么需要
main现在是红的。62588d2892的 push run(run 34070970087)在Lint & Static的 Prettier 步骤挂掉:该 job 里 gate 之后的所有步骤被跳过,所有
needs它的 job 也被跳过,于是两行超长代码把整个 run 染红。同一次 run 里Test (ubuntu-latest)是成功的,所以这是main转绿之前唯一的障碍。它是怎么进 main 的:这是一次时序竞态,而不是谁不小心。取消提示语的改写把两个短断言字符串变长了,进
main前没有跑格式化——但授权那次合并的绿灯是十七小时前产出的,当时 Prettier lane 跑的还是prettier --write .,无论重写了什么都退出 0。合并前四分钟,这条 lane 翻成了prettier --check .,而中间没有任何东西重跑 CI。ESLint 补不上这个缺口:共享配置加载了eslint-config-prettier,它是关闭格式规则而不是强制执行,所以刚刚变严格的这条 lane 是 pre-commit hook 之外唯一的强制点。Reviewer 测试计划
如何验证
node scripts/lint.js --prettier。本 PR 之前它会点名上面那个文件并退出 1;之后输出All matched files use Prettier code style!并退出 0。cd packages/core && npx vitest run src/core/coreToolScheduler.test.ts→ 406 passed,0 skipped。cd packages/core && npx vitest run src/core/coreToolScheduler.test.ts -t 'tells the model a'→ 2 passed,404 skipped。证据(Before & After)
N/A——非用户可见的格式改动。上面的 gate 输出就是 before/after。
测试环境
运行环境(可选)
Node 22.22.2,
npm run build --workspace=packages/core之后跑 vitest,不涉及 sandbox。风险与范围
Check serve fast-path bundle closure和Check VS Code companion notices are up-to-date在本地失败,原因是node_modules里缺@tanstack/react-table——这也是本地全量构建停在 web-shell 包的原因,与本 diff 无关。Run .github/scripts helper tests在 macOS 本地失败 42 个子测试,因为 flakiness gate 的完整性校验调用 GNUstat -c且没有 BSDstat -f回退,而 CI 是在 Ubuntu 上跑它们的。这三个都是既有的本地环境产物,不是回归:helper tests 在7567824d4c(Lint & Static上一次全绿的maincommit)上失败情况完全相同,且从那以后到这个分支之间没有任何 triage 或 flake 文件被改动。gate 之后其余六个步骤本地全部通过——敏感词 linter、i18n 检查、settings schema 生成、settings schema 新鲜度、notices 生成、core subpath exports;被改动文件的 ESLint 与被改动包的tsc --noEmit也通过,这两者都不在 gate 之后。main上,不是 PR 上。关联 Issue
Refs #11109,即让这次失败显现出来的 Prettier gate 背后的 issue。不关闭它。