buzz icon indicating copy to clipboard operation
buzz copied to clipboard

[Bug] buzz-acp reply delivery is implicit — Sonnet-class agents answer in session text and every reply is silently dropped

Open bosoud opened this issue 4 months ago • 38 comments

Describe the bug

A buzz-acp managed agent's reply reaches the channel only if the model spontaneously decides to run buzz messages send. Nothing in the injected prompts states that session text is not delivered, and the harness has no fallback when a turn ends without a send — the reply is silently dropped. Strong models happen to infer the convention; weaker ones don't, so switching an agent's model can silently break all of its replies while everything looks healthy (turn runs, Activity panel streams the answer, tokens are billed, chat stays empty, exit clean, nothing logged).

Observed (Buzz Desktop 0.4.24, Claude Code harness, macOS):

The same agent, same 12,435-char base prompt (byte-identical), same [Buzz event: @mention] turn block — only the model differs (via ANTHROPIC_MODEL, per the #2692 workaround):

Session model Behavior Chat
claude-fable-5 (3 sessions) ends turn with Bash: printf '…' | buzz messages send … reply appears ✅
claude-sonnet-5 (3 sessions) zero tool calls — answers in plain session text reply lost ❌

The Sonnet reply text is visible in the desktop Activity panel (streamed ACP output) and in the session transcript, so generation succeeded; delivery never happened. The owner sees "working…" then silence — same symptom family as #2459, but here the CLI write doesn't fail, it is never attempted.

Root cause

The delivery contract is implicit. The base prompt says the buzz CLI is "your primary interface" and discusses threading/mentions, but never states "your session text is NOT delivered — reply via buzz messages send". The per-turn block (queue::format_prompt / format_event_block, crates/buzz-acp/src/queue.rs) describes the incoming event and names a reply destination without stating the mechanism. Turn completion (crates/buzz-acp/src/lib.rs) does not check whether any send occurred for the triggering channel.

Suggested direction

  1. State the contract explicitly in the turn prompt (one line: session text is not delivered; reply with buzz messages send --channel <uuid> [--reply-to <event-id>]). Cheap, model-agnostic, immediately effective — verified locally: adding the equivalent instruction to the agent's system prompt makes Sonnet 5 post correctly.
  2. Add a harness fallback: when a prompted turn completes and no buzz messages send targeting the triggering channel was observed, either auto-post the final ACP text as the reply (best) or at minimum log at WARN and surface a delivery-failure indicator to the owner. This also covers #2459's failed-write case — silent loss is the real bug in both.

To Reproduce

  1. Managed Claude Code agent; set ANTHROPIC_MODEL=claude-sonnet-5 in its env vars (needed because of #2692); restart.
  2. DM the agent any question.
  3. Activity panel streams a correct answer; no message ever arrives in the chat; harness log shows nothing between turn start and the next lifecycle event.

Related: #2459 (reply lost when CLI write fails), #2265 (silent failure when default model lacks credits), #2692 (model setting not applied — the fix that exposes this one, since it makes cheaper models reachable).

Environment: Buzz Desktop 0.4.24 (Block-signed), @agentclientprotocol/claude-agent-acp 0.60.0, macOS Intel, relay communities.buzz.xyz.

bosoud avatar Jul 24 '26 10:07 bosoud

Fixed in the PR that makes the delivery contract explicit in the turn prompt (complements the harness fallback work).

chessing234 avatar Jul 24 '26 11:07 chessing234

#2703

chessing234 avatar Jul 24 '26 11:07 chessing234

Real-world outcome data from the machine where this was originally traced, after two days of living with the workarounds:

  1. With ANTHROPIC_MODEL=claude-sonnet-5 set (per the #2692 workaround), the owner messaged the agent from the Buzz mobile app. Session transcript: model claude-sonnet-5, zero buzz messages send tool calls — the reply was generated and dropped, exactly the failure mode above. From mobile there is no Activity panel, so a dropped reply is indistinguishable from a dead agent.

  2. Attempted mitigation that does NOT work, for the record: appending the delivery contract to ~/.buzz/AGENTS.md (below the managed markers, where the file invites owner notes). The note survives on disk but never appears in any session's context — transcripts confirm the harness/CLI does not load it. So the only user-reachable places to state the contract are the per-agent system prompt (manual paste into every agent, desktop UI only) or the harness prompt itself (#2703).

  3. Net result: the owner removed the env var and went back to the account-default model — claude-fable-5[1m], the most expensive tier available — because a working reply beats a cheap model that answers into the void. Next transcript after the revert: claude-fable-5, 1 send, reply delivered.

That's the quiet cost of this bug worth weighing in prioritization: it doesn't present as breakage, it presents as "cheaper models don't work in Buzz," and users burn premium tokens to make the symptom go away. #2703's explicit contract line would have made scenario 1 work on the spot.

bosoud avatar Jul 25 '26 11:07 bosoud

Reproduction

A synthetic, isolated Hermes ACP integration reproduced this issue on amanning3390/buzz@9a6f45792c02cd6d241e30a261e87468a4738227 (BYOH base 95fdf978800982389b120c66ff5e766d785419c7). No production data or credentials were used.

With no MCP command, Hermes completed the ACP turn and emitted final assistant text, but Buzz posted no room reply. Supplying buzz-dev-mcp made the same profile-backed integration complete a real request/reply pair in 25.2 seconds.

The decisive difference was not model generation or title generation: the isolated Hermes tool container intentionally had no host buzz binary, so the generated final text had no transport-owned publication path. Title generation was disabled separately as unnecessary service-profile overhead.

Security implication

For a least-privilege service agent, buzz-dev-mcp is not an acceptable production workaround. The server exposed seven host tools including general shell and host file read/edit access. That bypassed the profile's intentionally isolated Docker tool boundary merely to let an ordinary chat reply reach Buzz.

This evidence supports the issue's stronger proposed fix: buzz-acp should publish final ACP assistant text itself when the turn ends, scoped to the triggering channel/event. The prompt-only contract helps compatible agents, but it still makes ordinary transport delivery depend on model behavior and an agent-accessible host CLI.

For explicit non-reply Buzz actions, a separate narrow room MCP would be appropriate; routine response publication should remain transport-owned.

freemanconsulting avatar Jul 27 '26 18:07 freemanconsulting

Update: v0.5.0 moves this from a corner case to the default path

Buzz Desktop v0.5.0 now applies the configured model by injecting a /model slash command into the session — the transcript shows <command-name>/model</command-name> with args sonnet → Set model to sonnet (claude-sonnet-5). So the model pick in Desktop is finally honored (via #1968, "agent definition authoritative for model/provider/prompt" — not via #2701, which is still open).

That is a good fix, but it means anyone whose agent is configured to a Sonnet-class model now actually gets one, and lands directly in this bug. Before v0.5.0 the pick was ignored and most agents silently ran whatever ~/.claude/settings.json defaulted to, which masked this.

Controlled A/B/A repro

Same managed agent, same DM, same machine, same base/system prompt, three consecutive sessions 13 minutes apart. Only the model changed. Counts are from the session transcripts (assistant message content blocks):

Time (UTC) message.model tool calls buzz messages send Reply reached the DM?
17:32 claude-sonnet-5 0 0 ✗ Activity panel only
17:43 claude-opus-5 1 1 ✓ delivered
17:45 claude-sonnet-5 0 0 ✗ Activity panel only

An earlier session on claude-fable-5 also delivered (1 tool call, buzz messages send). So: Fable and Opus infer the delivery requirement; Sonnet does not.

In the failing turns Sonnet is not malfunctioning — it answers the user's question correctly and completely, in session text. It simply never shells out to the CLI, so the harness discards the turn and the human sees silence.

The harness input is not at fault

I checked the failing transcripts for the obvious causes and ruled them out — the turn is assembled correctly:

  • [Base] prompt present
  • [System] persona present
  • [Context] present, including the channel UUID and Scope: dm
  • [Conversation Context] and the triggering [Buzz event: @mention] (with event ID) present

Everything Sonnet needs in order to send is in front of it. It just doesn't act on it.

Why a prompt-only fix may not close this

Worth flagging before #2703 merges: crates/buzz-acp/src/base_prompt.md on current main already states this, quite emphatically:

If your turn produced anything worth knowing, you MUST publish it. Use buzz messages send. Your reasoning and tool calls are invisible — a result, an answer, a deliverable, a decision, a blocker, or a question you need answered exists only if you published it. […] Ending that kind of turn without a message is a silent failure.

and:

If a human asked you something, you MUST reply to them […] Never leave a person waiting on you.

That is about as strong as prose gets, and Sonnet read it and still returned text-only in all three failing turns above. So restating the contract in the turn prompt (as #2703 does) may help without being sufficient — and #2703's own test plan still has Sonnet-class agent replies via CLI after a mention unchecked.

If it turns out prompting alone doesn't get Sonnet to comply reliably, a deterministic backstop in the harness would close it for every model — e.g. if a turn triggered by a Buzz event ends with assistant text and no buzz messages send, deliver that final text to the triggering channel (or surface a visible "reply not delivered" warning) instead of dropping it silently. The silent drop is what makes this so costly to diagnose: from the user's side the agent looks online and idle, and the answer is sitting in the Activity panel where they don't think to look.

Happy to re-run the same A/B/A against a build with #2703 applied if that would help verify the Sonnet path.

Environment: Buzz Desktop v0.5.0 (Block-signed, macOS x86_64), managed agent via the Claude Code ACP harness, bypassPermissions mode. Model IDs verified from message.model in the session transcripts rather than the agent's self-report — the agent's own claims about its model were wrong in two earlier turns, so self-reports are not reliable evidence here.

bosoud avatar Jul 28 '26 17:07 bosoud

Still reproducing on Desktop v0.5.1, on a self-hosted relay rather than communities.buzz.xyz — so this is not environment-specific.

Symptom matches the original report: the agent does the work but posts nothing. Saying "I need a reply" in the channel reliably produces the message, which is consistent with the delivery contract being the missing piece rather than anything failing.

Two things I checked while trying to find a version to upgrade to:

The turn prompt still does not state the contract. On current main (35 commits past the v0.5.1 tag), append_reply_instruction and append_new_thread_reply_instruction in crates/buzz-acp/src/queue.rs tell the agent how to reply — --reply-to <event_id>, threading, when to post at the root — but never that session text is not delivered. Grepping main for anything resembling the contract turns up only those threading strings and a test assertion.

#2703 is still open and unmerged, so the "Fixed in the PR that makes the delivery contract explicit in the turn prompt" comment above hasn't taken effect yet. git log --all --grep='delivery contract' on main returns nothing. That means there is currently no released version that fixes this — worth knowing for anyone who lands here looking for an upgrade path.

On the prompt workaround: confirming @bosoud's finding that appending the contract to the agent's system prompt does not reliably work. I suggested it before reading the full thread; it is not a fix.

The harness fallback from the "Suggested direction" section looks like the durable answer to me, for the reason the Hermes reproduction shows: the failure is not really about model class. An agent that never had a usable path to buzz messages send fails identically to one that had the path and did not think to use it. A completion check — "this turn was triggered by a channel event and no send targeting that channel was observed" — catches both, and would have made this visible immediately instead of looking like a dead agent.

Environment: Buzz Desktop v0.5.1, self-hosted relay (own deployment, not Builderlab), managed Claude Code agents.

kcao-gss avatar Jul 29 '26 19:07 kcao-gss

Environment

  • Local reproduction rig, not the reference deployment: buzz-acp/buzz-agent/buzz-desktop built from a worktree at pinned commit fd55ab662450a81a9ce49397f0e42aec0e4cb765 (v0.4.21) with PR #2694's hunks applied locally (relay_mesh.rs, runtime.rs only).
  • Model: unsloth/Qwen3-30B-A3B-Instruct-2507-GGUF:Q4_K_M, served locally via mesh-llm's OpenAI-compatible route (skippy backend) on a single GPU host on our LAN — a local open-weight model, distinct in family from the Sonnet/Opus/Fable data already in this thread (see the model-dependence section below).
  • Agent under test: a single managed buzz-agent (relay-mesh provider), permission_mode: bypassPermissions, one relay-mesh peer only throughout (no other serving nodes in the mesh during any of the reproduction below).

Timeline

  • ping-1 (2026-07-29): canary sent, mesh-smoke correctly dispatched to the model, model generated the exact requested reply content internally (confirmed via server-side generation log), but no reply ever reached the channel. Root cause investigation began here.
  • ping-2 (2026-07-30, MCP repair already applied by this point): a real rmcp 1.7.0 client/server initialize/initialized handshake succeeded end-to-end (confirmed live in the harness log), and the harness's own bootstrap-instructions text confirmed the MCP subprocess environment genuinely had relay auth configured. The model on our GPU host again generated the exact correct reply content — but still answered in plain text instead of issuing a tool call, with a real, working shell tool available to it the whole time. buzz-acp's handle_session_update/agent_message_chunk arm logs that plain-text output and discards it — no publish call anywhere on that path. This is the core finding we think is worth flagging here: a correctly wired, fully functional MCP connection is not sufficient on its own to avoid this failure mode — the model still has to choose to use it, and per our probe data below, that choice is not reliable under plain tool_choice: "auto" steering.
  • ping-3 (2026-07-30, after the fix below): first correctly-delivered reply. Event id d88d47ba86e4e3ab02ff55c972d0b7ed66b8865b05d4f5ce6a5d3108352f4a6d, 15 second send-to-reply latency, reply content exactly mesh-ok, correct author pubkey, correctly threaded to the canary event, no duplicate/stray messages, harness log clean.

Root cause specific to our rig: missing/unresolved MCP binary, not just "no send tool"

Our config had mcp_command: "buzz-dev-mcp" configured at the desktop-app level (the built-in runtime-metadata default for the buzz-agent runtime type), but the actual sidecar binary at the resolver-searched location was a placeholder/never-built stub. Source trace (desktop/src-tauri/src/managed_agents/{discovery.rs,runtime.rs}) shows:

  • mcp_command in managed-agents.json is not the value actually used at spawn time — it's explicitly excluded from persistence (comment: "MUST NOT appear in snapshot") and recomputed fresh from a hardcoded per-runtime table every spawn.
  • The resolved bare command name is looked up via resolve_command(), which searches workspace target/{debug,release} directories and the currently-running buzz-desktop's own directory for a file with that exact bare name and any executable permission bit set — is_executable_file() only checks metadata.is_file() + the +x bit, with zero validation that the file is a real, valid executable. A 0-byte stub with +x passes this check silently.
  • Net effect for our build: 8 of 9 historical startups resolved mcp_cmd to empty (no file with the right bare name existed in a searched directory at all), and the one exception resolved to a 0-byte placeholder that would have failed at actual process spawn if ever exercised by a real turn (never was, in our history).
  • We built the real buzz-dev-mcp binary from the same workspace/lockfile that produced the running buzz-agent (confirming the client/server rmcp versions matched — 1.7.0 both sides, verified via a live handshake log) and placed it at the bare resolved path. This alone restored a real, working MCP connection (verified via a live rmcp initialize/initialized handshake in the harness log) but by itself did not produce a correct reply — see below.

Does the #2703 prompt-contract diff close this? Our data says: helps, not deterministic

We read #2703's actual diff before writing this. For the reply-delivery part specifically, it inserts one clause — "Session text is not delivered to the channel — only a successful buzz messages send posts a reply." — into the same base_prompt.md bullet @bosoud already quoted above as "already states this, quite emphatically" (and that already failed to move Sonnet in that A/B/A test), and adds the identical clause to the per-turn append_reply_instruction/append_new_thread_reply_instruction blocks in queue.rs. @kcao-gss confirmed #2703 is still open, unmerged, and mergeable state currently shows conflicts; its own test-plan item "Sonnet-class agent replies via CLI after a mention" is unchecked.

That's exactly the class of fix we tested independently, with the real MCP path wired in and shell genuinely available (tool_choice: "auto", matching buzz-agent's hardcoded behavior — it never uses "required"):

  • Baseline, full tool list (including an unrelated todo tool), no extra steering: our model chose todo in 5/5 samples, never shell — the same "answers correctly but doesn't deliver" outcome documented for Sonnet in this thread, via wrong-tool selection rather than an outright refusal to use tools at all.
  • We then tested prompt-level reinforcement in the same spirit as #2703's diff — explicit instructions naming the required command, up to and including a variant with the literal, already-resolved channel/event IDs spelled out plus an explicit "do not do X" warning, injected the same way #2703 injects its clause (system-prompt and per-turn-equivalent text). Both failed 3/3 — the model reverted to the wrong tool regardless of how explicit or literal the instruction was, as long as the competing tool remained available.
  • A one-shot worked example (a fabricated prior turn showing the exact correct tool call) did work, 3/3, and it works equally well flattened into plain narrative text inside the system prompt (the only lever available in a real deployment, not a structured few-shot message). That's what we applied live, and it produced ping-3's clean, fast, correct reply (15s latency, exact content, correctly threaded).

@Chessing234 already framed #2703 as complementing "the harness fallback work," not replacing it — our data supports that framing directly: #2703's contract almost certainly helps (it's a real improvement over what's there now, even if the specific wording addition is incremental), but prompt-steering effectiveness is model-dependent along a second, independent axis from the one already documented here — ours is a tool-selection collision (an unrelated tool winning out), not the plain-text-refusal pattern Sonnet shows. @kcao-gss's point that "the failure is not really about model class" reads as correct to us, just for one more reason than already listed: it's not only "does this model know to reply," it's also "does this model pick the right tool when several are offered," and prompt text doesn't reliably fix either failure mode by itself. A deterministic harness-side fallback (#2681's shape) would close the gap regardless of which one hits.

The MCP-wiring path we used — diagnostic only, and we'd support a narrower tool over it

Our reproduction first required repairing a broken buzz-dev-mcp binary resolution on our own rig (empty/unresolvable mcp_cmd in 8 of 9 historical startups — see "root cause" above) before any of the above was testable at all. @freemanconsulting's Hermes reproduction and security note above land on a concern we'd echo directly, and we think their proposed split is the right shape: routine reply publication should be transport-owned (matching the harness-fallback direction), with a separate, narrow tool for any case that genuinely needs one — not the general-purpose shell/file-access surface buzz-dev-mcp exposes. We used the full buzz-dev-mcp binary here strictly as a diagnostic instrument, to separate "no working send path at all" from "a working send path the model doesn't reliably use" (they're two different failures, per the data above) — not as something we'd recommend running as-is against a least-privilege production agent.

Verified against current main, not just our pinned commit

Our rig is built from an older pinned commit (fd55ab6, v0.4.21) with only two unrelated files patched locally, so we re-checked the specific code paths this finding depends on directly against a fresh fetch of main (63496cc1d4c6f1b7c613801bdcc694169dcf391a, fetched today) rather than assume our pin still reflects current behavior. All confirmed unchanged on current main: the handle_session_update "agent_message_chunk" arm (still logs to target: "acp::stream" and returns without publishing), the Result<StopReason, AcpError> return signature on the relevant session-turn functions, the PromptOutcome::Ok variant and its "no action beyond log+return-to-pool" handling, and all four submit_event call sites in buzz-acp (NIP-AM metrics, reaction-add, reaction-remove, and the dead-letter failure notice) — none of which cover a normal successful chat reply. Also worth noting: #3263 (open) independently quotes this same handle_session_update/agent_message_chunk code in its own description, and #3403 (open) touches related reasoning-content/local-model publishing behavior — both look relevant to anyone picking this up.

Fix path we validated (workaround for our rig, not a proposed code change)

Filling in one intermediate step not covered above: with todo simply removed from the tool list (no other change), the model reliably called shell (3/3) — but with a trivial echo of the reply text, not an actual buzz messages send, so still no channel delivery. That rules out "the model just needs todo out of the way" as a sufficient fix on its own; only the worked-example exemplar (described above) closed the gap all the way to a correct, delivering command. That exemplar, flattened into system_prompt text, is what we applied to our test agent and what produced ping-3's reply.

Full probe data summary (local-only reproduction, no relay/channel involvement except the 3 canaries above)

Full probe variant table (click to expand)
Variant Description Result
Baseline (5 samples) Full tool list incl. todo, tool_choice: auto, no extra steering 5/5 called todo (wrong tool), 0/5 shell, 0/5 plain text, 0/5 malformed
V1 (3 samples) todo removed from tool list, no steering 3/3 called shell, but with echo (not buzz messages send)
V2 (3 samples) Full tool list, generic placeholder-style steering text 3/3 identical to V1 (byte-for-byte) — no measurable effect from the steering text
V3 (3 samples) Full tool list, steering with literal resolved channel/event IDs + anti-echo warning 3/3 reverted to todo — confirms the attractor survives even maximally explicit instruction as long as todo is offered
V4 (3 samples) Full tool list, fake structured few-shot exemplar (prior user/assistant-tool_call/tool-result turn) 3/3 correct buzz messages send, correct channel/reply-to, correctly varied content
V5 (3 samples) Same exemplar, flattened into narrative system-prompt text (the only lever the live rig actually exposes) 3/3 correct, identical quality to V4

Summary of what's novel here

In case it's useful to whoever picks this up: what we think adds to the existing thread is (1) a local open-weight model reproduction, distinct in family from the Sonnet/Opus/Fable data already here; (2) server-side confirmation, from the model's own serving log, that the correct reply content was genuinely generated and then dropped — not a generation failure; (3) direct evidence that a fully-repaired, working MCP/tool path is not sufficient by itself (ping-2); (4) a controlled tool-selection probe distribution (5/5 wrong-tool, 0/5 correct, under realistic tool_choice: auto conditions) showing why prompt contracts alone are unreliable for this model; (5) a validated workaround (one-shot exemplar, portable to plain system_prompt text); and (6) a clean, fully-verified live success — ping-3, 15s latency, exact content, correct author/thread, no duplicates — demonstrating the workaround closes the loop end-to-end on a real agent, not just in an isolated probe.

bokiko avatar Jul 30 '26 17:07 bokiko

Adding a Hermes data point that lands differently from @freemanconsulting's, and I think it strengthens the case for the transport-owned fallback.

In that reproduction the container had no host buzz binary, so the absence of a publication path explains the silence. On my machine the binary is present and resolvable, the credentials are in the agent process, and delivery still fails.

What the transcript shows

A Buzz Desktop managed agent on the Hermes ACP runtime, mentioned in a DM. Hermes read the docs, tried to send, and got rejected:

TOOL terminal: buzz messages send --help
TOOL terminal: {"error":"auth_error",
               "message":"auth error: BUZZ_PRIVATE_KEY is required
                          (use --private-key or set env var)"} exit_code 3
ASSISTANT: "buzz messages send fails for me with..."

So this is not a model that failed to infer the convention. Hermes inferred it, attempted the send, and was blocked. It then explained the failure in session text, which Buzz drops.

Why the credential is missing

Not a buzz-acp bug. Checked on this host:

buzz on clean login PATH        -> /Users/me/.local/bin/buzz
BUZZ_PRIVATE_KEY in the live hermes-acp process -> PRESENT

Hermes strips it on the way to the child process. _HERMES_PROVIDER_ENV_BLOCKLIST removes messaging-platform credentials from every terminal subprocess:

BUZZ_PRIVATE_KEY   blocked
TELEGRAM_BOT_TOKEN blocked
DISCORD_BOT_TOKEN  blocked

That is deliberate on the Hermes side and I do not think it should change. The blocklist exists because of a CVE where a skill registered a provider credential for passthrough and exfiltrated it, and the ACP path is the worst place to relax it: Buzz auto-approves ACP permission requests, so a channel message carrying a prompt injection would reach a signing key that can post as the owner. I looked at scoping an exception to ACP sessions and decided against proposing it.

Why this argues for the harness fallback

Option 1 in the issue (state the contract in the turn prompt) cannot fix this case. The contract already reaches Hermes as a user message and Hermes already follows it. The send is refused at the credential layer, so no amount of prompting helps.

Option 2 (publish the final ACP text when a turn ends with no send targeting the triggering channel) fixes it, and it fixes it without any agent ever holding the signing key. That is a better security posture than the status quo for every harness: the transport owns the credential, the agent owns the text.

A delivery-failure indicator would also have saved real time here. The symptom is a 👀 reaction, visible tool activity, and then nothing, which reads as a hung agent rather than a refused write.

Happy to supply more detail from the transcript if useful.

SHL0MS avatar Jul 31 '26 03:07 SHL0MS

Ran into this exact behavior tonight running three Buzz Desktop managed agents (model: inclusionai/ling-2.6-flash via OpenRouter). Multiple turns showed the model composing a full conversational reply visible in Desktop's session/"thinking" view, with zero buzz messages send calls — the turn reported healthy/complete and the channel stayed empty. Confirmed independently by checking the relay directly (buzz messages search/get) — no event was ever published for those turns. Only when the agent was explicitly asked to "try something different" did it actually call the CLI and post successfully.

+1 for this being a real, current problem — the suggested fix (checking for zero relay OKs after a mention-triggered turn) matches exactly what we needed diagnostically tonight to even confirm what was happening.

davidglogan avatar Jul 31 '26 15:07 davidglogan

Adding a same-session data point plus a couple of source citations that might help whoever picks this up next.

Two fresh reproductions tonight, against agents/models not previously represented in this thread:

  • codex-acp (OpenAI-hosted model, ChatGPT auth): properly-tagged DM sent to the agent, operator observed a 👀 reaction + typing indicator, both cleared with nothing published. buzz-acp's journal shows the channel subscription and nothing after — no idle_timeout, no error, no send. Checked and ruled out two other explanations before treating this as the same bug: (1) the credential-stripping failure mode reported elsewhere in this thread — confirmed BUZZ_PRIVATE_KEY is present in the spawned codex.js subprocess's env; (2) the auth-error path (is_auth_error in lib.rs, ~line 3150) — that path posts a visible ⚠️ notice and a WARN log line if it fires; neither happened.
  • omp (Oh My Pi, deepseek/deepseek-v4-flash-0731 via OpenRouter): same operator-visible symptom. Ruled out an actual crash (worker subprocess alive, no OOM, ~7GB free) but couldn't independently confirm the exact internal PromptOutcome for this one — noting it as the same symptom family, not fully independent confirmation of the identical mechanism.

Both agents had the existing base_prompt.md:67 "you MUST publish it" instruction active by default. Reproduced anyway — worth weighing against any fix direction that's prompt-text-only.

Source citations (verified against a local clone, commit 209536ade6c5ebf7fa82671d7ca0b74f599a40cc — worth re-checking against current main, the repo moves fast):

  • crates/buzz-acp/src/acp.rs, handle_session_update's "agent_message_chunk" arm (~line 1715-1720): the streamed text only ever reaches tracing::info!. No structured turn-scoped buffer exists today.
  • crates/buzz-acp/src/lib.rs, the PromptOutcome::Ok(_) arm (~line 3250-3257): tracing::debug! + pool.return_agent(...), nothing else. No check for whether a publish happened, in this arm at least (didn't audit the full upstream call graph). The failure arms right next to it (AgentExited, Timeout) do call post_failure_notice (pool.rs:3807) — so a hard crash gets a visible notice and a clean-but-silent turn currently gets none.
  • Checked whether buzz-agent's require_reply guard (crates/buzz-agent/src/config.rs, BUZZ_AGENT_REQUIRE_REPLY, off by default) is relevant here — it isn't, because it only exists in buzz-agent, not buzz-acp. codex-acp/omp have nothing equivalent to fall back on.

On the two fix directions already discussed in this thread: our read leans toward Option 2 (warn/surface) as the safer starting point over auto-publish, mainly because detecting "no publish happened" via relay-event-authored-by-self (buzz-acp already holds its own relay connection) seems more robust than sniffing for tool_call events, and it also catches #2459's attempted-but-rejected-write case that tool-call-presence alone wouldn't. Auto-publish has a real implementation cost beyond wiring up the existing log text (no structured capture buffer exists yet — buffering boundaries, cancellation, concurrent sessions, and a possible chunk/Ok-ordering race all need answers first), plus it changes today's explicit-send contract into an implicit one, which may not be what every agent wants. Not prescribing either way — flagging what we found while testing tonight in case it's useful input.

Also cross-linking #3980, filed from this project earlier the same day: same two source locations, same suggested direction, different trigger (a misconfigured persona prompt telling the agent plain text was sufficient, vs. models here just not spontaneously inferring the convention). Might be worth a merge/close call between the two.

Happy to share more detail (full logs, repro steps) if useful.

davidglogan avatar Jul 31 '26 22:07 davidglogan

This is also affecting my Buzz setup with managed Goose agents, so it is not limited to the Claude Code harness or Sonnet-class models.

Environment/behavior observed:

  • Buzz-managed Goose agents on macOS
  • Ollama provider using qwen3.5:cloud (native tool calling available)
  • The agent generates a correct answer and it appears in Buzz Activity / Goose terminal output
  • No message appears in the Buzz channel because the turn ends without invoking buzz messages send
  • The behavior occurs across multiple Goose agents/models on the same relay

The prompt workaround proposed in this issue immediately fixed delivery. Appending an explicit instruction that session/terminal output is not delivered to chat, and that every human-facing response must be published with buzz messages send using the supplied channel and reply destination, caused the same Goose agent to post successfully under its own identity.

This supports making the delivery contract explicit in the injected prompt and adding a harness fallback/check when a turn finishes without a channel send.

potseeslc avatar Aug 01 '26 17:08 potseeslc

I reproduced this with an A/B test in the same turn. A buzz messages get/send command through the generic Codex shell ran under the seatbelt sandbox with CODEX_SANDBOX_NETWORK_DISABLED=1 and failed DNS resolution for the community domain (e.g. example.communities.buzz.xyz). The identical command through the injected buzz-dev-mcp shell succeeded immediately, so the relay was healthy.

Environment: macOS, Buzz Desktop 0.5.3, Codex 0.146.0.

panosdigital avatar Aug 02 '26 12:08 panosdigital

bumping this issue as i got this issue recently. I was using newest deepseek flash v4 for this.

0xrsydn avatar Aug 03 '26 09:08 0xrsydn

Field data from hitting this in a real deployment, plus one detail that made it harder to diagnose than it needed to be. Not opening a PR — #4323, #3883, #4422 and #4346 already cover both halves of this and I'd rather add evidence than a ninth patch.

Confirming the mechanism

acp.rs handle_session_update logs agent_message_chunk to tracing and returns — the text is never published. Delivery depends entirely on the model choosing to run buzz messages send, and the compiled-in base prompt is what makes strong models do it ("Your reasoning and tool calls are invisible … Use buzz messages send").

The second-order failure is worse than the reported one: an agent whose environment cannot authenticate the CLI can never reply at all, no matter how strong the model. Our harness ran a local Qwen via LM Studio whose sandbox strips BUZZ_PRIVATE_KEY from tool subprocesses as a messaging-platform credential. Every turn ended reason=text_response with a correct answer, and the channel stayed empty:

[WARNING] tool_executor: Tool terminal returned error: {"error":"auth_error",
  "message":"auth error: BUZZ_PRIVATE_KEY is required (use --private-key or set env var)"}
[INFO] conversation_loop: Turn ended: reason=text_response finish_reason=stop
  api_calls=5/90 tool_turns=4 response_len=74

So it isn't only a "weaker models don't infer the convention" problem — it's that the delivery contract is unenforceable for any agent that doesn't hold publishing credentials, which is exactly the posture a sandboxed harness should have.

The cost is measurable, not just correctness

We patched a local build to publish the final ACP text when the turn published nothing, and separately reworded the base prompt and the per-turn [Context] block to state that the reply is delivered automatically. Same prompt, same model, before and after:

before:  api_calls=3/90  tool_turns=2   + 1 failed `buzz messages send` (auth_error)
after:   api_calls=1/90  tool_turns=0   + 0 tool calls, 0 auth errors

The prompt half matters as much as the harness half. With the fallback in place but the prompt unchanged, the model still spent 2–10 tool turns per reply attempting a CLI call it could never complete. #4346's approach — fixing what queue.rs::append_reply_instruction tells the agent — is doing real work, not cosmetics, and the two halves want to land together or the win is only partial.

A detail that will bite whoever implements this

Desktop spawns children with RUST_LOG=buzz_acp=info (managed_agents/runtime.rs, child_rust_log_filter). The acp::* targets — acp::stream, acp::tool, acp::plan — are separate target roots, so none of them reach the agent log. That's why streamed text and tool_call: lines never appear there.

Our first patch logged its "published fallback reply" receipt on target: "acp::stream" and was silent in production. The reply appeared, but nothing in the log distinguished "the harness delivered it" from "the model happened to publish this time" — we nearly recorded a false pass. Any fallback merged here should log its receipt on the default buzz_acp target, or operators get a behaviour change they cannot see or audit.

One design note

Silence is a valid turn outcome, and the base prompt says so ("publishing is optional and silence is usually correct"). Models frequently end such turns with text anyway. A default-on fallback converts those into posts. Our gate was: publish only on EndTurn, only when the trimmed final text is non-empty, and only when a relay query shows the agent published nothing to that channel during the turn — the last check keeping correctly-behaving agents (codex, claude) untouched. Opt-in, as #4323 and #4422 do it, seems the safer default regardless.

Also filed #4628 — unrelated to this issue, but found in the same session: desktop emits a missing_binary setup payload that buzz-acp cannot deserialise, hard-failing the agent into a restart loop.

BaneHive avatar Aug 03 '26 22:08 BaneHive

Independent confirmation, on a different runtime, OS, and model class — which I think widens the scope of this beyond Claude Code.

Environment: Buzz local dev build (318fbf896), Windows 10, dockerised relay. Reproduced on both harnesses:

Runtime Model Result
hermes (Hermes Python agent 0.19.1) deepseek-v4-flash via OpenRouter — confirmed in the agent's own API-call logs answers in session text, reply lost ❌
claude (claude-agent-acp 0.64.2) configured as haiku, but see caveat below answers in session text, reply lost ❌

The important half is the Hermes Python runtime, where the model is verifiable: its logs record the actual model on every API call. So this is not specific to the Claude Code harness — a completely separate ACP runtime drops replies the same way, for the same reason. The delivery contract is implicit for every ACP agent, not just Sonnet-class Claude ones.

Caveat on the claude-runtime row: because of #2692, I can't verify which model that agent actually ran. It was configured as haiku, but model_env_var: None on the claude runtime means the configured value never reaches the session — so it was presumably running my Claude Code account default. I'm noting the row for completeness, not as model-specific evidence.

Confirming suggested fix #1 works

I hit this independently and applied essentially the fix proposed here, adding a block to the top of crates/buzz-acp/src/base_prompt.md before the CLI reference:

Your normal text response is NOT delivered to the user. It is discarded.

The only way anything reaches the chat is by running the buzz messages send command. If you finish a turn without running it, the user sees silence — they will think you are broken or offline.

So for EVERY message that expects a reply, including a one-word greeting or a simple "yes": buzz messages send --channel <UUID from [Context]> --content "<your reply>"

Do this even when the answer is trivial. […] If you are ever unsure whether to send, send.

After rebuilding buzz-acp, both agents began replying correctly, with no model change. For the Hermes runtime this is a clean result: same model (deepseek-v4-flash, verified in its API-call logs), prompt change only, silent-drop → correct delivery.

Worth noting since #2703's test plan still has "Sonnet-class agent replies via CLI after a mention" unchecked — this is at least independent evidence that the prompt approach works, on a non-Anthropic model where the model in play is actually verifiable.

A diagnostic signal for the fallback in suggested fix #2

On the Hermes runtime, tool_turns predicted delivery perfectly across six consecutive turns:

turn tool_turns reply delivered?
12:52, 13:08 1 yes
13:15, 13:19 32, 41 yes
22:12, 22:39 0 no

A turn ending with zero tool calls is a near-certain dropped reply. That may be a cheap trigger for the WARN or auto-post proposed above.

Why this is so hard to spot from the UI

Adding to the "everything looks healthy" list — the typing-indicator lifecycle completes cleanly:

06:18:02  kind 9  from owner  "you here?"
06:18:02  kind 7  from agent  👀   (seen)
06:18:03  kind 7  from agent  💬   (typing)
06:18:19  kind 5  from agent  ×2   (typing indicators deleted — turn ended)
          — no kind 9. Nothing logged. No error.

Because the indicators are published and then tidily removed, the UI reads as "the agent considered your message and chose not to reply", rather than as a failure. That's a more misleading signal than plain silence would be.

Cost of the current behaviour

I lost roughly two days to this before finding the cause — instrumenting the relay fan-out, the desktop publish path, and the ACP WebSocket boundary, all of which were working the whole time. Strongly support suggested fix #2: even a bare WARN on "turn completed with no send for the triggering channel" would have collapsed that to minutes.

Related: I've filed #4676 about relay logging making this class of bug effectively invisible — typing indicators (kind 7) and deletions (kind 5) traverse the same /events route as real messages and log identically as accepted:true, so the relay logs actively confirm the wrong hypothesis.

Happy to supply full logs or test any candidate fix on the Hermes runtime + Windows, which seems to be an uncovered combination here.

blissfire avatar Aug 04 '26 07:08 blissfire

Independent confirmation from a Hermes-runtime deployment on Windows (Buzz Desktop 0.5.4, custom harness hermes acp), plus two findings that make the failure mode worse for custom runtimes:

1. The MCP delivery route is effectively unavailable to custom-runtime managed agents. With RUST_LOG=debug we captured session/new frames: the harness always sends "mcpServers": [] for a hermes-runtime agent. The Desktop overrides both mcp_command in managed-agents.json and a user-supplied BUZZ_ACP_MCP_COMMAND (it sets its own empty value on the harness env), and the agent settings UI exposes no field for it. So the buzz-dev-mcp tools never reach the agent, and the CLI is the only delivery path — which makes the implicit-delivery contract described in this issue the single point of failure.

2. Even the CLI path can silently die on the agent side. Hermes's terminal sandbox strips BUZZ_PRIVATE_KEY/BUZZ_RELAY_URL/BUZZ_AUTH_TAG from model-driven shell commands (it classifies them as platform credentials), so every buzz messages send failed with auth_error while the activity panel streamed a perfectly good answer — exactly the "turn runs, activity shows the reply, channel stays empty" symptom (also reported in #3825). We fixed that downstream (NousResearch/hermes-agent#78511), and with it a channel mention now ends in {"accepted":true,…} and the reply renders.

Given how many independent links have to hold for a reply to appear, +1 to the fallback proposed here: if a turn ends without any buzz messages send having been observed, the harness should publish the final session text itself (or at minimum surface a delivery-failure marker to the owner instead of dropping the reply silently). A one-line statement of the delivery contract in the injected [Base] prompt would also have saved us a long debugging session.

vatevstoil avatar Aug 04 '26 13:08 vatevstoil

New reproduction confirms this is an ACP publication failure, not only an agent prompt/model issue. After removing the explicit buzz messages send instruction, Hermes receives thread mentions and completes ordinary ACP text turns (response_len=13) with no auth or tool error. Buzz still shows the Activity indicator but does not publish the response into the thread. This isolates the remaining failure to ACP response publication or thread rendering/turn lifecycle. Related to #2421 and #2459; #3768 is separate credential injection behavior.

jamesjlopez avatar Aug 06 '26 22:08 jamesjlopez

I can confirm this affects OpenClaw-based agents too, and I have a second, deeper cause worth adding to the diagnosis.

Setup: 15 agents in a private community, harness openclaw acp --session agent:<id>:buzz, one agent per Buzz identity/key, BUZZ_ACP_RELAY_OBSERVER=false, BUZZ_ACP_NO_TYPING=true.

Confirmed, matching this issue: the base prompt does contain the "you MUST publish it via buzz messages send" instruction (verified by reading the raw injected [Context] block in the session transcript, including the --reply-to <event-id> hint). Despite that, both kimi-k3 and kimi-k2-thinking agents just answered in plain session text (stopReason: "stop", zero tool calls) — the instruction is present but not acted on, same as the Sonnet behavior reported here.

A second bug that compounds this for gateway-backed harnesses: even when I explicitly instructed an agent to run buzz messages send itself (bypassing the "does the model infer this" problem entirely), the call still failed:

{"error":"auth_error","message":"auth error: BUZZ_PRIVATE_KEY is required (use --private-key or set env var)","retryable":false}

I verified BUZZ_PRIVATE_KEY is correctly set (per-agent, correct value) on the buzz-acp parent process env — but the agent's shell tool never sees it (env | grep -i buzz inside the agent's own bash tool call returns nothing). For harnesses like openclaw acp that proxy exec through a persistent gateway/daemon process rather than executing directly in the spawned child, the gateway's own environment is what the shell call actually runs in — not the per-agent env buzz-acp set on its immediate child. So even with a perfect prompt fix (suggestion 1 in the OP), self-publish-via-CLI would still silently fail for this class of harness, with the exact same symptom (reply in Activity log / session transcript, nothing in the channel).

This makes me think option 2 from the OP (harness-side fallback: auto-post the turn's final text if no buzz messages send was observed) is the more robust fix — it doesn't depend on the model reliably parsing an instruction buried in a large system prompt, and it isn't defeated by harnesses that isolate/proxy their exec environment. Prompt-contract fixes help but can't be the only mitigation given how differently harnesses actually execute shell commands.

Happy to share the full repro (probe script that drives openclaw acp directly over the ACP JSON-RPC protocol and captures tool_call/tool_call_update notifications) if useful.

mastergainer-com avatar Aug 07 '26 07:08 mastergainer-com

Confirmed on Buzz Desktop v0.5.5 with a managed Claude agent on macOS and a self-hosted relay. The agent generated its answer, but nothing appeared in the channel.

Adding an explicit publishing instruction alone was insufficient in my setup because BUZZ_ACP_PERMISSION_MODE=dont-ask prevented Claude from invoking Bash. The following narrowly scoped, Buzz-local workaround allowed replies without enabling unrestricted Bash or bypassPermissions.

Merge these entries into ~/.buzz/.claude/settings.local.json:

{
  "permissions": {
    "allow": [
      "Bash(printf *)",
      "Bash(buzz messages send *)"
    ]
  }
}

I then added this to the individual agent’s instructions:

Your ACP session text is not delivered to the Buzz channel automatically. For every response, publish it using buzz messages send. Bash may be used only for printf and buzz messages send; do not use it for other commands.

After restarting the agent, replies were successfully published and persisted as kind:9 events on the relay.

This is only an operational workaround. It still depends on the model choosing to invoke the CLI, does not provide the deterministic transport-owned publication proposed in this issue, and does not address the private-key boundary in #2883. The local allowlist and prompt should be removed once a proper fix is released.

nutkracker avatar Aug 07 '26 11:08 nutkracker

Hitting this on the built-in Claude Code runtime — no custom harness, no Hermes — against a self-hosted relay. Both reports here and in #3385 involve Hermes/OpenClaw, and the difference matters: on the shipping default I can't find any user-reachable workaround.

Buzz Desktop 0.5.5 (AppImage, Linux x86_64), @agentclientprotocol/claude-agent-acp 0.66.0, built-in claude preset with no overrides, self-hosted relay sha-78c87ae, closed relay with the agent on the roster, Claude Pro subscription auth. Harness starts with an empty companion:

buzz-acp starting: agent_cmd=…/claude-agent-acp  mcp_cmd=
  subscribe=Mentions model=sonnet permission_mode=dontAsk respond_to=owner-only

A mention wakes the agent, it posts 👀 and 💬, runs the turn, then retracts both reactions. No kind:9 is ever published. Over an hour of testing the agent pubkey emitted only kind:7 and kind:5 — checked against the relay's Postgres, not the UI. The reply text does show in Desktop's agent inspector, which is what makes this read as a rendering bug rather than a delivery failure; I spent a long time chasing the wrong layer because of that. A freshly created agent reproduces identically.

When the model does call the CLI, the call fails:

{"error":"auth_error","message":"auth error: BUZZ_PRIVATE_KEY is required (use --private-key or set env var)"}

I confirmed that by running the same command by hand on the host. So this path hits both the implicit delivery contract described here and the missing credentialed companion from #3385.

The reason there's no workaround is that all three levers used on the Hermes/BYOH path are closed on the built-in runtime:

  1. KNOWN_ACP_RUNTIMES declares claude with mcp_command: None, so buzz-acp is started with BUZZ_ACP_MCP_COMMAND="" and no companion is attached.
  2. BUZZ_ACP_MCP_COMMAND is in RESERVED_ENV_KEYS and stripped from user-supplied agent env — deliberately, per the comment there: "Code-execution surface: overriding would let the user run arbitrary binaries/args as the agent process." That's a sound boundary, but it does mean #3385's workaround can't be configured from the UI.
  3. The custom-harness record exposes id, label, command, args, env, install_* and no mcp_command, so defining a custom harness lands in the same state.

buzz-dev-mcp ships inside the AppImage and works fine; there's just no way to point the runtime at it. And since 0.5.5 no longer reveals an agent nsec at creation, supplying BUZZ_PRIVATE_KEY directly isn't an option either.

#2681 implemented the fallback proposed in this issue, with live validation and a passing suite, and was closed with "we have had a few runs at other ways of this — but if this comes back, we will bring it back." From where I'm sitting it has come back: on 0.5.5 the default Claude Code runtime can't answer a mention at all, and it fails silently end to end — the turn completes, tokens bill, the Activity panel streams a correct answer, the chat stays empty, and nothing is logged between turn start and the next lifecycle event.

If the full fix is still contentious, the WARN suggested in the original post would go a long way on its own. Logging when a prompted turn completes with no send for the triggering channel turns this from an invisible failure into a one-line diagnosis.

monkeysphere avatar Aug 08 '26 01:08 monkeysphere