Skip to content

Make auto-review denial short-circuit use a rolling review window#22110

Merged
won-openai merged 2 commits into
mainfrom
ar-roll-window
May 11, 2026
Merged

Make auto-review denial short-circuit use a rolling review window#22110
won-openai merged 2 commits into
mainfrom
ar-roll-window

Conversation

@won-openai
Copy link
Copy Markdown
Collaborator

Why

Long-running turns can accumulate enough denied auto-review decisions to trip the global short-circuit even when those denials are spread far apart. The breaker should still stop genuinely bad loops, but it should judge recent behavior instead of lifetime turn history.

What changed

  • Replaced the lifetime 10 total denials threshold with 10 denials in the last 50 reviews.
  • Kept the existing 3 consecutive denials interrupt behavior unchanged.
  • Tracked recent auto-review outcomes in the circuit breaker and updated the warning copy to report the rolling-window count.
  • Renamed the new rolling-window coverage to auto_review_* test names.
  • Added coverage that confirms older denials fall out of the 50-review window and no longer trigger the breaker.

Validation

  • just fmt
  • cargo test -p codex-core guardian_rejection_circuit_breaker --lib
  • cargo test -p codex-core auto_review_rejection_circuit_breaker --lib

@won-openai won-openai requested a review from a team as a code owner May 11, 2026 07:23
@won-openai won-openai merged commit 0dbad2a into main May 11, 2026
26 checks passed
@won-openai won-openai deleted the ar-roll-window branch May 11, 2026 18:03
@github-actions github-actions Bot locked and limited conversation to collaborators May 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants