Skip to content

fix(work-item-pipeline): item_done's push_and_open_pr silently no-ops on a branch-name mismatch - #558

Merged
getappz merged 3 commits into
masterfrom
task/512-bugfix-item-done-s-push-and-open-pr-sile
Aug 19, 2026
Merged

getappz merged 3 commits into
masterfrom
task/512-bugfix-item-done-s-push-and-open-pr-sile

Conversation

@getappz

@getappz getappz commented Aug 19, 2026

Copy link
Copy Markdown
Owner

Root-causes and fixes item_done's silent no-op: it computed the item's actual branch differently across call sites — push_branch used resolve_worktree_branch (checks what's really on disk), while branch_diverged/is_pr_merged/relabel_pr_completed/pr_ci_status all used the naive task_branch_name guess. When those two disagree (a renamed branch, or a worktree predating the current slugged-naming scheme), branch_diverged checks a branch that doesn't match what was actually pushed, finds "nothing diverged", and item_done returns Ok with no push, no PR, no comment, no state change — reproduced live on item #331.

Fix: added flare_git_core::worktree::resolve_item_task_branch(item, repo_root) as the single source of truth for "what branch is this item's worktree actually on" (reads the real checkout, falls back to task_branch_name only if no worktree exists yet), and switched every one of those call sites to use it instead of recomputing the guess independently.

Also fixed a related issue this WIP surfaced: run_or_resume_with_sender's periodic heartbeat call didn't carry the owner override across the async workflow-engine thread boundary, so item_heartbeat calls made from deep in the loop could silently fail owner checks — same class of bug as the earlier finalize-step owner-identity fix (PR #531).

Verified: cargo build --lib and cargo build -p flare-git-core --lib clean; cargo fmt --check clean; cargo clippy --tests -- -A unsafe_code -A clippy::pedantic -D warnings clean on both agentflare and flare-git-core; flare-git-core::worktree::tests (41/41), work_item_pipeline::* (54/54, 2 pre-existing ignores unrelated), and the new item_pr_failure_tests integration tests (2/2) all pass.


Opened by claude-code on flared:c997d745ae66 for item #512 via agentflare.

…m's actual branch differently across call sites — `push_branch` used `resolve_worktree_branch` (checks what's really on disk), while `branch_diverged`/`is_pr_merged`/`relabel_pr_completed`/`pr_ci_status` all used the naive `task_branch_name` guess. When those two disagree (a renamed branch, or a worktree predating the current slugged-naming scheme), `branch_diverged` checks a branch that doesn't match what was actually pushed, finds \"nothing diverged\", and `item_done` returns `Ok` with no push, no PR, no comment, no state change — reproduced live on item #331.

Fix: added `flare_git_core::worktree::resolve_item_task_branch(item, repo_root)` as the single source of truth for \"what branch is this item's worktree actually on\" (reads the real checkout, falls back to `task_branch_name` only if no worktree exists yet), and switched every one of those call sites to use it instead of recomputing the guess independently.

Also fixed a related issue this WIP surfaced: `run_or_resume_with_sender`'s periodic heartbeat call didn't carry the owner override across the async workflow-engine thread boundary, so `item_heartbeat` calls made from deep in the loop could silently fail owner checks — same class of bug as the earlier `finalize`-step owner-identity fix (PR #531).

Verified: `cargo build --lib` and `cargo build -p flare-git-core --lib` clean; `cargo fmt --check` clean; `cargo clippy --tests -- -A unsafe_code -A clippy::pedantic -D warnings` clean on both `agentflare` and `flare-git-core`; `flare-git-core::worktree::tests` (41/41), `work_item_pipeline::*` (54/54, 2 pre-existing ignores unrelated), and the new `item_pr_failure_tests` integration tests (2/2) all pass.
@coderabbitai

coderabbitai Bot commented Aug 19, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

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

Your current included review allowance is based on your included PR review attempts over the past 7 days.

Next review available in: 43 minutes

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

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 within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 483c07bc-cc09-4598-b3a2-41ac3f0cf782

📥 Commits

Reviewing files that changed from the base of the PR and between b516a12 and 1874a02.

📒 Files selected for processing (7)
  • crates/flare-git-core/src/worktree.rs
  • crates/flare-git-core/src/worktree_tests.rs
  • src/mcp_server/tests/item_pr_failure_tests.rs
  • src/mcp_server/tests/mod.rs
  • src/work_item_pipeline.rs
  • src/work_item_pipeline/tests.rs
  • src/worktree.rs

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

@getappz getappz changed the title Bugfix: item_done's push_and_open_pr silently fails, leaving item claimed with no PR/comment/state-change fix(work-item-pipeline): item_done's push_and_open_pr silently no-ops on a branch-name mismatch Aug 19, 2026
@getappz
getappz enabled auto-merge (squash) August 19, 2026 05:25
@getappz
getappz merged commit 9f9ce62 into master Aug 19, 2026
16 checks passed
@getappz
getappz deleted the task/512-bugfix-item-done-s-push-and-open-pr-sile branch August 19, 2026 05:47
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