Skip to content

fix(overflow): breaker counts the overflow, not the step; reset() stops claiming an archive (4.2.1) - #55

Merged
MyPrototypeWhat merged 1 commit into
mainfrom
claude/patch-4.2.1
Sep 7, 2026
Merged

MyPrototypeWhat merged 1 commit into
mainfrom
claude/patch-4.2.1

Conversation

@MyPrototypeWhat

Copy link
Copy Markdown
Owner

Two overflow fixes surfaced while fact-checking the 4.2 announcement. Patch release: no public API change, golden suite byte-identical.

Circuit breaker vs chain(summarize(), reset())

Failure accounting is the runner's, but only the summarizing strategies ever called succeed(). With chain(summarize(), reset()), every summary failure that reset() rescued still counted; after three the open breaker returned before calling the strategy at all, so reset() never ran again and the window stayed over budget for the session. The runner now resets the count on any result with changed: true; summarize() drops its own succeed() call; background() still credits an off-turn success whose result was discarded as stale, as 4.2.0 did.

reset() default notice

It said "Earlier conversation was archived." unconditionally. Archiving is opt-in; without it the span is gone and the model was being told otherwise. The notice now says the window was cleared, and the runner's citation line — which already carries the address — is the only place the archive fact is stated.

Verification

build ×3, typecheck ×4, lint 228 files, tests core 1362 / tanstack 120 / ai-sdk-middleware 138, git status packages/core/tests/golden/ empty, changeset status → core patch (+ dependents). Regression tests fail against 4.2.0 for both fixes (verified by reverting).

…ps claiming an archive

The runner zeroes its consecutive-failure count on any result that changed
the window, whichever strategy did the work. Only the summarizing strategies
ever reported success, so chain(summarize(), reset()) — reset() rescuing a
failed summary — banked every rescued failure, and after three the open
breaker stopped calling the strategy at all: reset() never ran again and the
window stayed over budget for the rest of the session. summarize() no longer
calls succeed() itself (one owner for the counter); background() still
credits a job whose model succeeded but whose result was discarded as stale,
as 4.2.0 did.

reset()'s default notice said the earlier conversation "was archived"
whether or not an archive was configured. It now says the window was
cleared; the runner's citation line carries the archive fact, with the
address, when there is one.
@MyPrototypeWhat
MyPrototypeWhat merged commit 5d34f35 into main Sep 7, 2026
2 checks passed
@github-actions github-actions Bot mentioned this pull request Sep 7, 2026
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