Skip to content

fix: honor an explicit zero retry limit in ClaudeAPIClient - #144

Open
00200200 wants to merge 1 commit into
anthropics:mainfrom
00200200:codex/security-zero-retry-limit
Open

00200200 wants to merge 1 commit into
anthropics:mainfrom
00200200:codex/security-zero-retry-limit

Conversation

@00200200

@00200200 00200200 commented Sep 14, 2026 •

Copy link
Copy Markdown

Passing max_retries=0 currently falls back to DEFAULT_MAX_RETRIES because zero is falsy. Preserve an explicit zero so callers can disable the wrapper retry loop, while None still uses the default. Tests check both successful calls and failed calls with zero, positive, and default retry settings. This changes the wrapper limit only; the Anthropic SDK keeps its existing retry configuration.

Validation: python -m pytest claudecode/test_api_retry_limit.py -q (4 passed in 0.42s). The regression tests fail on the unchanged main branch. Tests use local fixtures; no paid API calls.

Additional checks: python -m pytest claudecode -q.

Prepared with Codex assistance; the final diff and regression behavior were checked locally.

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