Skip to content

Inject BB_CLI and re-exec trampoline for agent shells - #554

Merged
SawyerHood merged 1 commit into
mainfrom
bb/investigate-acp-provider-bug-thr_az228r74t7
Jul 8, 2026
Merged

SawyerHood merged 1 commit into
mainfrom
bb/investigate-acp-provider-bug-thr_az228r74t7

Conversation

@SawyerHood

Copy link
Copy Markdown
Collaborator

Summary

  • Inject absolute BB_CLI (daemon-managed bb) into agent runtime shell env alongside PATH prepend
  • Official CLI entrypoints re-exec to BB_CLI when it differs from the current binary (one-hop via BB_CLI_REEXEC), so bare bb still hits the correct build when ACP agents rewrite PATH
  • Document BB_CLI in agent append instructions and guide overview

Context

ACP providers (Grok, opencode, etc.) only get shell env on the agent process; many rebuild PATH for tool shells, so a user-global bb wins over the workspace/daemon binary. Codex/Claude force PATH via shell_environment_policy; ACP has no equivalent.

Test plan

  • @bb/cli tests including bb-cli-reexec
  • @bb/host-daemon runtime-shell-env tests
  • Manual: ACP (Grok) thread — echo $BB_CLI, bb status, "$BB_CLI" status resolve to daemon-managed binary

Risks

  • One re-exec hop on bare bb when PATH hits a different official entrypoint; skipped when BB_CLI matches or is unset

ACP agents often rewrite PATH in tool shells so a user-global bb wins.
Inject absolute BB_CLI into runtime shell env and re-exec official CLI
entrypoints to that binary so bare `bb` uses the daemon-managed build.
@SawyerHood
SawyerHood merged commit eb0a581 into main Jul 8, 2026
10 checks passed
@SawyerHood
SawyerHood deleted the bb/investigate-acp-provider-bug-thr_az228r74t7 branch July 8, 2026 23:05
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.

1 participant