Skip to content

fix(acp): surface silent turn-end when agent replies but never publishes (#3980) - #4057

Open
iroiro147 wants to merge 1 commit into
block:mainfrom
iroiro147:claude/issue3980-20260801
Open

fix(acp): surface silent turn-end when agent replies but never publishes (#3980)#4057
iroiro147 wants to merge 1 commit into
block:mainfrom
iroiro147:claude/issue3980-20260801

Conversation

@iroiro147

Copy link
Copy Markdown

Summary

Refs #3980 — surfaces the silent-failure mode when a buzz-acp agent ends a turn with non-empty agent_message_chunk text but never makes a successful buzz messages send call.

Today that turn ends with zero signal: no relay message, no warning, no failure notice. Desktop's activity/observer view shows a coherent reply while the relay has nothing, so an operator can't tell the agent failed to publish.

What this does

  • Accumulates streamed agent_message_chunk text per turn in AcpClient (unpublished_turn_text), alongside a completed_tool_call_this_turn flag set by any tool_call_update with status == "completed".
  • take_unpublished_turn_notice() (public, per-turn) returns Some(text) only when the turn produced non-empty text and completed zero tool calls — the case where the agent never shelled out to buzz messages send, so its reply is invisible on the relay. Resets both fields so each turn starts clean.
  • At turn end, in the shared send_prompt_result chokepoint (so every outcome inherits it), the harness emits a pool::prompt warning with the turn id, byte count, and a content preview. That makes the silent-failure mode visible in operator logs and Desktop's observer view.

Scope (deliberately bounded)

This adds turn-level accumulation + detection + a warning. A relay-visible failure notice (via post_failure_notice) is the natural follow-on but is not in this PR: that path needs channel_id + thread tags at the publish site, which the shared result chokepoint doesn't carry, and wiring it without that context risks leaking or wrong-channel posts. The accumulation state introduced here is exactly what that follow-on consumes.

Publishing itself is unchanged; agents that complete any tool call (the publish path) never trigger the warning. No fuzzy matching introduced.

Verification

  • cargo check -p buzz-acp — clean
  • cargo test -p buzz-acp — 661 + 9 passing (matches main baseline, no regression)
  • cargo clippy -p buzz-acp — clean

…hes (block#3980)

When a buzz-acp-driven agent ends a turn with non-empty agent_message_chunk
text but never makes a successful 'buzz messages send' call, the turn ends
with zero signal — no relay message, no warning. Desktop's observer view
shows a coherent reply while the relay has nothing, so operators can't tell
the agent failed to publish.

Accumulate streamed agent_message_chunk text per turn and track whether any
tool call completed. At every turn boundary (the shared send_prompt_result
chokepoint, so all outcomes inherit it), if the turn produced text but
completed zero tool calls — i.e. it never shelled out to publish — emit a
'pool::prompt' warning naming the turn, byte count, and a content preview.
That surfaces the silent-failure mode in operator logs and Desktop's
observer view, closing the visibility gap from the issue.

Scope note: this adds the turn-level accumulation + detection + warning. A
relay-visible failure notice (via post_failure_notice) requires channel and
thread-tag context the shared result chokepoint doesn't carry; wiring that
is the deliberate follow-on. No behavior change to publishing itself, no
fuzzy matching, and publishing-success agents are untouched (any completed
tool call suppresses the warning).

Verified: cargo check + cargo test (661+9, matching main baseline) + clippy
clean.

Refs block#3980

Signed-off-by: iroiro147 <sarthak.singh@juspay.in>
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