fix(acp): per-runtime env defaults at spawn — isolate Hermes from configured MCP startup - #3420
Merged
Merged
Conversation
…figured MCP startup Hermes starts every profile-configured MCP server before answering ACP initialize, which can exhaust Desktop's 10s model-discovery budget (#3355). Buzz supplies session MCP servers explicitly through session/new, so that global startup is unnecessary for Buzz-owned processes. Rather than a Hermes special case in the spawn path, add a generic per-runtime env-defaults table, config::default_agent_env(), mirroring the existing default_agent_args()/codex_network_env() precedent, and merge it once in AcpClient::spawn with the established precedence: runtime defaults < persona extra_env < inherited parent env Hermes is currently the only row. Also normalize Windows .cmd/.bat shims alongside .exe in normalize_agent_command_identity (npm installs resolve to those wrappers), and switch the extra_env parent-presence check to var_os so non-UTF-8 parent values are honored. Replaces the runtime-specific approach in #3386. Signed-off-by: npub1qyvc0c5kl4gqv2fd97fsk46tu378sqgy35vc83rvgfwne90sel7s0ed67d <011987e296fd5006292d2f930b574be47c7801048d1983c46c425d3c95f0cffd@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@block.xyz> Signed-off-by: Tyler Longwell <tlongwell@block.xyz>
atishpatel
added a commit
that referenced
this pull request
Jul 29, 2026
…ounting-and-solo * origin/main: fix(acp): per-runtime env defaults at spawn — isolate Hermes from configured MCP startup (#3420) fix(relay): avoid subscription lock inversion (#3413) feat: add explicit entry for claude-opus-5 in model config (#2831) fix(desktop): clear stale thread new-message pill (#3411) fix(ci): ratchet file sizes against the base tree (#3352) chore(ci): bump desktop smoke E2E timeout to 30 minutes (#3409) release(chart): publish 0.1.7 (#3393) Signed-off-by: Atish Patel <atish@squareup.com>
joahg
added a commit
to joahg/buzz
that referenced
this pull request
Jul 29, 2026
…-style * origin/main: fix(acp): per-runtime env defaults at spawn — isolate Hermes from configured MCP startup (block#3420) Signed-off-by: Joah Gerstenberg <joah@squareup.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
config::default_agent_env(), mirroring the existingdefault_agent_args()/codex_network_env()precedent, and merge it once inAcpClient::spawnwith the established precedence: runtime defaults < personaextra_env< inherited parent envHERMES_ACP_SKIP_CONFIGURED_MCP=1, so Hermes does not preload unrelated profile-configured MCP servers before answering ACPinitialize(fixes the 10s model-discovery timeout in [Bug] Hermes model discovery times out in Buzz Desktop v0.5.0 #3355 — Buzz supplies session MCP servers explicitly throughsession/new, per Hermes's documented host-integration contract for this variable).cmd/.batshims alongside.exeinnormalize_agent_command_identity(npm installs resolve to those wrappers)extra_envparent-presence check fromvar()tovar_os()so non-UTF-8 parent values are honoredReplaces the runtime-specific approach in #3386: same behavior, but the mechanism is generic runtime spawn metadata in
config.rsrather than a Hermes/ACP special case inacp.rs, and the seam covers every launch path (Desktop spawn,buzz-acp models, CLI) because they all funnel throughAcpClient::spawn. ~15 lines of production code.Fixes #3355
Testing
cargo test -p buzz-acp— 639 passed, 0 failed (full package, includes the newdefault_agent_env_recognizes_hermes_identitiesunit test andspawn_applies_runtime_env_defaults_with_extra_env_precedenceintegration test covering default injection, extra_env override, and non-Hermes exclusion)cargo fmt --all -- --check,cargo clippy -p buzz-acp --all-targets -- -D warnings— cleanhermes-acp):buzz-acp modelsreturned 13 models / currentModelId in 2.6–3.0s (was a 10.0s timeout on the first cold run without isolation); a wrapper probe confirmed the child receivedHERMES_ACP_SKIP_CONFIGURED_MCP=1by default and0when the parent env set it explicitly (operator wins)No UI changes; subprocess environment behavior only.