fix(coding-agent): emit session_shutdown in print mode closes #2576

This commit is contained in:
Mario Zechner
2026-03-24 23:50:47 +01:00
parent a949490f29
commit ebe437081e
4 changed files with 220 additions and 81 deletions

View File

@@ -882,7 +882,7 @@ export async function main(args: string[]) {
printTimings();
await interactiveMode.run();
} else {
await runPrintMode(session, {
const exitCode = await runPrintMode(session, {
mode,
messages: parsed.messages,
initialMessage,
@@ -890,6 +890,9 @@ export async function main(args: string[]) {
});
stopThemeWatcher();
restoreStdout();
if (exitCode !== 0) {
process.exitCode = exitCode;
}
return;
}
}