What happened?
This is to be a re-report of the bug from #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:
There was actually discussion on #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:
- Enter Plan Mode
- Research / determine a strategy
- Draft the plan without waiting for user feedback
- Call
exit_plan_mode
- 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
What happened?
This is to be a re-report of the bug from #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.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_modeand proceeding with implementation.Relevant history
There are a few related changes that might explain how we got here:
enter_plan_modeunavailable in YOLO mode.enter_plan_mode/exit_plan_modeare automatically allowed so headless workflows can plan and then implement autonomously.There was actually discussion on #24423 about non-interactive mode. It was suggested that this would not block because
ask_useris denied in non-interactive sessions, but the issue is that the blocking behavior does not requireask_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:
exit_plan_modeClient information
Login information
No response
Anything else we need to know?
No response