buzz icon indicating copy to clipboard operation
buzz copied to clipboard

[Bug] Custom/BYOH ACP harness receives no authenticated Buzz reply tool, so completed turns cannot post

Open kjbraddock1980 opened this issue 4 months ago • 9 comments

Describe the bug We are trying to run Buzz Desktop as macOS user A while keeping an existing Hermes backend and profile isolated under macOS user B. Buzz owns channel membership and lifecycle, while the custom ACP harness crosses the user boundary through a narrowly scoped command:

/usr/bin/sudo -n -H -u /Users//.hermes/hermes-agent/venv/bin/hermes-acp

The process topology, ACP initialization, and prompt delivery all succeed. The first real mention reaches Hermes, but Hermes cannot post its response to the channel. Its attempt to run buzz messages send exits with:

auth_error: BUZZ_PRIVATE_KEY is required

The ACP turn and process chain remain healthy, so this presents as a successful turn with a silently missing reply, similar to #2459 and #2698.

Verified failure boundary

This does not appear to be caused simply by sudo stripping inherited environment variables.

For a managed agent, Buzz Desktop derives the companion MCP command from the effective agent command using the known-runtime catalog. With the explicit custom command set to /usr/bin/sudo, the command is not recognized as a built-in runtime, so the effective MCP command is empty.

As a result:

Buzz correctly launches the custom ACP process. ACP initialization succeeds. buzz-acp does not include the authenticated buzz-dev-mcp companion in session/new. The turn prompt still instructs the agent to reply using buzz messages send. Hermes falls back to its ordinary terminal, which does not—and should not—contain the Buzz signing key. The CLI returns BUZZ_PRIVATE_KEY is required, and no channel reply appears.

Hermes Agent ACP 0.19.0 supports ACP-provided mcpServers; the missing piece is that Buzz does not provide its authenticated companion MCP server for this custom effective command.

The cross-user boundary is relevant because copying the private key into user B’s environment, preserving it through sudo, or installing another credential-bearing Hermes instance would defeat the intended isolation. It is not the desired fix.

Steps to reproduce Run Buzz Desktop under macOS user A. Configure a custom ACP harness with: command: /usr/bin/sudo args: -n -H -u Pin that command and argument override to one owner-only, mention-triggered managed instance with parallelism 1. Give user B access only to the required Buzz working directory. Permit only the exact Hermes ACP executable through a narrow passwordless sudo rule. Start the instance and confirm one initialized ACP worker. Mention the agent in its Buzz channel.

Observe that Hermes processes the turn and attempts buzz messages send, but the CLI reports that BUZZ_PRIVATE_KEY is required and no reply appears.

Observed sanitized process tree:

user-a buzz-desktop └─ user-a buzz-acp └─ root sudo -n -H -u user-b .../hermes-acp └─ user-b python .../hermes-acp

Verified:

One buzz-acp supervisor One initialized worker Pool ready Hermes Agent ACP 0.19.0 No bundled buzz-agent child Stable process chain throughout the failed turn No authenticated Buzz MCP companion available to Hermes

Expected behavior A custom/BYOH ACP harness should receive a scoped method for posting its managed agent’s reply without:

exposing BUZZ_PRIVATE_KEY to the agent’s ordinary terminal passing the raw key through sudo copying credentials between user homes weakening sudo environment restrictions installing a second credential-bearing agent backend

Possible directions:

Allow custom harness definitions or managed instances to specify a companion MCP command, so Buzz can provide buzz-dev-mcp through ACP session/new. Have buzz-acp own final-response publication and detect/retry delivery failures. Provide a typed, narrowly scoped, harness-owned reply capability rather than exposing the raw signing key, consistent with the security concern in #2883. If custom harnesses are not intended to receive Buzz reply tooling, reject or warn on configurations where the prompt requires buzz messages send but no MCP companion is configured.

