Skip to content

fix(retry): honor configured predicate vetoes - #30

Closed
xiehuanyi wants to merge 1 commit into
cased:mainfrom
xiehuanyi:fix/retry-predicate-veto
Closed

xiehuanyi wants to merge 1 commit into
cased:mainfrom
xiehuanyi:fix/retry-predicate-veto

Conversation

@xiehuanyi

Copy link
Copy Markdown

A predicate supplied through RetryConfig.should_retry cannot stop retries: returning False falls through to the default True decision. An operation that explicitly should not be repeated therefore runs three times with max_retries=2. The runtime-assigned predicate already honors its result.

Honor both boolean results from the configured predicate. Preserve the existing error fallback when the predicate itself raises. Correct the existing conditional-predicate test, whose comment says odd attempts must stop retrying but whose assertion previously expected all four calls to succeed.

Validation: the new regression fails on main with three calls and passes with one. All 209 offline tests pass (1 credential-dependent skip, 30 integration tests deselected), and full Ruff/Black pass. Mypy retains the unchanged base's 57 advisory diagnostics. No provider service was contacted.

AI assistance: implemented and tested with Codex.

Copilot AI balanced review requested due to automatic review settings October 6, 2026 16:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@xiehuanyi xiehuanyi closed this Oct 10, 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.

2 participants