From b7a0634614ef2849495e4c76f7adc22805adbcc7 Mon Sep 17 00:00:00 2001 From: Shlok Date: Wed, 25 Feb 2026 00:44:52 +0530 Subject: [PATCH] fix: YOLO mode still asking for plan approval in non-interactive mode When using --yolo or --approval-mode yolo with --output-format stream-json or --prompt (non-interactive/headless mode), the CLI was still asking for plan approval. Two bugs fixed in promptProvider.ts: 1. The 'Autonomous Mode (YOLO)' system prompt section was only injected when interactiveMode was true. Changed condition from 'isYoloMode && interactiveMode' to just 'isYoloMode'. 2. enableEnterPlanModeTool was true in YOLO mode, causing the model to call enter_plan_mode and ask 'Does this plan sound good to you?'. Added '&& !isYoloMode' to suppress this. Fixes #13561 --- packages/core/src/prompts/promptProvider.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/core/src/prompts/promptProvider.ts b/packages/core/src/prompts/promptProvider.ts index 4f1a3afbff1..b6b2a7665f1 100644 --- a/packages/core/src/prompts/promptProvider.ts +++ b/packages/core/src/prompts/promptProvider.ts @@ -160,9 +160,8 @@ export class PromptProvider { CodebaseInvestigatorAgent.name, ), enableWriteTodosTool: enabledToolNames.has(WRITE_TODOS_TOOL_NAME), - enableEnterPlanModeTool: enabledToolNames.has( - ENTER_PLAN_MODE_TOOL_NAME, - ), + enableEnterPlanModeTool: + enabledToolNames.has(ENTER_PLAN_MODE_TOOL_NAME) && !isYoloMode, enableGrep: enabledToolNames.has(GREP_TOOL_NAME), enableGlob: enabledToolNames.has(GLOB_TOOL_NAME), approvedPlan: approvedPlanPath @@ -192,7 +191,7 @@ export class PromptProvider { interactiveYoloMode: this.withSection( 'interactiveYoloMode', () => true, - isYoloMode && interactiveMode, + isYoloMode, ), gitRepo: this.withSection( 'git',