fix: avoid simulation hook in mini mode

This commit is contained in:
James Long 2026-07-01 14:11:14 -04:00
commit 6281f17124
2 changed files with 3 additions and 14 deletions

View file

@ -12,14 +12,14 @@ This phase proves the core shape without swapping every foundational layer yet.
Implementation checklist:
- [x] Add `OPENCODE_SIMULATION=1` activation in TUI startup.
- [ ] Add `OPENCODE_SIMULATION=1` activation in V1/full-TUI startup.
- [x] Add simulation trace service with in-memory append-only records.
- [x] Add OpenTUI UI state extraction for screen, focus, elements, and generated actions.
- [x] Add OpenTUI UI action execution for typing, keys, enter, arrows, focus, and click.
- [x] Add TUI-owned JSON-RPC WebSocket server on `127.0.0.1:40900+`.
- [x] Add reusable JSON-RPC WebSocket server on `127.0.0.1:40900+`.
- [x] Expose `ui.state`, `ui.action`, `ui.render`.
- [x] Expose `trace.list`, `trace.clear`, `trace.export`.
- [x] Ensure fake and visible renderer paths share the same action protocol.
- [ ] Wire fake and visible V1/full-TUI renderer paths through the same action protocol.
- [ ] Verify a local driver can inspect state and execute a real TUI input.
Scope:

View file

@ -229,8 +229,6 @@ export async function createRuntimeLifecycle(input: LifecycleInput): Promise<Lif
const { RunFooter } = await footerTask
let closed = false
let sigintRegistered = false
let simulation: { readonly url: string; readonly stop: () => void } | undefined
const footer = new RunFooter(renderer, {
directory: input.directory,
findFiles: input.findFiles,
@ -281,13 +279,6 @@ export async function createRuntimeLifecycle(input: LifecycleInput): Promise<Lif
onSubagentInterrupt: input.onSubagentInterrupt,
})
if (process.env.OPENCODE_SIMULATION === "1" || process.env.OPENCODE_SIMULATION === "true") {
const { SimulationActions } = await import("@/testing/simulation/actions")
const { SimulationServer } = await import("@/testing/simulation/server")
simulation = SimulationServer.start(SimulationActions.createHarness(renderer))
if (simulation) process.stderr.write(`opencode simulation websocket: ${simulation.url}\n`)
}
const sigint = () => {
footer.requestExit()
}
@ -348,8 +339,6 @@ export async function createRuntimeLifecycle(input: LifecycleInput): Promise<Lif
await renderer.idle().catch(() => {})
}
} finally {
simulation?.stop()
simulation = undefined
footer.close()
await footer.idle().catch(() => {})
footer.destroy()