Description
On V2 source builds, starting or replacing the managed background service can fail even though the original CLI starts correctly.
The development CLI runs with --conditions=browser. However, selfCommand() reconstructs the Bun child command as:
[process.execPath, entrypoint]
ServiceConfig then appends serve --service. The child therefore loses --conditions=browser and exits before registering.
Running the child directly without the condition fails deterministically:
error: Cannot find module 'react/jsx-dev-runtime' from
'packages/tui/src/config/v1/index.tsx'
Running the same command with --conditions=browser starts the service successfully.
Plugins
None
OpenCode version
V2 branch at f43f2b3
Steps to reproduce
- Run the V2 CLI from source when it needs to start a managed service.
- The spawned service exits before registration.
The generated child command fails:
bun packages/cli/src/index.ts serve --service
Error:
Cannot find module 'react/jsx-dev-runtime'
The same command succeeds with the original runtime condition:
bun run --cwd packages/cli --conditions=browser src/index.ts serve --service
selfCommand() drops --conditions=browser when reconstructing the Bun command.
Screenshot and/or share link
No response
Operating System
macOS, arm64
Terminal
Apple_Terminal
Description
On V2 source builds, starting or replacing the managed background service can fail even though the original CLI starts correctly.
The development CLI runs with
--conditions=browser. However,selfCommand()reconstructs the Bun child command as:ServiceConfigthen appends serve--service. The child therefore loses--conditions=browserand exits before registering.Running the child directly without the condition fails deterministically:
Running the same command with
--conditions=browserstarts the service successfully.Plugins
None
OpenCode version
V2 branch at f43f2b3
Steps to reproduce
The generated child command fails:
bun packages/cli/src/index.ts serve --service
Error:
Cannot find module 'react/jsx-dev-runtime'
The same command succeeds with the original runtime condition:
bun run --cwd packages/cli --conditions=browser src/index.ts serve --service
selfCommand() drops --conditions=browser when reconstructing the Bun command.
Screenshot and/or share link
No response
Operating System
macOS, arm64
Terminal
Apple_Terminal