google-gemini / google-gemini/gemini-cli
Plan Mode still halts YOLO / non-interactive runs while waiting for user agreement
- Dominant language
- TypeScript
- Stars
- 107k
- Forks
- 14.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 45
Description
### What happened?
This is to be a re-report of the bug from https://github.com/google-gemini/gemini-cli/issues/26004, which was closed as stale without a resolution.
In non-interactive execution (for example `gemini -p "..." -y`), the agent can enter Plan Mode, but the Plan Mode prompt instructs it to stop and wait for informal user agreement before drafting/exiting the plan.
> "You MUST NOT proceed to Step 3 (Draft) or Step 4 (Review & Approval) in the same turn as your initial strategy proposal. You MUST wait for user feedback..."
Because there is no user turn in non-interactive mode, the model can emit a text-only response asking for confirmation and terminate the run instead of calling `exit_plan_mode` and proceeding with implementation.
### Relevant history
There are a few related changes that might explain how we got here:
- https://github.com/google-gemini/gemini-cli/pull/19570 made `enter_plan_mode` unavailable in YOLO mode.
- https://github.com/google-gemini/gemini-cli/pull/22670 intentionally enabled Plan Mode transitions in non-interactive sessions. In this mode, `enter_plan_mode` / `exit_plan_mode` are automatically allowed so headless workflows can plan and then implement autonomously.
- https://github.com/google-gemini/gemini-cli/pull/24423 later added an informal-agreement step to the Plan Mode prompt, including instructions to "STOP and wait" and "MUST wait for user feedback" before drafting/exiting.
There was actually discussion on [#24423 ](https://github.com/google-gemini/gemini-cli/pull/24423)about non-interactive mode. It was suggested that this would not block because `ask_user` is denied in non-interactive sessions, but the issue is that the blocking behavior does not require `ask_user` - a normal text response with no tool call is sufficient to terminate a non-interactive run.
### What did you expect to happen?
In non-interactive mode, Plan Mode should remain autonomous:
1. Enter Plan Mode
2. Research / determine a strategy
3. Draft the plan without waiting for user feedback
4. Call `exit_plan_mode`
5. Continue with implementation
### Client information
```
CLI Version 0.55.1
Model gemini-3.5-flash (thinkingLevel: HIGH)
OS linux
Auth Method gemini-api-key
```
### Login information
_No response_
### Anything else we need to know?
_No response_
Contributor guide
Research direction
Start by tracing non-interactive execution and the Plan Mode transitions, especially the enter_plan_mode and exit_plan_mode behavior described in the issue. Reproduce the flow with `gemini -p "..." -y` and inspect the prompt handling that causes a text-only response. Done means non-interactive runs autonomously draft the plan, call exit_plan_mode, and continue implementation without waiting for user feedback.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- ai, cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100