Questions for maintainers Should custom/BYOH harnesses receive Buzz’s authenticated companion MCP server? Is there an intended way to associate buzz-dev-mcp with a custom command that is not in known_acp_runtime? Would adding a companion mcpCommand field to custom harness definitions be the preferred design?

Longer term, should reply publication live in buzz-acp rather than depend on the model invoking the CLI? Is anyone successfully running Hermes, OpenClaw, or another existing operator brain behind Buzz across a user, container, or service boundary?

Related issues #2459 — successful ACP turn with a silently lost CLI reply #2698 — reply delivery depends on the agent invoking buzz messages send #2883 — raw BUZZ_PRIVATE_KEY should not enter agent-controlled process environments #3115 — MCP command/environment provisioning for managed agents #2663 — external agent systems and existing operator brains

Version and platform Buzz Desktop: 0.5.0 OS: macOS Custom backend: Hermes Agent ACP 0.19.0 Relay: communities.buzz.xyz

Logs / additional context Sanitized failure:

auth_error: BUZZ_PRIVATE_KEY is required

No private keys, auth tags, complete managed-agent stores, or credential values are included.

kjbraddock1980 avatar Jul 28 '26 20:07 kjbraddock1980

I reproduced the same failure with Buzz Desktop v0.5.0's normal first-class Hermes preset, without a custom command, sudo, a cross-user boundary, or a remote relay. This broadens the scope beyond BYOH/custom harnesses.

Native-preset reproduction

  • macOS
  • Buzz Desktop 0.5.0
  • Hermes Agent ACP 0.19.0
  • Local Buzz relay
  • Runtime: hermes
  • Agent command: hermes-acp
  • ACP supervisor: buzz-acp

The managed record contained mcp_command: buzz-dev-mcp, but the effective startup log showed an empty companion command:

buzz-acp starting: ... agent_cmd=.../hermes-acp  mcp_cmd= ...

A DM reached Hermes, the model completed the turn, and Hermes attempted delivery through its ordinary terminal. Delivery then failed exactly as described here:

Tool terminal returned error: auth error: BUZZ_PRIVATE_KEY is required
Turn ended: reason=text_response ... response_len=862

No reply appeared in Buzz. The model/provider remained healthy; the failure boundary was solely final-message publication.

Verified local workaround

I configured a per-agent buzz-acp launcher that sets BUZZ_ACP_MCP_COMMAND to a minimal MCP server exposing only one typed operation: send_message(channel, content, reply_to). The server:

  • receives the managed identity only from Buzz's injected MCP child environment;
  • never places the signing credential in Hermes's terminal environment or hardcodes it;
  • delegates publication to the packaged Buzz CLI using stdin;
  • validates channel/reply identifiers and message size;
  • treats delivery as successful only when Buzz returns accepted=true;
  • exposes no shell, filesystem, or general-purpose development tools.

I also inject a delivery contract at launcher startup because the managed persona prompt is regenerated and overwrote a direct prompt edit.

After restarting Hermes, the logs showed:

mcp_cmd=.../buzz-hermes-reply-mcp
MCP server 'buzz-hermes-reply-mcp' ... registered ... send_message
... send_message completed

Two independent DM tests, including a second Hermes restart, posted successfully. There were zero new BUZZ_PRIVATE_KEY is required errors afterward.

Suggested upstream direction

This indicates that the first-class Hermes preset also needs an authenticated, narrowly scoped reply capability. Supplying the full buzz-dev-mcp would be broader than necessary. The safer permanent solutions still appear to be either:

  1. a Buzz-owned opaque/typed publisher capability limited to the current managed identity and allowed channel/reply context; or
  2. buzz-acp publishing the completed ACP response itself and surfacing delivery failure explicitly.

The stock preset should also fail loudly if it starts with a prompt that requires Buzz publication but no reply capability is attached.

HashMac avatar Jul 29 '26 11:07 HashMac

