Skip to content

fix(work): build_prompt never read handoff assets, so item_id-targeted handoffs never reached dispatch - #448

Merged
getappz merged 4 commits into
masterfrom
task/84
Aug 11, 2026
Merged

fix(work): build_prompt never read handoff assets, so item_id-targeted handoffs never reached dispatch#448
getappz merged 4 commits into
masterfrom
task/84

Conversation

@getappz

@getappz getappz commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Closes item #84. mcp__flare__handoff(item_id=<existing item>, content=...) attaches content to the item as a versioned asset, but the item's own description/comments never change — build_prompt() (src/cli/work.rs) only ever read those two fields when constructing the dispatch prompt, so a dispatched session never saw the handoff's instructions at all.

Confirmed live

Sent a detailed handoff to item #66 with exact CI-fix instructions (specific failing lines, specific fixes). The handoff succeeded and the item got relabeled ready-for-work. When the daemon dispatched it, the resulting session reported the work already done and the tree clean — it had zero awareness of the handoff's content, because none of it was ever in its prompt.

Fix

latest_handoff_content() fetches the most recently attached handoff asset — identified by the completed/remaining metadata only handoff_impl sets, so a plain asset attach of an unrelated file (a log, a screenshot) isn't mistaken for dispatch instructions — and build_prompt() inlines it under its own "Latest handoff instructions" section. Capped at 8000 chars (tail + a pointer to the full asset for anything larger) so an oversized handoff can't reintroduce the E2BIG prompt-size bug #75 just fixed from a different angle.

Test plan

  • cargo test --bin agentflare cli::work:: — 30 passed, including 3 new tests (surfaces a handoff into the prompt, ignores a non-handoff asset attach, caps an oversized handoff at the tail with an asset pointer)
  • cargo fmt --check — clean
  • cargo clippy --locked --workspace --all-targets --all-features -- -D warnings -A unsafe_code -A clippy::pedantic — clean (CI's exact flags)

…d handoffs never reached dispatch

handoff(item_id=<existing item>, content=...) attaches content to the
item as a versioned asset, but the item's own description/comments
never change -- build_prompt only ever read those two fields, so a
dispatched session never saw the handoff's instructions at all.

Confirmed live on item #66: a detailed handoff with exact CI-fix
instructions was attached, the item got relabeled and redispatched,
and the resulting session reported the work already done and the
tree clean -- it had no awareness of the handoff whatsoever.

latest_handoff_content fetches the most recently attached handoff
asset (identified by the completed/remaining metadata only
handoff_impl sets, so a plain asset attach of an unrelated file
isn't mistaken for one) and build_prompt inlines it under its own
section. Capped at 8000 chars (tail + a pointer to the full asset)
so an oversized handoff can't reintroduce the E2BIG prompt-size bug
#75 just fixed from a different angle.

Agentflare-Agent: claude-code
Agentflare-Branch: task/84
Agentflare-Item: 84
@coderabbitai

coderabbitai Bot commented Aug 11, 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: 6 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: 2258945d-cdde-4889-bcf1-65d0131e08b2

📥 Commits

Reviewing files that changed from the base of the PR and between e1ef5b2 and b26b422.

📒 Files selected for processing (1)
  • src/cli/work.rs

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

@getappz
getappz merged commit 3aa6b18 into master Aug 11, 2026
16 checks passed
@getappz
getappz deleted the task/84 branch August 11, 2026 09:50
getappz pushed a commit that referenced this pull request Aug 11, 2026
…meter

The merge from master (which landed #448's build_prompt(item, comments,
latest_handoff) signature change) merged cleanly at the text level but
left this test's call site on the old 2-arg form, breaking the build.

Agentflare-Agent: claude-code
Agentflare-Branch: task/71
Agentflare-Item: 71
getappz added a commit that referenced this pull request Aug 11, 2026
…ation (no resume mechanism exists) (#438)

* fix(work): forbid backgrounding verification in headless dispatch prompt

Items #68 and #70 both hit the same failure: a headless-dispatched agent
ran cargo build/check as a background task and ended its turn saying it
would report back once it finished -- but one-shot headless dispatch has
no mechanism to resume a session, so the harness kills the background
task and the work goes unverified. build_prompt now explicitly tells the
agent this is a one-shot run with no resume path and to run all
verification synchronously in the foreground before ending its turn.

Agentflare-Agent: claude-code
Agentflare-Branch: task/71
Agentflare-Item: 71

* fix: update build_prompt call site for #448's new latest_handoff parameter

The merge from master (which landed #448's build_prompt(item, comments,
latest_handoff) signature change) merged cleanly at the text level but
left this test's call site on the old 2-arg form, breaking the build.

Agentflare-Agent: claude-code
Agentflare-Branch: task/71
Agentflare-Item: 71

---------

Co-authored-by: shiva <shiva@gosysinfo.tech>
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