fix(shutdown): stop instances before app exit

Prevent desktop wrappers from SIGKILLing the CLI during shutdown, which could orphan OpenCode workspace processes. Shut down workspaces earlier/in parallel and increase the quit grace period.
This commit is contained in:
Shantur Rathore
2026-01-25 11:01:50 +00:00
parent 9ee7ff9509
commit c74e0b89f7
5 changed files with 59 additions and 34 deletions

View File

@@ -178,7 +178,7 @@ export class CliProcessManager extends EventEmitter {
return new Promise((resolve) => {
const killTimeout = setTimeout(() => {
child.kill("SIGKILL")
}, 4000)
}, 30000)
child.on("exit", () => {
clearTimeout(killTimeout)
@@ -376,4 +376,3 @@ export class CliProcessManager extends EventEmitter {
throw new Error("Unable to locate CodeNomad CLI build (dist/bin.js). Run npm run build --workspace @neuralnomads/codenomad.")
}
}