fix(acp): allow hosts to skip configured MCP startup#70405
Conversation
|
Hey @amanning3390 — clean, minimal host escape hatch. Exact Two intentional notes so it lands smoothly: 1) Desktop E2E failure looks unrelated to this diffCI is red on Desktop E2E / Playwright ( 2) Document the env var for ACP host authorsOne short note in ACP docs / env reference (name, exact value I can help with a tiny docs blurb or a CI re-run comment if you want — otherwise no pressure. Thanks for making Hermes a good citizen under external ACP hosts. Rooting for Hermes + Buzz. |
Adds a 'Host integration' section to the ACP guide and a row in the environment variable reference so the next ACP host implementer does not have to read the adapter source. Documents the exact contract the tests already pin: the value must be exactly `1`; unset/empty/`0`/`false` keep the default behavior; only globally configured config.yaml MCP discovery is skipped, and servers supplied by the ACP session through session/new are still registered. Framed as a host-set process marker rather than user configuration - the same shape as the existing HERMES_KANBAN_TASK entry - so it does not read as a behavioral setting that belongs in config.yaml. Co-authored-by: amanning3390 <adam.manning@pro-serveinc.com> Signed-off-by: amanning3390 <adam.manning@pro-serveinc.com>
The Hermes runtime helpers were defined but never reached a real code path: both carried #[allow(dead_code)] and were only exercised by their own unit tests. As a result Hermes could appear in onboarding and then fail model discovery on the shared 10s budget, and the paired Hermes change (NousResearch/hermes-agent#70405) stayed inert because Buzz never set the marker it reads. - Apply acp_env_for_agent() on the AcpClient::spawn command so every spawn path (probes and managed sessions) gets runtime-specific env. Operator precedence is preserved: an exported value is not overwritten. - Resolve the probe budget with model_probe_timeout_for_agent() at all three initialize/session sites, and report the budget actually used in the timeout messages instead of a hardcoded 10s. - Drop both #[allow(dead_code)] attributes so the compiler enforces the wiring. - Move the helpers next to the spawn they serve. Non-Hermes runtimes are unchanged: no extra env and the existing MODELS_TIMEOUT fast-fail. Co-authored-by: amanning3390 <adam.manning@pro-serveinc.com> Signed-off-by: amanning3390 <adam.manning@pro-serveinc.com>
|
Thanks @Bartok9 — both items addressed. 1) Desktop E2E failure — evidence it's unrelatedYour read is correct, and here's the specific evidence rather than just agreement. What failed: That's the desktop queue/compaction UI. This PR's entire diff is two files: The decisive part: the identical job passed on #70404 in the same CI sweep:
Same base, same sweep, and the failing spec is untouched by either branch — so it's ambient desktop flake, not a regression from this change. It also failed on retry #1, which is consistent with a genuinely flaky assertion rather than a transient timeout. Could a maintainer re-run the failed 2) Marker documented for ACP host authorsNew commit:
On framing: AGENTS.md rejects new I checked the docs against the implementation instead of describing intent — the wording matches what
Both halves are now liveYou noted Buzz #2656 defined the marker but never applied it on spawn — correct, and that's fixed: block/buzz#2656 now applies Thanks for pushing on the docs — you're right that the next host implementer shouldn't have to read the adapter source to find this. |
Problem
When Hermes runs as an ACP subprocess under a host like Buzz, it starts all globally configured MCP servers before entering its JSON-RPC loop. The host already provides MCP servers through the ACP
session/newhandshake (mcpServersfield), so this global startup is redundant and can cause:What This Changes
Adds
HERMES_ACP_SKIP_CONFIGURED_MCP=1environment variable behavior. When set (by the ACP host), Hermes skips global configured-MCP discovery before entering its serve loop. When unset/empty/false, existing behavior is fully retained.ACP session-supplied MCP handling (
session/newmcpServers) is completely unaffected — per-session MCP servers still work normally.Scope
acp_adapter/entry.py— env var check before global MCP discoverytests/acp/test_entry.py— 3 new tests covering skip-enabled, skip-disabled (None/empty/0/false), and session-MCP-unchangedVerification
Usage
Hosts set the env var when spawning
hermes acp:This is a generic mechanism — any ACP host can use it, not just Buzz.
Infographic