Repository navigation
feat: env-tunable 529 retry budget for headless runs - #352
Merged
Merged
Conversation
Headless -p dispatches hard-fail after 3 consecutive 529s (MAX_529_RETRIES) while claude code rides the same transient capacity cascade out with ~10 attempts — console worker fleets see a failed task for what is a blip. Add FUSION_CODE_MAX_529_RETRIES: operators raise the budget for foreground/headless sources (capped at DEFAULT_MAX_ RETRIES=10 so a stuck gateway still terminates the turn). Default stays 3 for interactive REPL use; background sources keep bailing immediately (anti-amplification rationale unchanged). Tests: default 3-strike fail preserved; budget=10 rides out 5 strikes; budget clamped to 10. Full suite 1849 pass / 0 fail. Co-Authored-By: Claude Code <[email protected]>
dahai80
force-pushed
the
fix-529-retry-budget
branch
from
November 26, 2026 11:07
84f54cf to
431fe1c
Compare
Owner
Author
|
Rebased onto main after #350 (which shipped the first iteration of this fix in v0.8.32). Conflict resolved in favor of this branch's semantics: budget capped at DEFAULT_MAX_RETRIES=10 so a stuck gateway still terminates the turn, values below 1 fall back to the default, helper exported for unit tests. Added a cap/fallback adjustment to the withRetry.test.ts expectations; both test files pass (8 cases), typecheck + lint + 1309-test suite green. |
This was referenced Nov 26, 2026
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.
Fixes #349 (option 1 — minimal surgical fix).
Problem
Headless
-pdispatches hard-fail after 3 consecutive 529s (MAX_529_RETRIES) while claude code rides the same transient capacity cascade out with ~10 attempts and exponential backoff. A console worker fleet sees a failed task for what is a blip;claudeworkers on the same gateway at the same time all completed.Change
FUSION_CODE_MAX_529_RETRIESenv override of the 529 strike budget for foreground/headless sources, clamped toDEFAULT_MAX_RETRIES(10) so a stuck gateway still terminates the turn.Tests
New
withRetry529.test.ts(backoff sleep stubbed): default 3-strike hard fail preserved; budget=10 rides out 5 strikes and returns ok; budget=999 clamps to 10. Full suite 1849 pass / 0 fail, tsc clean.🤖 Generated with Claude Code