feat: review cycle circuit breaker with configurable max iterations - #288
Merged
Conversation
10 tasks
Instead of closing the pipeline when the review cycle limit is hit, the circuit breaker now force-approves so a PR is still raised for human review. The max review cycles are configurable per-project via Project.max_review_cycles (default 3). When the breaker trips, the PR body includes a warning section, and an audit event is emitted for notification rules. Co-Authored-By: Claude Opus 4.6 <[email protected]>
bamdadd
force-pushed
the
feat/review-circuit-breaker
branch
from
April 7, 2026 17:14
c2c7858 to
fbaea67
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MAX_REVIEW_CYCLES=5with configurable per-projectmax_review_cycles(default 3) onProjectdataclass:warning: Review Circuit Breakersection when the breaker tripsreview_circuit_breaker_trippedemitted for notification/guardrail rulesThreadWorkflowState(max_review_cycles,review_circuit_breaker_tripped)setup_workspaceresolves per-project max from project storeChanges
packages/domain/src/lintel/domain/types.py— addmax_review_cyclesfield toProjectpackages/workflows/src/lintel/workflows/feature_to_pr.py—_resolve_max_review_cycles(), force-approve on trippackages/workflows/src/lintel/workflows/change_request.py— use configurable maxpackages/workflows/src/lintel/workflows/builtins.py— use configurable max, force-approvepackages/workflows/src/lintel/workflows/state.py— addmax_review_cycles,review_circuit_breaker_trippedpackages/workflows/src/lintel/workflows/nodes/review.py— detect trip, emit audit eventpackages/workflows/src/lintel/workflows/nodes/close.py— add warning section to PR bodypackages/workflows/src/lintel/workflows/nodes/setup_workspace.py— read from project storeTest plan
test_circuit_breaker_force_approves_at_limit— verifies force-approve at max cyclestest_circuit_breaker_respects_per_project_max— per-project override workstest_revises_when_under_per_project_max— higher max allows more cyclestest_resolve_max_review_cycles— default, override, string coerciontest_includes_warning_when_tripped— PR body contains circuit breaker warningtest_no_warning_when_not_tripped— no warning in normal flowtest_review_decision_respects_per_project_max(change_request graph)🤖 Generated with Claude Code