fix: defer CI self-repair instead of dispatching into a claim it can't win - #488
Conversation
…t win self_repair_or_gate only checked the local job queue for an in-flight dispatch, not the item-level claim ledger. A finished job's claim outliving its (#108-capped) in_review TTL looked like "nothing in flight", so the sweep dispatched anyway -- the job died instantly at its own claim-acquire step, still counting the attempt against the 3-try cap. Now it checks claim liveness before dispatching and defers (retrying next sweep) instead of burning a cap slot on an attempt that never had a chance. Agentflare-Agent: claude-code Agentflare-Branch: task/114-ci-self-repair-burns-its-3-attempt-cap-d Agentflare-Item: 114
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 35 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
Comment |
Summary
self_repair_or_gateonly checked the local job queue (job_in_flight) for a dispatch in progress -- it had no visibility into the item-level claim ledger, so a finished job's claim outliving its (Gateway: HTTP MCP backend, hardening (circuit breaker/audit/redaction), parallel reconnect #108-capped) in_review TTL looked like "nothing in flight."execute_work, but the attempt still counted againstSELF_REPAIR_CAPand posted a "CI self-repair dispatched" comment for work that never had a chance to run.effective_ttl_secs/has_active_claim_by_otherhelpers fix: cap claim TTL to the short default once an item reaches in_review #481 introduced) right before the actual dispatch: if the claim is still live, returnDeferred(matching the existing cooldown/host-policy deferral pattern) so the sweep retries next tick without burning the cap.Test plan
cargo test --bin agentflare supervisor::-- all 27 tests pass, including a newself_repair_or_gate_defers_instead_of_dispatching_into_a_still_live_claimtest assertingDeferred, no job dispatched, and no marker comment posted (so it can't count against the cap)cargo build --workspacecargo clippy --bin agentflare-- clean on changed files