Thank you—this workaround got us to a working, verified reply path while keeping the agent’s ordinary environment free of the private key. Really appreciate the concrete implementation details.

kjbraddock1980 avatar Jul 29 '26 15:07 kjbraddock1980

Also hitting this on macOS with a custom ACP harness (hermes-acp). The harness spawns the agent shell without BUZZ_PRIVATE_KEY, BUZZ_RELAY_URL, and BUZZ_AUTH_TAG — all three are reserved by Buzz Desktop so they can't be overridden in the UI either.

Workaround for now: scrape the parent process env at session start:

# ~/.buzz/bin/buzz-env.sh — source this at agent session start
extract_var() {
  ps eww -p $PPID 2>/dev/null | grep -oE "$1=[^[:space:]]+" | head -1 | cut -d= -f2-
}
export BUZZ_PRIVATE_KEY="${BUZZ_PRIVATE_KEY:-$(extract_var BUZZ_PRIVATE_KEY)}"
export BUZZ_RELAY_URL="${BUZZ_RELAY_URL:-$(extract_var BUZZ_RELAY_URL)}"
export BUZZ_AUTH_TAG="${BUZZ_AUTH_TAG:-$(extract_var BUZZ_AUTH_TAG)}"

This works because buzz-acp still has the vars in its own env — they just don't propagate to the child shell. Not a fix, but unblocks delivery until the companion MCP / env injection lands properly.

dkapo88 avatar Aug 02 '26 01:08 dkapo88

Another confirmed reproduction, with Codex rather than Hermes, on Buzz v0.5.2 using a WSL-hosted custom ACP runtime.

The message reached Codex, the model completed the turn, and the generated response was visible in the Codex rollout. The response was not published because the required prompt contract delegated final delivery to:

buzz messages send ...

Once the Linux buzz CLI was available, it failed with:

{"error":"auth_error","message":"auth error: BUZZ_PRIVATE_KEY is required ..."}

For this WSL case, BUZZ_PRIVATE_KEY, BUZZ_AUTH_TAG, and relay settings existed in the parent Windows buzz-acp process but were severed at the wsl.exe boundary. Forwarding the required BUZZ_* variables through WSLENV made publication work and the relay returned accepted: true.

That proves raw environment forwarding is a functional workaround, but it also reinforces the security concern in this issue: the key becomes available to the general agent shell. A narrowly scoped publisher owned by buzz-acp (or a minimal authenticated MCP operation bound to the current identity/channel/reply context) would avoid both silent reply loss and raw-key exposure.

There was one additional Codex-specific wrinkle: the first local http://localhost:3210/query call was denied by the agent sandbox (Operation not permitted); an automatically retried call with elevated network permission succeeded. A typed Buzz reply capability would also avoid requiring a general shell/network escalation merely to deliver the agent's final response.

al-osokin avatar Aug 07 '26 00:08 al-osokin

I went pretty deep on this because it is the exact failure I was seeing with Hermes: the model completed, but the reply never reached Buzz, and copying the signing key into Hermes's normal shell was not an acceptable fix.

I built and tested a harness-owned publisher that keeps signing, routing, trusted mention resolution, and idempotency inside buzz-acp. The reference implementation is here (based on Desktop 0.5.8, so it is evidence/reference rather than a merge-ready branch against current main):

https://github.com/TheVisher/buzz/commit/619e0df20cfcc6a80df04ea297366b6871446765

The main conclusions from testing:

  • Only a real ACP EndTurn should publish.
  • Captured output needs exact session/message-ID semantics; tool calls, foreign sessions, overflow, cancellation ambiguity, and limit exits must not leak partial text into a reply.
  • Routing must come from the accepted inbound batch, never model text.
  • Publication uncertainty needs a durable operation that retries/reconciles the exact same signed event ID.
  • Visible textual mentions should resolve against trusted channel membership/profile data and produce real p tags; unresolved or ambiguous markers should fail before signing.
  • The ACP worker must receive none of the Buzz signing/broker authority variables.

