Skip to content

cli: Bun managed-service spawn drops runtime conditions #41324

Description

@tnspacetime

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

  1. Run the V2 CLI from source when it needs to start a managed service.
  2. 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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions