Skip to content

[codex] Fix packaged provider bridge startup - #220

Closed
brsbl wants to merge 1 commit into
mainfrom
bb/thr_2pddvpkqcv
Closed

brsbl wants to merge 1 commit into
mainfrom
bb/thr_2pddvpkqcv

Conversation

@brsbl

@brsbl brsbl commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fix packaged provider bridge startup so Claude Code and Pi bridges do not depend on node being visible on the GUI app PATH after sleep, crash, or macOS app restore.

Root Cause

Runtime-managed Node bridge providers were created with process.command: "node". In the packaged desktop app, the host daemon can be restored or cold-started by macOS without the user's shell/NVM PATH, so provider startup could fail with spawn node ENOENT after the machine died or the app had to reconstruct provider state.

Changes

  • Added bridge-specific Node executable/env options to the agent runtime adapter contract.
  • Runtime-managed providers now pass process.execPath to Node bridge adapters by default.
  • When the runtime is running under Electron, bridge processes receive ELECTRON_RUN_AS_NODE=1 so the packaged app binary can run the bridge scripts as Node.
  • Claude Code and Pi bridge adapters consume the configured bridge runtime while preserving node as the direct-adapter default.
  • Added regression coverage for configured bridge runtime propagation and adapter process env overlay.

Validation

  • pnpm exec turbo run typecheck --filter=@bb/agent-runtime
  • pnpm exec turbo run test --filter=@bb/agent-runtime
  • pnpm exec turbo run typecheck --filter=@bb/host-daemon --force

@brsbl
brsbl marked this pull request as ready for review June 18, 2026 19:13
@ymichael ymichael closed this Jun 19, 2026
ymichael added a commit that referenced this pull request Jun 22, 2026
## Summary
- Launch runtime-managed Node bridge providers with an explicit Node
runtime instead of relying on `node` on GUI app PATH
- Pass `ELECTRON_RUN_AS_NODE=1` only to Electron-launched bridge
processes
- Cover Claude Code, Pi, and ACP bridge adapters on current `main`
- Strip bridge-only Electron runtime env before launching downstream
Claude/ACP agent subprocesses

## Repro
- Confirmed `spawn node` fails with `ENOENT` when `PATH` is empty
- Confirmed `process.execPath` still launches successfully with empty
`PATH`
- Added a regression test that clears `PATH` and starts a
runtime-managed bridge provider

## Validation
- `pnpm exec turbo run typecheck --filter=@bb/agent-runtime`
- `pnpm exec turbo run test --filter=@bb/agent-runtime --force`

Replaces #220.
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.

2 participants