buzz icon indicating copy to clipboard operation
buzz copied to clipboard

desktop: no per-agent MCP injection channel for preset/custom ACP runtimes (omp, hermes)

Open Tony-ooo opened this issue 3 months ago • 1 comments

When a desktop agent runs through a tier-2 preset (omp, hermes) or a custom harness, the desktop app never passes an MCP server to the runtime: BUZZ_ACP_MCP_COMMAND is derived only from known_acp_runtime (goose/claude/codex/buzz-agent), so it is always empty for omp/hermes/custom runtimes, and there is no other injection channel. The same MCP config works fine in omp/goose/codex/claude-code/opencode directly: ACP v1 natively defines stdio/http/sse MCP servers (agentclientprotocol/agent-client-protocol, schema/v1/schema.json), all accept client-injected mcpServers, and omp declares http+sse capability in initialize — so this is a Buzz-specific gap.

Use case: A user runs open-connector (streamable HTTP MCP with Bearer auth) against Notion. It works in omp's interactive sessions, but cannot reach a Buzz agent running on omp — we had to bridge stdio→HTTP ourselves.

Evidence (HEAD 857e63c):

  • desktop/src-tauri/src/managed_agents/runtime.rs:527-529 (+ 294-298, 466-469): MCP command derived only via known_acp_runtime(effective_command); comment: "pure derivations of the command… rather than the frozen record snapshot"
  • desktop/src-tauri/src/commands/agent_models.rs:884-888: "the per-record field is never read by the runtime"; types.rs:258-262 "Never read at spawn"; runtime_metadata.rs:9-10 "Vestigial"
  • desktop/src-tauri/src/managed_agents/custom_harnesses.rs:49-75: HarnessDefinition has no mcp_command; definition env filtered against RESERVED_ENV_KEYS (env_vars.rs:73 includes BUZZ_ACP_MCP_COMMAND), and validate_user_env_keys rejects on save
  • discovery/presets.rs:104-112: omp is a tier-2 preset, but KNOWN_ACP_RUNTIMES (discovery.rs:75-180) has only goose/claude/codex/buzz-agent → known_acp_runtime("omp") = None
  • crates/buzz-agent/src/lib.rs:302-310: initialize declares mcpCapabilities {http:false, sse:false}; mcp.rs only rmcp TokioChildProcess (stdio)
  • crates/buzz-acp/src/config.rs:261 → lib.rs:4280: single stdio server from BUZZ_ACP_MCP_COMMAND

Proposal:

  1. Wire the structured MCP config (#4164's BUZZ_ACP_MCP_CONFIG) into the desktop spawn path, for preset and custom runtimes alike. When BUZZ_ACP_MCP_CONFIG is absent, keep the existing known_acp_runtime-derived command as the fallback so default behavior is unchanged. The managed-agents reconciler (migration.rs:975/1220) must recognize the new config source, or startup will rewrite managed-agents.json from the directory table and clobber the new channel.
  2. When #4271 (Streamable HTTP) lands, forward http mcpServers to runtimes that declare the capability (buzz-agent would need to declare it; rmcp already supports streamable HTTP).
  3. Credential isolation per #4154: third-party MCP servers must not receive BUZZ_PRIVATE_KEY/BUZZ_AUTH_TAG.

Related: #2899 #2900 #3115 #3399 #4154 #4164 #4271 #4301 #4480 #4515

Tony-ooo avatar Aug 03 '26 15:08 Tony-ooo

Thanks for tracing this. #4164 defines the structured ACP input, but Desktop still needs to pass it to every managed runtime. #4588 now handles Project-owned connection setup and keeps credentials out of managed-agent records. Agent bindings and spawn-path materialization remain a separate slice, using #4271 for HTTP support.

wolfyy970 avatar Aug 03 '26 16:08 wolfyy970