Commit Graph

7 Commits

Author SHA1 Message Date
Kit Langton 75c507f769 refactor(test/cli): migrate serve/acp builders to AppProcess.spawn
Slice 2 of the CLI harness Effect migration. Drops the last raw
Bun.spawn call sites in withCliFixture.

- `serve` and `acp` both move from `Effect.acquireRelease(Bun.spawn(...))`
  to `appProc.spawn(ChildProcess.make(...))`. The spawner's built-in
  acquireRelease finalizer handles SIGTERM on scope close — no manual
  wiring needed.

- `handle.stdout` / `handle.stderr` are already Effect Streams, so the
  `fromBunStream` helper is gone (Stream.fromReadableStream + the
  per-pipe error-tag boilerplate it wrapped).

- acp's stdin moves from imperative `proc.stdin.write` + `proc.stdin.end`
  to a Queue<Uint8Array> fed into the spawner's stdin Sink via
  Stream.fromQueue. `send` is `Queue.offer`, `close` is `Queue.shutdown` —
  shutdown propagates as stdin EOF, which is ACP's graceful-exit signal.

- ServeHandle/AcpHandle public shape: `kill`/`close` become
  Effect<void> and `exited` becomes Effect<number> (was () => void and
  Promise<number>). The platform error that cross-spawn-spawner raises
  on signal-kill is collapsed to exit code -1 so `exited` stays a clean
  Effect<number> — matches the test contract (just needs proof of exit).

Two consuming tests updated to yield the Effect instead of awaiting
the Promise.
2026-05-19 16:19:04 -04:00
Kit Langton 80e5fb11c2 refactor(test/cli): migrate harness short-lived path to AppProcess + FileSystem (#28366) 2026-05-19 16:18:19 -04:00
Kit Langton 18b9cec50d test(cli): help-text snapshots for every CLI command (#28267) 2026-05-19 10:58:12 -04:00
Kit Langton cb15b3ad84 test(cli): subprocess integration tests for opencode acp (#28265) 2026-05-19 08:18:22 -04:00
opencode-agent[bot] 6f160bb48f chore: generate 2026-05-19 00:57:09 +00:00
Kit Langton ebb672ac39 test(cli): subprocess integration tests for opencode serve (#28263) 2026-05-19 00:55:58 +00:00
Kit Langton 7b8a1037a0 refactor(test/lib): generalize run-process harness into cli-process (#28253) 2026-05-18 19:16:10 -04:00