fix(loop): client abort miscounted as weak overflow signal - #910
Merged
Merged
Conversation
A client abort breaks the parse loop at the signal check with !sawDone && streamError === undefined — the same shape as a truncation. Three ESCs inside 15min armed a shrunken window (MIN_EVENTS=3) that throttles the session below its true window (#570 false-positive family). Refs #906. Re-lands the loop half of #909 on master (the opencode-local half is superseded — see #909 close reason).
Contributor
📦 Built Package ArtifactBranch: Option A — Install from npm PR tag (recommended)npm install -g billion-context@pr-910Each push to this PR publishes a new version under the Option B — Download artifact
tar xzf billion-context-pr910.tgz
npm install -g packageInstall instructions are refreshed on each push. |
This was referenced Sep 17, 2026
Open
Merged
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.
What
runCompressLoopcounted a client abort as a weak-overflow signal: an abort breaks the parse loop at the signal check with the same shape as a truncation (!sawDone && streamError === undefined). Three ESCs inside 15 min armed a shrunken learned window (MIN_EVENTS=3) that throttles the session below its true window (#570 false-positive family).Fix: guard the weak-overflow branch with
!signal?.aborted.Why a separate PR
This is the mode-independent loop half of #909, re-landed on master. #909's main body (the in-process opencode-local kernel) is superseded — we align opencode v2 on the
opencode-nativeself-spawn-proxy architecture (already in master via #885), which keeps the stream-layer echo stripping that an in-process kernel cannot have (tag-leak). The abort guard must not die with that branch. Refs #906.Test
New regression
#887 T1intests/loop-truncation.test.ts: aborted mid-stream cut → no weak-overflow log; identical cut without abort → counted (control).Pre-flight
npm run typecheck✅npm test→ 1720 tests, 0 fail ✅npm run build✅