What to build
Extend opencodeRuntime.ts to fully manage the OpenCode sidecar process in managed mode: start, stop, health check, ...
This is the core runtime lifecycle slice. The codebase already has startOpenCodeServerProcess using `ChildProcessSp...
How to verify
- Call the sidecar start endpoint after OpenCode binary is on disk (Slice 4).
- Backend spawns the process, health check passes.
- Send a chat message through the managed sidecar.
- Receive a response from OpenCode.
- Call the stop endpoint. Process terminates cleanly.
- Restart: fresh password generated (no reuse).
Out of scope
- Runtime profile creation (Slice 6).
- Health repair flow (Slice 7).
- WSL fallback (native first per PRD).
- Version pinning or update logic.
- Desktop IPC for sidecar management (backend owns it all).
Recommended approach
- Extend
apps/server/src/provider/opencodeRuntime.ts (already has startOpenCodeServerProcess at lines 785-847).
- Add a managed profile mode that uses the downloaded binary from the managed runtime dir.
- Generate fresh password with
crypto.randomBytes() — memory-only, never persisted.
- Use Effect's
ChildProcess from effect/unstable/process with Windows shell mode (per ADR 0005).
- Health check via existing
openCodeRuntimeHealth.ts.
- Session dispatch via existing provider session infrastructure.
Blocked by
References
- PRD:
.brainstorm/windows-turnkey-release-prd.md (Decision 1, Decision 5, Decision 6)
- ADR 0005:
docs/adr/0005-backend-owned-managed-runtime-sidecar.md
- Existing:
apps/server/src/provider/opencodeRuntime.ts
... more issues
What to build
Extend
opencodeRuntime.tsto fully manage the OpenCode sidecar process in managed mode: start, stop, health check, ...This is the core runtime lifecycle slice. The codebase already has
startOpenCodeServerProcessusing `ChildProcessSp...How to verify
Out of scope
Recommended approach
apps/server/src/provider/opencodeRuntime.ts(already hasstartOpenCodeServerProcessat lines 785-847).crypto.randomBytes()— memory-only, never persisted.ChildProcessfromeffect/unstable/processwith Windows shell mode (per ADR 0005).openCodeRuntimeHealth.ts.Blocked by
References
.brainstorm/windows-turnkey-release-prd.md(Decision 1, Decision 5, Decision 6)docs/adr/0005-backend-owned-managed-runtime-sidecar.mdapps/server/src/provider/opencodeRuntime.ts... more issues