Make HTTP retry behavior configurable - #1227
Open
asonnenschein wants to merge 6 commits into
Open
Conversation
Accept max_retries and max_retry_backoff as constructor keyword arguments, defaulting to the existing module-level constants so behavior is unchanged. A max_retries of zero disables retry. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Add --max-retries and --max-retry-backoff to the root command group and pass them through CliSession. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Threshold the base wait before adding jitter so thresholded waits are jittered instead of collapsing to one value. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Add max_retry_jitter to Session and --max-retry-jitter to the CLI. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
asonnenschein
force-pushed
the
adrians/retry-config
branch
from
September 10, 2026 16:09
aaf7c33 to
96b4884
Compare
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.
Adds configurable options for HTTP retry attempts, backoff seconds, and jitter seconds. Keeps original constant values as default if not explicitly configured.
Changes
max_retries,max_retry_backoff, andmax_retry_jitter, each falling back to the module default.max_retries=0disables retrymax_retry_jitter=0makes waits deterministic.max_retry_backoff - jitterand jitter added afterward, so every wait is jittered and the cap still holds.--max-retries,--max-retry-backoff,--max-retry-jitter, passed through to the session viaCliSession._calculate_waitedge cases; an integration test asserting--max-retries0 prevents a retry.