That branch passed 748 ACP unit tests, 9 ACP integrations, 97 dev-MCP tests, strict Clippy, formatting, and a bounded signed-event harness covering duplicate suppression, lost-response reconciliation, exact tags, signature verification, and worker credential stripping.

I also want to be clear about the live result: I did not get a clean phone-to-channel acceptance pass. My temporary local candidate launcher invalidated both attempts before durable publication, and Buzz correctly emitted zero replies and zero broker ledger entries. So I am submitting the architecture, tests, and failure evidence—not claiming that the production mobile path was proven.

I left the concrete review findings on #5169 rather than opening another competing Buzz PR.

TheAirick avatar Aug 09 '26 01:08 TheAirick

Confirmed on Buzz Desktop 0.5.10 on macOS with both the built-in Hermes preset and profile-isolated custom Hermes ACP harnesses.

Reproduction

  1. Create and start a Buzz-managed Hermes agent.
  2. Send it a DM, or mention it in a channel, requesting a unique exact response.
  3. Hermes receives the event and completes the model turn normally.
  4. Buzz's Activity view streams the generated response.
  5. No agent-authored message appears in the actual DM or channel.

The generated turn attempts the required explicit delivery step through buzz messages send, which fails with the same sanitized error reported here:

auth_error: BUZZ_PRIVATE_KEY is required
exit code: 3

This is not limited to channel mentions: the same publication failure occurs in a direct message. Identity creation, startup, inbound routing, model execution, and ACP response streaming all work; only outbound conversation publication fails.

The effective Hermes runtime has no authenticated companion MCP reply capability. Exposing the raw signing key to Hermes's general terminal would weaken the managed-agent security boundary, so I have not used that workaround.

Expected: buzz-acp should either publish a valid final ACP response itself or provide a narrowly scoped authenticated reply sidecar. If neither capability is available, startup should fail visibly rather than presenting a completed response only in Activity.

No credentials, managed-agent state, private workspace names, filesystem paths, screenshots, or raw logs are included.

dean-yates avatar Aug 12 '26 23:08 dean-yates

same bug when you try setting up Deepseek Harness... attaching from the agent activity below, no message on chat:

PV said hi and asked me to say something. Let me reply.
The BUZZ_AUTH_TAG is set but BUZZ_PRIVATE_KEY isn't. The CLI needs the private key env var. Let me check if there's another way or a config file.
Right, BUZZ_PRIVATE_KEY is required. It's not set, and I don't have access to private keys. I'll reply via the platform directly instead — my normal text output is delivered as a channel message.
PV — hey! 👋 I'm here. What's up?

adroitandroid avatar Aug 22 '26 15:08 adroitandroid

Hitting this on a standalone buzz-acp invocation — no Desktop, no sudo, no cross-user boundary — which suggests the cause is broader than the known-runtime catalog failing to recognise a custom command.

Setup: self-hosted relay, buzz-acp launched by hand with --agent-command claude-agent-acp, --private-key supplied via BUZZ_PRIVATE_KEY, agent identity is a plain relay member.

Three findings, in the order they bit:

1. --relay-url configures the harness only; it is never exported to the agent.

buzz-acp --relay-url wss://<host> sets up the harness websocket correctly. But the agent subprocess inherits no BUZZ_RELAY_URL, so when the injected base prompt tells it to reply with buzz messages send, the CLI falls back to its own default and fails:

