Skip to content

fix: defer CI self-repair instead of dispatching into a claim it can't win - #488

Merged
getappz merged 1 commit into
masterfrom
task/114-ci-self-repair-burns-its-3-attempt-cap-d
Aug 14, 2026
Merged

fix: defer CI self-repair instead of dispatching into a claim it can't win#488
getappz merged 1 commit into
masterfrom
task/114-ci-self-repair-burns-its-3-attempt-cap-d

Conversation

@getappz

@getappz getappz commented Aug 13, 2026

Copy link
Copy Markdown
Owner

Summary

  • self_repair_or_gate only 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."
  • The sweep would dispatch anyway; the job died instantly at its own claim-acquire step in execute_work, but the attempt still counted against SELF_REPAIR_CAP and posted a "CI self-repair dispatched" comment for work that never had a chance to run.
  • Added a claim-liveness check (same effective_ttl_secs/has_active_claim_by_other helpers 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, return Deferred (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 new self_repair_or_gate_defers_instead_of_dispatching_into_a_still_live_claim test asserting Deferred, no job dispatched, and no marker comment posted (so it can't count against the cap)
  • cargo build --workspace
  • cargo clippy --bin agentflare -- clean on changed files

…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
@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 35 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 8766a96b-df9f-4762-bdd3-43e70917d6bb

📥 Commits

Reviewing files that changed from the base of the PR and between b20bcd2 and 0fe47c4.

📒 Files selected for processing (2)
  • src/supervisor.rs
  • src/supervisor_tests.rs

Comment @coderabbitai help to get the list of available commands.

@getappz
getappz merged commit c7650f1 into master Aug 14, 2026
17 checks passed
@getappz
getappz deleted the task/114-ci-self-repair-burns-its-3-attempt-cap-d branch August 14, 2026 06:13
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