fix(sdk): handle Windows opencode spawn and shutdown (#20772)

This commit is contained in:
Luke Parker
2026-04-03 13:18:50 +10:00
committed by GitHub
parent e89527c9f0
commit 7b8dc8065e
8 changed files with 103 additions and 35 deletions

View File

@@ -144,7 +144,11 @@ export namespace Process {
throw new RunFailedError(cmd, out.code, out.stdout, out.stderr)
}
// Duplicated in `packages/sdk/js/src/process.ts` because the SDK cannot import
// `opencode` without creating a cycle. Keep both copies in sync.
export async function stop(proc: ChildProcess) {
if (proc.exitCode !== null || proc.signalCode !== null) return
if (process.platform !== "win32" || !proc.pid) {
proc.kill()
return