Repository navigation
修 flaky 测试:vscode 取消用例改为真实的『读着读着中断』形状 - #3430
Merged
Merged
Conversation
…lient shape) Scheduled full run 38896091237 (83197e9, windows-24 shard 1) went red on 'upstream fetch was not aborted after client cancel'; the same commit reran green on the same leg — flake, not a regression. The racy shape was the test's own: for-await break first (iterator return() cancels the body), abort() after — at that point nothing is pending on the signal and undici can leave the client socket up instead of destroying it; the proxy then never sees res 'close' within the 5s poll window. Read exactly one chunk, then abort while the body is still active (what a real vscode cancel does), then cancel the reader. 8/8 green locally, tsc clean.
Contributor
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.4035-pr.3430.054d7f3This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr3430.tgz
npm install -g packageInstall instructions are refreshed on each push. |
Contributor
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.497-master.ce9bc90 # this exact build
npm install -g billion-context@master # always the newest merged build
|
This was referenced Oct 16, 2026
ranxianglei
pushed a commit
that referenced
this pull request
Oct 16, 2026
…nt refs at #2960⑥ Review fix-up for the config-epoch guard: the staleEffectiveStamp docstring claimed the epoch hashes the resolved path (cross-instance stamps never validate), which contradicts the implementation (sha256 of file CONTENT — byte-identical files do validate, tests/config-epoch.test.ts case 4) and the configFileEpoch docstring. Also re-point the '#3430' references: that number is the unrelated vscode cancel-flake PR; the incident class is tracked as ⑥ on #2960.
This was referenced Oct 16, 2026
LoveDoLove
pushed a commit
to LoveDoLove-Forked-Projects/billion-context
that referenced
this pull request
Oct 17, 2026
…ch (ranxianglei#3430) Every wire request stamps metadata.effectiveConfig, but the stamp only refreshed on the NEXT wire request — tool-path readers (plugin tool API, status panels, nudge re-anchor) kept executing settings the user had already deleted from the config file, and a session on a multi-instance machine could carry a foreign instance's stamp for days (the October externalSummary incident: a user-disabled summary chain kept running). - configFileEpoch() (src/config.ts): sha256 of the live config file content — content-keyed so byte-identical files validate cross-instance while any edit diverges; cost mirrors loadConfigFile()'s per-call read. - storeEffectiveConfig stamps metadata.effectiveConfigEpoch next to the snapshot; forks inherit the key (plugin.ts copy list). - effectiveConfig refuses the snapshot when the epoch no longer matches and re-resolves the live file tier (global compress.*, including externalSummary) onto the fallback; provider/model cascade levels are deliberately re-stamped by the next wire request (they need the request URL). The nudge growth-margin reader takes the same guard. - Legacy snapshots without an epoch keep the old merge semantics. - Goldens re-pinned: metadata digest gains the epoch key only.
Merged
This was referenced Oct 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
现象
定时全量 run 38896091237(head 83197e9,windows-24 shard 1)唯一红腿:
vscode-copilot #177 (2): client cancel aborts upstream and frees the session lock,断言 `upstream fetch was not aborted after client cancel`。定性:flaky,不是回归
根因(测试自身的竞态形状)
旧写法 `for await ... break` 先触发迭代器 return()(= 取消 body),之后才 `abort()` —— 此时 signal 上没有任何 pending 操作,undici 在 Windows runner 上可以不销毁客户端 socket,代理侧 `res 'close'` 等 5 秒等不到,上游 socket 一直被按住 → 断言超时。真实的 vscode 取消从来不是这个形状:用户取消时 abort 直接打在正在读的流上。
修法
读到一个非空 chunk 后,body 仍活跃时直接 `abort()`(真实客户端形状),再 cancel reader。本地 8/8 绿,tsc 干净。