Skip to content

fix(loop): client abort miscounted as weak overflow signal - #910

Merged
ranxianglei merged 1 commit into
masterfrom
2026-09-18_weak-overflow-abort-guard
Sep 17, 2026
Merged

ranxianglei merged 1 commit into
masterfrom
2026-09-18_weak-overflow-abort-guard

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

What

runCompressLoop counted 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-native self-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 T1 in tests/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 ✅

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).
@github-actions

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-09-18_weak-overflow-abort-guard (0ccd1e4)

Option A — Install from npm PR tag (recommended)

npm install -g billion-context@pr-910

Each push to this PR publishes a new version under the pr-910 npm tag.

Option B — Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr910.tgz
npm install -g package

Install instructions are refreshed on each push.

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.

1 participant