network error: error sending request for url (http://localhost:3000/query): Connection refused

Note the two binaries read the same env var with different defaults — buzz-acp ws://localhost:3000, the buzz CLI http://localhost:3000. Exporting BUZZ_RELAY_URL from the launcher fixes this. BUZZ_AUTH_TAG is likewise unset, which silently makes buzz agents draft-create unavailable.

2. With --mcp-command unset (the default), there is no authenticated reply path at all — yet the base prompt still instructs the agent to use buzz messages send. The harness tells the agent to use a tool it has not configured, and the failure presents as a healthy turn with a silently missing reply, exactly as described above.

3. Attaching buzz-dev-mcp is not a safe workaround, and does not provide a reply tool.

Setting --mcp-command /Applications/Buzz.app/Contents/MacOS/buzz-dev-mcp:

  • Its toolset is shell, read_file, str_replace, todo, view_image. There is no messages_send. The agent still shells out to the same CLI; only the process changes.
  • The MCP server is spawned by buzz-acp as a direct child outside the agent runtime's sandbox, running at the invoking uid. With claude-agent-acp, filesystem restrictions configured in .claude/settings.json apply to the agent's own Bash tool and not to the MCP child.

Measured on macOS 14.7, same two commands, same turn, two different tools:

# via the MCP `shell` tool
ls ~/.agents/...      -> exit 0, contents enumerated
# via the agent's own Bash tool
ls ~/.agents/...      -> Operation not permitted

So attaching the companion MCP silently converts a sandboxed agent into one with arbitrary read/write at the user's uid. That seems worth separating from the reply-tool question, and possibly worth its own issue.

Suggested direction

  • Export BUZZ_RELAY_URL (and BUZZ_AUTH_TAG) into the agent subprocess environment, since the injected prompt depends on them.
  • Give the companion MCP an actual messages_send tool, so replying does not require a general-purpose shell plus a signing key in the agent's environment. As it stands an operator chooses between a mute agent and an unconfined one.
  • Either sandbox the MCP child the way the agent runtime is sandboxed, or let --mcp-command restrict which tools are exposed.
  • Failing fast when --mcp-command is empty would at least make the missing path visible, rather than surfacing as an agent that reacts and never speaks.

Happy to supply harness logs.

peterkaminski avatar Aug 25 '26 15:08 peterkaminski

Follow-up to my earlier Codex/WSL reproduction: I now tested the stronger case where the managed startup configuration contains a non-empty companion MCP command, while the signing key remains correctly absent from the Codex worker.

Environment:

  • Windows 10 22H2 + WSL2 Ubuntu
  • Buzz Desktop candidate based on PR #3679 head 0bc8cfa5
  • @agentclientprotocol/codex-acp 1.1.10
  • WSL custom alias mapped to the packaged buzz-dev-mcp.exe

The startup log confirmed the translated WSL-visible sidecar path, rather than the previous empty value:

mcp_cmd=/mnt/c/.../Buzz PR3679 Latest/buzz-dev-mcp.exe

The agent connected, discovered its channel, subscribed, and received an explicit mention. BUZZ_PRIVATE_KEY was absent from the Codex process, as intended. But the Codex session still had no typed Buzz reply operation available. It attempted the prompt's buzz messages send route instead:

  1. the WSL buzz CLI failed with BUZZ_PRIVATE_KEY is required;
  2. the first packaged Windows CLI attempt failed at the sandbox/WSL boundary;
  3. a retry outside the sandbox finally returned accepted:true.

The relay received exactly one signed reply, but it was published by the general Windows CLI fallback, not by an MCP reply capability. So a non-empty mcp_cmd is not sufficient evidence that the agent has a safe reply path.

This matches the later finding in this thread that buzz-dev-mcp exposes developer shell/filesystem tools but no typed messages_send. In the WSL case it leaves the same undesirable choice: a mute worker, or general command execution outside the worker sandbox to reach a credential-bearing CLI.

The acceptance criteria that this reproduction suggests are:

  • no signing key in the ACP worker environment;
  • a narrow typed send operation bound to the managed identity and accepted channel/reply context;
  • delivery result returned explicitly (accepted:true or a visible error);
  • no general shell or network escalation required for final-message publication;
  • fail loudly at startup when the prompt requires Buzz publication but no reply capability is attached.

No credentials or private managed-agent state are included here.

al-osokin avatar Sep 01 '26 16:09 al-osokin