Skip to content

Flatten asynchronous retry predicate chains - #709

Open
Str0k wants to merge 1 commit into
jd:mainfrom
Str0k:fix/flatten-async-retry-chains
Open

Str0k wants to merge 1 commit into
jd:mainfrom
Str0k:fix/flatten-async-retry-chains

Conversation

@Str0k

@Str0k Str0k commented Sep 12, 2026

Copy link
Copy Markdown

Chaining asynchronous predicates with | or & still nests retry_any / retry_all, despite the flattening introduced in #609. Evaluating a chain of 1,501 predicates raises RecursionError before reaching the leaves.

Flatten matching async containers from both sides of each operator. Keep synchronous operands inside the async container so they are evaluated through the existing async wrapper. Mixed operators retain their grouping.

Validation on Python 3.12 / Windows:

  • Four regression cases (OR/AND, left/right association) fail before the fix.
  • 190 tests and 15 subtests pass after the fix, including mixed sync/async short-circuit order checks.
  • Ruff lint/format and mypy pass for the project.
  • All 35 documentation examples pass; HTML documentation builds with warnings treated as errors.

Includes a Reno release note. Codex (GPT-6) assisted with implementation and testing.

Co-authored-by: Codex <noreply@openai.com>

This branch has not been deployed

No deployments
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