Repository navigation
fix(overflow): breaker counts the overflow, not the step; reset() stops claiming an archive (4.2.1) - #55
Merged
Conversation
…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.
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.
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(). Withchain(summarize(), reset()), every summary failure thatreset()rescued still counted; after three the open breaker returned before calling the strategy at all, soreset()never ran again and the window stayed over budget for the session. The runner now resets the count on any result withchanged: true;summarize()drops its ownsucceed()call;background()still credits an off-turn success whose result was discarded as stale, as 4.2.0 did.reset()default noticeIt 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).