diff --git a/packages/coding-agent/CHANGELOG.md b/packages/coding-agent/CHANGELOG.md index dfcf6226..11cb9900 100644 --- a/packages/coding-agent/CHANGELOG.md +++ b/packages/coding-agent/CHANGELOG.md @@ -4,6 +4,7 @@ ### Fixed +- Fixed successful `pi update` on Windows to exit naturally instead of calling `process.exit(0)`, avoiding a Node.js/libuv assertion after version-check network requests ([#5805](https://github.com/earendil-works/pi/issues/5805)). - Fixed inherited Google and `google-vertex` Gemini model metadata to map `latest` aliases to the current models, add Gemini 3.5 Flash for Vertex, correct Gemini 2.5 Flash Vertex cache pricing, and remove shut-down Vertex preview models ([#5761](https://github.com/earendil-works/pi/issues/5761)). - Fixed the session selector to stay open and show the all-sessions empty state when both current-folder and all-scope session lists are empty ([#5747](https://github.com/earendil-works/pi/issues/5747)). - Fixed inherited Moonshot AI China model metadata to include Kimi K2.7 Code, and omitted unsupported thinking-off payloads for Kimi K2.7 Code models ([#5760](https://github.com/earendil-works/pi/issues/5760)). diff --git a/packages/coding-agent/src/main.ts b/packages/coding-agent/src/main.ts index 00f3b208..42ce1ce5 100644 --- a/packages/coding-agent/src/main.ts +++ b/packages/coding-agent/src/main.ts @@ -467,7 +467,15 @@ export async function main(args: string[], options?: MainOptions) { } if (await handlePackageCommand(args, { extensionFactories: options?.extensionFactories })) { - process.exit(process.exitCode ?? 0); + const exitCode = process.exitCode ?? 0; + if (process.platform === "win32" && exitCode === 0 && args[0] === "update") { + // We normally prefer process.exit(0) for package commands so bad extensions cannot keep + // one-shot commands alive. On Windows, Node can assert after fetch() if process.exit(0) + // runs during teardown; let successful `pi update` drain naturally instead. + // https://github.com/nodejs/node/issues/56645 + return; + } + process.exit(exitCode); return; }