From 5aa4537ac35e86e2177c0a9e29c83357c0174a02 Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Thu, 16 Oct 2025 08:51:55 +0530 Subject: [PATCH] fix(cli): exit after printing response when using -p --- extensions/cli/src/commands/chat.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/extensions/cli/src/commands/chat.ts b/extensions/cli/src/commands/chat.ts index c2401283d..216595799 100644 --- a/extensions/cli/src/commands/chat.ts +++ b/extensions/cli/src/commands/chat.ts @@ -521,6 +521,9 @@ async function runHeadlessMode( compactionIndex = result.compactionIndex; } } + + // exit after headless mode completes + await gracefulExit(0); } export async function chat(prompt?: string, options: ChatOptions = {}) {