Repository navigation
fix(host-daemon): detect known ACP agents on the user shell PATH - #1389
Merged
Merged
Conversation
`known_acp_agents.status` ran `which <executable>` with the daemon's process environment, while the sibling `provider_cli.status` handler resolves the user's login-shell PATH via `providerCliEnvFromShellEnv(runtimeManager.getShellEnv())`. A daemon started by launchd/systemd inherits a stripped PATH, so ACP CLIs that live only on the login PATH (e.g. Hermes' `hermes` under ~/.local/bin) were reported as not installed and never appeared as providers, even though codex/claude detection on the same host worked. Pass the resolved shell env into `getKnownAcpAgentsStatus`, matching the provider-CLI path. Adds a regression test that exposes an executable only on the manager's shell PATH and asserts it is detected; reverting the one-line fix makes the test fail (installed: false).
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.
Fixes #1388
Summary
known_acp_agents.statusresolved ACP-agent CLIs against the daemon's processPATH, while the siblingprovider_cli.statushandler resolves the user's login-shellPATHviaproviderCliEnvFromShellEnv(runtimeManager.getShellEnv()). A daemon started by launchd/systemd inherits a strippedPATH, so ACP CLIs installed only on the login PATH (e.g. Hermes'hermesunder~/.local/bin) were reported as not installed and never appeared as providers — even though codex/claude detection on the same host worked.Change
apps/host-daemon/src/command-dispatch.ts:getKnownAcpAgentsStatusalready accepts an optionalenv; this wires it to the resolved shell env, identical toprovider_cli.statustwo lines below. No signature or wire-protocol change.Tests
Added a regression test in
command-dispatch.test.tsthat places an executable only on the manager's shell PATH (a stand-in for~/.local/bin), keeps system bin dirs on PATH sowhichitself resolves, and asserts the ACP agent is detected with the correctexecutablePath.Differential verification (the pre-filing gate):
installed: true).installed: false).Suite results (
@bb/host-daemon, via Turbo):pnpm exec turbo run typecheck --filter=@bb/host-daemon→ passcommand-dispatch.test.ts→ 24 passed (23 pre-existing + 1 new)@bb/host-daemontest run → 543 total, all green with the fix (the single failure seen mid-development was a test-setup issue in the new test, since fixed).Risk
Low, and strictly a widening. Previously the handler could only see the daemon's process PATH; now it additionally sees the resolved user shell PATH — exactly what the provider-CLI checks already do. No behavior change for agents already on the process PATH.