fix: YOLO mode still asking for plan approval in non-interactive mode#20212
Conversation
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 google-gemini#13561
Summary of ChangesHello @theshloksschauhan, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a critical bug where the YOLO (autonomous) mode in the CLI was still prompting for plan approval when used in non-interactive or headless environments. The changes ensure that the system behaves as expected in YOLO mode, eliminating unnecessary user intervention and streamlining automated workflows. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request addresses a bug where YOLO mode would still prompt for plan approval in non-interactive sessions. The changes in packages/core/src/prompts/promptProvider.ts modify the conditions for enabling the enter_plan_mode tool and for injecting the 'Autonomous Mode (YOLO)' system prompt. These changes ensure that autonomous behavior is correctly triggered in all YOLO mode scenarios. The implementation appears to correctly resolve the issue.
|
Thanks for the heads-up, @jerop! I'm based on commit 8e9ce3f (current main). I checked #19570 and it addresses the issue at the tool-registry level in Config.syncPlanModeTools. However, I found that in promptProvider.ts, the 'Autonomous Mode (YOLO)' system prompt section was still gated on interactiveMode, and enableEnterPlanModeTool was not guarded against YOLO mode specifically in the prompt context. I believe both fixes may be complementary — could you confirm if #19570 fully covers the non-interactive (--prompt / --output-format stream-json) headless scenario? |
| 'interactiveYoloMode', | ||
| () => true, | ||
| isYoloMode && interactiveMode, | ||
| isYoloMode, |
There was a problem hiding this comment.
this was very much intentional because it's used to define interactiveYoloMode
jerop
left a comment
There was a problem hiding this comment.
it should be covered, unless you're seeing something wrong on main branch
| enableEnterPlanModeTool: | ||
| enabledToolNames.has(ENTER_PLAN_MODE_TOOL_NAME) && !isYoloMode, |
There was a problem hiding this comment.
enter_plan_mode tool is not available in YOLO mode so this is redundant - #19570
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:
Fixes #13561
Summary
Details
Related Issues
How to Validate
Pre-Merge Checklist