anomalyco / anomalyco/opencode-drive
Expose a backend-only driver for external OpenCode clients
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 32
- Forks
- 3
- Avg merge
- 12m
- Merged PRs (30d)
- 17
Description
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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names OpenCodeDriver.use() and the manual server-only launch path; start by tracing those lifecycle entry points. Compare what is currently exposed for the TUI, then define completion around service and client connection details, retained controllers, settlement, scoped cleanup, and the requested restart and network controls.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, backend, testing-qa
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100