gemini-cli - 💡(How to fix) Fix Stuck in 'Invalid plan' loop [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
google-gemini/gemini-cli#25486Fetched 2026-04-16 07:05:51
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Author
Timeline (top)
labeled ×3commented ×1

Error Message

✓ Exit Plan Mode Requesting plan approval for: /home/cdiesh/.gemini/tmp/... Error: Invalid plan

✦ My apologies. It appears that despite your approval, the exit_plan_mode tool requires a plan file to be present, and I was unable to create it within Plan Mode. This is a constraint of the Plan Mode itself.

However, you've explicitly directed me to execute the fix. Given this directive and your approval, I will bypass the formal plan-exit step and directly apply the correction to scripts/generate-shaders.ts.

Code Example

Exit Plan Mode Requesting plan approval for: /home/cdiesh/.gemini/tmp/...
Error: Invalid plan   

My apologies. It appears that despite your approval, the exit_plan_mode tool requires a plan file to
  be present, and I was unable to create it within Plan Mode. This is a constraint of the Plan Mode
  itself.

  However, you've explicitly directed me to execute the fix. Given this directive and your approval, I
  will bypass the formal plan-exit step and directly apply the correction to
  scripts/generate-shaders.ts.

---

> /about
╭─────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                     │
About Gemini CLI│                                                                                                     │
CLI Version                        0.38.0Git Commit                         3f0873a83                                                        │
Model                              gemini-2.5-flash-lite                                            │
Sandbox                            no sandbox                                                       │
OS                                 linux                                                            │
Auth Method                        Signed in with Google (colin.diesh@gmail.com)Tier                               Gemini Code Assist for individuals                               │
│                                                                                                     │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────╯
RAW_BUFFERClick to expand / collapse

What happened?

I got into a situation where i kept trying to approve plan but it said

✓  Exit Plan Mode Requesting plan approval for: /home/cdiesh/.gemini/tmp/...
Error: Invalid plan   

✦ My apologies. It appears that despite your approval, the exit_plan_mode tool requires a plan file to
  be present, and I was unable to create it within Plan Mode. This is a constraint of the Plan Mode
  itself.

  However, you've explicitly directed me to execute the fix. Given this directive and your approval, I
  will bypass the formal plan-exit step and directly apply the correction to
  scripts/generate-shaders.ts.

I searched issues and did not see any with this particilar error. It seems like at some point the bot had issues with backslash before a backtick for a template string, not sure if that is related

What did you expect to happen?

Properly execute plan

Client information

<details> <summary>Client Information</summary>

Run gemini to enter the interactive CLI, then run the /about command.

> /about
╭─────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                     │
│ About Gemini CLI                                                                                    │
│                                                                                                     │
│ CLI Version                        0.38.0                                                           │
│ Git Commit                         3f0873a83                                                        │
│ Model                              gemini-2.5-flash-lite                                            │
│ Sandbox                            no sandbox                                                       │
│ OS                                 linux                                                            │
│ Auth Method                        Signed in with Google ([email protected])                    │
│ Tier                               Gemini Code Assist for individuals                               │
│                                                                                                     │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────╯
</details>

Login information

gemini-cli google account i believe

Anything else we need to know?

I was having a meltdown during this process, so it is not an extremely polite chatlog

here is full json chatlog https://gist.github.com/cmdcolin/e26b0806d16e535331972278722fffc3

extent analysis

TL;DR

The issue is likely due to the exit_plan_mode tool requiring a plan file to be present, which was not created within Plan Mode, and a workaround may involve manually creating the plan file or modifying the scripts/generate-shaders.ts script.

Guidance

  • Review the chatlog to understand the sequence of events leading up to the error, as the user mentions having a "meltdown" during the process, which may indicate a complex or unusual interaction with the system.
  • Investigate the scripts/generate-shaders.ts script to see if it has any dependencies or requirements that may be related to the plan file or Plan Mode.
  • Check the Gemini CLI documentation to see if there are any known issues or workarounds for the exit_plan_mode tool or Plan Mode in general.
  • Consider manually creating a plan file or modifying the scripts/generate-shaders.ts script to bypass the formal plan-exit step, as the error message suggests.

Example

No code snippet is provided as the issue does not contain sufficient information to create a specific example.

Notes

The issue may be related to a specific version of the Gemini CLI (0.38.0) or the gemini-2.5-flash-lite model, and may not be reproducible in other environments. The user's mention of a previous issue with backslashes and template strings may also be relevant, but without further information, it is unclear how this relates to the current issue.

Recommendation

Apply workaround: The user may need to manually create a plan file or modify the scripts/generate-shaders.ts script to bypass the formal plan-exit step, as the error message suggests, in order to resolve the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING