Skip to content

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

Open
won-openai wants to merge 2 commits intomainfrom
ar-roll-window
Open

Make auto-review denial short-circuit use a rolling review window#22110
won-openai wants to merge 2 commits intomainfrom
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
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