From e0da4669876e3f2aec9709d363ce68da3b1ff8da Mon Sep 17 00:00:00 2001 From: Shawn Smith Date: Tue, 11 Nov 2025 19:20:17 -0800 Subject: [PATCH] Update extensions/cli/src/commands/chat.ts Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com> --- extensions/cli/src/commands/chat.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/cli/src/commands/chat.ts b/extensions/cli/src/commands/chat.ts index 762fe2781..82301610b 100644 --- a/extensions/cli/src/commands/chat.ts +++ b/extensions/cli/src/commands/chat.ts @@ -446,7 +446,7 @@ async function runHeadlessMode( ): Promise { // Critical validation: Ensure we have a prompt in headless mode // This prevents the CLI from hanging in TTY-less environments - if (!prompt) { + if (!prompt && !options.prompt?.length && !options.agent) { throw new Error( 'Headless mode requires a prompt. Use: cn -p "your prompt"\n' + 'Or pipe input: echo "prompt" | cn -p\n' +