diff options
| author | Aiden Cline <[email protected]> | 2026-01-01 13:05:08 -0600 |
|---|---|---|
| committer | Aiden Cline <[email protected]> | 2026-01-01 13:05:08 -0600 |
| commit | 5138f9250e685780e63cb3b178fc2654557655a5 (patch) | |
| tree | 55b3668979c6b8148110666c63dfb3cfcf353a6f | |
| parent | e50365425246ea94cebfaefaf2d65c49ddb2b9ff (diff) | |
| download | opencode-5138f9250e685780e63cb3b178fc2654557655a5.tar.gz opencode-5138f9250e685780e63cb3b178fc2654557655a5.zip | |
ignore: keep the process exit logic
| -rw-r--r-- | packages/opencode/src/index.ts | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/packages/opencode/src/index.ts b/packages/opencode/src/index.ts index 0ccc4e94a..03ccf7604 100644 --- a/packages/opencode/src/index.ts +++ b/packages/opencode/src/index.ts @@ -28,8 +28,6 @@ import { WebCommand } from "./cli/cmd/web" import { PrCommand } from "./cli/cmd/pr" import { SessionCommand } from "./cli/cmd/session" -const cancel = new AbortController() - process.on("unhandledRejection", (e) => { Log.Default.error("rejection", { e: e instanceof Error ? e.message : e, @@ -152,6 +150,10 @@ try { console.error(e) } process.exitCode = 1 +} finally { + // Some subprocesses don't react properly to SIGTERM and similar signals. + // Most notably, some docker-container-based MCP servers don't handle such signals unless + // run using `docker run --init`. + // Explicitly exit to avoid any hanging subprocesses. + process.exit() } - -cancel.abort() |
