I'm looking at using opencode-drive for deterministic desktop E2E tests.
My current setup starts:
- An isolated real OpenCode service
- A small scripted OpenAI-compatible LLM
- A desktop client
- Playwright connected over CDP
Drive would be a much better replacement for the scripted LLM and service lifecycle. The native simulation transport, tool control, settlement checks, disconnects, and network fault injection would all be useful.
The main issue is that the public driver API is currently coupled to OpenCode's TUI. OpenCodeDriver.use() launches a primary TUI, while a manual script can launch only the server but doesn't expose connection details intended for launching another frontend process.
A backend-only API for this use case would be great. Something along these lines:
OpenCodeBackend.use(options, ({ opencode, llm, tools, service, artifacts }) =>
Effect.gen(function* () {
// Launch a desktop or web client against the service.
}),
)
Alternatively, an option such as OpenCodeDriver.use({ tui: false }, ...) could work.
The important parts for me would be:
- Prepare the isolated project, config, home, and service registration
- Launch OpenCode with the simulation backend, without launching a TUI
- Expose the generated SDK client
- Expose enough connection information or environment variables for an external frontend
- Keep the current LLM and tool controllers
- Keep settlement and scoped cleanup
- Ideally retain server restart and network controls
The only blocker is integrating its backend lifecycle without also taking ownership of the frontend.
I'm willing to open a PR adding this soon if the proposed direction makes sense.
I'm looking at using
opencode-drivefor deterministic desktop E2E tests.My current setup starts:
Drive would be a much better replacement for the scripted LLM and service lifecycle. The native simulation transport, tool control, settlement checks, disconnects, and network fault injection would all be useful.
The main issue is that the public driver API is currently coupled to OpenCode's TUI.
OpenCodeDriver.use()launches a primary TUI, while a manual script can launch only the server but doesn't expose connection details intended for launching another frontend process.A backend-only API for this use case would be great. Something along these lines:
Alternatively, an option such as
OpenCodeDriver.use({ tui: false }, ...)could work.The important parts for me would be:
The only blocker is integrating its backend lifecycle without also taking ownership of the frontend.
I'm willing to open a PR adding this soon if the proposed direction makes sense.