Skip to content

fix(host-daemon): detect known ACP agents on the user shell PATH - #1389

Merged
ymichael merged 1 commit into
get-bb:mainfrom
Willhong:fix/known-acp-agents-shell-env
Aug 13, 2026
Merged

ymichael merged 1 commit into
get-bb:mainfrom
Willhong:fix/known-acp-agents-shell-env

Conversation

@Willhong

Copy link
Copy Markdown
Contributor

Fixes #1388

Summary

known_acp_agents.status resolved ACP-agent CLIs against the daemon's process PATH, 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 installed 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.

Change

apps/host-daemon/src/command-dispatch.ts:

-  "known_acp_agents.status": async (command) =>
-    getKnownAcpAgentsStatus({ agents: command.agents }),
+  "known_acp_agents.status": async (command, options) =>
+    getKnownAcpAgentsStatus({
+      agents: command.agents,
+      env: providerCliEnvFromShellEnv(options.runtimeManager.getShellEnv()),
+    }),

getKnownAcpAgentsStatus already accepts an optional env; this wires it to the resolved shell env, identical to provider_cli.status two lines below. No signature or wire-protocol change.

Tests

Added a regression test in command-dispatch.test.ts that places an executable only on the manager's shell PATH (a stand-in for ~/.local/bin), keeps system bin dirs on PATH so which itself resolves, and asserts the ACP agent is detected with the correct executablePath.

Differential verification (the pre-filing gate):

  • With the fix: test passes (installed: true).
  • Reverting only the one-line fix (test unchanged): test fails (installed: false).

Suite results (@bb/host-daemon, via Turbo):

  • pnpm exec turbo run typecheck --filter=@bb/host-daemon → pass
  • command-dispatch.test.ts → 24 passed (23 pre-existing + 1 new)
  • Full @bb/host-daemon test 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.

`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).
@ymichael ymichael self-assigned this Aug 13, 2026
@ymichael
ymichael merged commit b3b5f87 into get-bb:main Aug 13, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Known ACP agents on the login-shell PATH (e.g. Hermes) are not detected under launchd/systemd

2 participants