Skip to content

test: pin the overflowArmTokens RELEASE direction + restart round-trip (#1129) - #1142

Merged
ranxianglei merged 1 commit into
masterfrom
2026-09-22_overflow-arm-release-pin
Sep 22, 2026
Merged

ranxianglei merged 1 commit into
masterfrom
2026-09-22_overflow-arm-release-pin

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Fixes #1129

Context

PR #1111 (side-request guard must not clamp on the host usage baseline) is merged into master, but the follow-up test pins it carried (PR #1132, merged into #1111's branch at b583bbe just before that branch landed) were stranded: git merge-base --is-ancestor b583bbe origin/master is false — master got #1111's fix commit without the pin commit. This PR re-lands equivalent pins directly on current master (945a161).

What was missing

The ARMING direction of the one-shot overflow arm was already pinned (#554 / #1110 tests), but the RELEASE direction rested on three bare delete session.stats.overflowArmTokens writes — streaming src/loop/core.ts, non-streaming src/server.ts, plugin src/plugin.ts — plus the resetSessionCompression reset, with no regression net. A refactor mis-gating any of them would 413 side requests permanently: the #1110 deadlock shape re-entered through the overflow path.

Pins added (existing side-request rig, tests/side-request-isolation.test.ts)

  1. Release direction (streaming): arm via overflow 400 (stated 120k window) → identical side request 413s locally → one healthy MAIN turn's real usage report retires the arm → the same oversized-but-fits-declared-window side request FORWARDS again (upstream hit count proves it).
  2. Restart round-trip: armed session flushAll() → memory cleared → fresh SessionStore over the same dir → still 413 after the loadSync reload path (arm restored from disk) → usage report releases it → forwards again.

Pin validation

Temporarily commenting out the core.ts delete fails exactly these two tests (12 pass / 2 fail); restored, the file is green 14/14.

Gates

  • typecheck ✅
  • full suite 2220 pass / 0 fail / 2 skipped (E2E-gated) ✅
  • build ✅

Rig change is additive only: startRig accepts an optional store (default unchanged: disabled store).

#1129)

The ARMING direction of the one-shot overflow arm was pinned (#554/#1110
tests) but the RELEASE direction rested on three bare
`delete session.stats.overflowArmTokens` writes (streaming src/loop/core.ts,
non-streaming src/server.ts, plugin src/plugin.ts) with no regression net —
a refactor mis-gating any of them would 413 side requests permanently.

Adds two e2e pins on the existing side-request rig:
- arm -> local 413 -> healthy main turn's REAL usage report retires the arm
  -> the same oversized-but-fits-declared-window side request FORWARDS again.
- restart round-trip: armed session flushAll -> memory cleared -> fresh store
  over the same dir -> still 413 after loadSync reload -> usage releases ->
  forwards again.

Pin validated by temporarily removing the core.ts delete: exactly these two
tests fail (12 pass / 2 fail), restored green (14/14).
@github-actions

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-09-22_overflow-arm-release-pin (3cc36bc)

Option A — Install from npm PR tag (recommended)

npm install -g billion-context@pr-1142

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

Option B — Download artifact

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

Install instructions are refreshed on each push.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 收到。这是 [PR] 类 issue(跟踪 PR #1142),按规范不重做工作,改为:拉取分支核对代码、核对 CI 状态、复跑门禁(typecheck / test / build),然后给出结论。正在处理中。

@ranxianglei
ranxianglei merged commit cfe2276 into master Sep 22, 2026
8 checks passed
@ranxianglei
ranxianglei deleted the 2026-09-22_overflow-arm-release-pin branch October 15, 2026 05:32
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.

test: pin the overflowArmTokens one-shot RELEASE direction (arm → real usage report → cleared → side request forwards again) + restart round-trip

1 participant