Skip to content

fix(supervisor): stop re-dispatching items whose PR merged; keep review repair for unresolved findings - #875

Merged
getappz merged 5 commits into
masterfrom
task/698-supervisor-re-dispatches-items-whose-pr
Oct 5, 2026
Merged

getappz merged 5 commits into
masterfrom
task/698-supervisor-re-dispatches-items-whose-pr

Conversation

@getappz

@getappz getappz commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

Agentflare item 698 (not GitHub PR/issue 698).

The supervisor kept working items after their PR had shipped (observed on items 687, 695, 696: roughly 10 wasted jobs).

Changes

  • Dead-claim re-queue (claim_liveness.rs): before re-arming a released item, look at its PR. A merged PR (or one with auto-merge armed) is not re-dispatched; a merged one is promoted through promote_merged_item. The PR lookup happens before the backend DB lock is taken (confirmed_dead_items), never inside it.
  • Promotion cancels jobs: promote_verified_merged_item cancels the item's queued/running jobs, so a job queued before the merge no longer runs after it.
  • CodeRabbit repair: a merged PR never triggers repair. A thread whose head commit is newer than the review is treated as fixed. A dispatched round whose job is gone goes back out (the in-flight guard is kept), so a dead repair job cannot strand a thread.
  • started-state promotion: promote_in_review_to_completed_if_pr also completes a started item, but only on the verified-merged path and only for the PR that was checked. The unconditional promote stays in_review-only.

Deliberately not changed

Tests

  • promote_if_pr_completes_a_started_item_but_only_on_the_verified_pr
  • unresolved_thread_dispatched_this_round_waits_while_its_job_still_runs
  • unresolved_thread_dispatched_this_round_goes_back_out_once_its_job_is_gone
  • armed_auto_merge_with_green_checks_still_repairs_unresolved_findings
  • dead-claim promote tests in claim_liveness_tests.rs

Local: fmt clean, clippy (-D warnings -A unsafe_code -A clippy::pedantic --all-targets) clean, 290 supervisor/claim/item tests and 6 backend promote tests pass.

Follow-up: cancelled CI run on adc9355 (2026-10-06)

The Actions API lookup using the full head SHA adc9355847d1e98fcfe79bb0cca6f1997d1586de found ci run 37353686716, created 2026-10-05 18:08:22 UTC and completed cancelled at 18:21:39 UTC. The same head had successful security checks, but no required build/clippy/fmt contexts in the PR rollup. This is a cancelled or superseded CI run, not a never-triggered run; the available record does not identify what cancelled it. The later empty commit (86402353) produced the required checks.

Agentflare-Branch: task/698-supervisor-re-dispatches-items-whose-pr
Agentflare-Item: 698
Agentflare-Branch: task/698-supervisor-re-dispatches-items-whose-pr
Agentflare-Item: 698
…r armed auto-merge, re-dispatch after a dead repair job

Review fixes on the item 698 branch: look up merged/merging PR state for dead claims before taking the backend DB lock; restore the in-flight guard so a dispatched round whose job died goes back out; skip repair only for a merged PR (armed auto-merge no longer strands unresolved findings); cover the started-state promotion with a test.

Agentflare-Agent: claude-code_2-1-289_agent
Agentflare-Branch: task/698-supervisor-re-dispatches-items-whose-pr
Agentflare-Item: 698
Agentflare-Session: c30b84bf-e38e-4eaa-bf9c-c726700b4982
@coderabbitai

coderabbitai Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

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).

Next included review available in 37 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 65 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: getappz/agentflare/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: b2356ad3-0028-4916-8fd9-5eae7ef288f0
📥 Commits

Reviewing files that changed from the base of the PR and between e468fe7 and 8640235.

📒 Files selected for processing (12)
  • crates/agentflare-backend/src/item/claim.rs
  • crates/agentflare-backend/src/item/tests_finalize.rs
  • src/claim_liveness.rs
  • src/claim_liveness_tests.rs
  • src/github/review_threads.rs
  • src/mcp_server/item.rs
  • src/supervisor.rs
  • src/supervisor/merge.rs
  • src/supervisor/review_bots.rs
  • src/supervisor/tests/auto_merge_tests.rs
  • src/supervisor/tests/review_bots_tests.rs
  • src/supervisor_coderabbit_tests.rs
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@getappz

getappz commented Oct 5, 2026

Copy link
Copy Markdown
Owner Author

Tracking this PR for automated review (flared:c997d745ae66).

Agentflare-Agent: claude-code_2-1-289_agent
Agentflare-Branch: task/698-supervisor-re-dispatches-items-whose-pr
Agentflare-Item: 698
Agentflare-Session: c30b84bf-e38e-4eaa-bf9c-c726700b4982
@getappz
getappz merged commit 6f4f4cd into master Oct 5, 2026
16 checks passed
@getappz
getappz deleted the task/698-supervisor-re-dispatches-items-whose-pr branch October 5, 2026 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant