Plan mode is editing my files (gemini 3 pro) #4409

Open
opened 2026-02-16 17:43:42 -05:00 by yindo · 1 comment
Owner

Originally created by @mintchaos on GitHub (Jan 8, 2026).

Originally assigned to: @thdxr on GitHub.

Description

Twice now when working on a plan I've provided plan feedback and instead of updating the plan it's gone ahead and made the changes.

I think both times were with gemini 3 pro. (which I've been working with with because gemini are the blessed models at the day job).

A share link of this happening to me is attached, along with a screenshot.

You can see that my second prompt resulted in a pretty good plan. My third prompt was plan refinement, but it went ahead and started making changes with sed and rm

I haven't altered any agent settings. The only thing in my opencode.jsonc is a local nixos mcp server.

It looks like there are attempts to prevent this.
https://github.com/anomalyco/opencode/blob/d5f0e3fcccdf71aea9e7fd76874685bf36ab025c/packages/opencode/src/tool/bash.txt#L29

https://github.com/anomalyco/opencode/blob/d5f0e3fcccdf71aea9e7fd76874685bf36ab025c/packages/opencode/src/agent/agent.ts#L87

https://github.com/anomalyco/opencode/blob/d5f0e3fcccdf71aea9e7fd76874685bf36ab025c/packages/opencode/src/session/prompt/plan.txt#L4-L6

But it's obviously not working. I wonder if there should be more granular permissions around the bash tool? maybe enforcing more granular permissions? I would feel better if bash was more locked down.

Plugins

none

OpenCode version

1

Steps to reproduce

  1. use gemini 3 pro
  2. use native plan agent
  3. ask it to make a plan
  4. ask for a change
  5. plan agent makes the changes 😱

Screenshot and/or share link

Session share: https://opncd.ai/share/mvxL26AW

Here's a screenshot of the session showing it in on the plan agent.

Image

Operating System

nixos (linux kernel v 6.18.3)

Terminal

terminal inside zed editor, I think the other time this happened was in ghostty on mac os.

Originally created by @mintchaos on GitHub (Jan 8, 2026). Originally assigned to: @thdxr on GitHub. ### Description Twice now when working on a plan I've provided plan feedback and instead of updating the plan it's gone ahead and made the changes. I think both times were with gemini 3 pro. (which I've been working with with because gemini are the blessed models at the day job). A share link of this happening to me is attached, along with a screenshot. You can see that my second prompt resulted in a pretty good plan. My third prompt was plan refinement, but it went ahead and started making changes with `sed` and `rm` I haven't altered any agent settings. The only thing in my opencode.jsonc is a local nixos mcp server. It looks like there are attempts to prevent this. https://github.com/anomalyco/opencode/blob/d5f0e3fcccdf71aea9e7fd76874685bf36ab025c/packages/opencode/src/tool/bash.txt#L29 https://github.com/anomalyco/opencode/blob/d5f0e3fcccdf71aea9e7fd76874685bf36ab025c/packages/opencode/src/agent/agent.ts#L87 https://github.com/anomalyco/opencode/blob/d5f0e3fcccdf71aea9e7fd76874685bf36ab025c/packages/opencode/src/session/prompt/plan.txt#L4-L6 But it's obviously not working. I wonder if there should be more granular permissions around the bash tool? maybe enforcing more granular permissions? I would feel better if bash was more locked down. ### Plugins none ### OpenCode version 1 ### Steps to reproduce 1. use gemini 3 pro 2. use native plan agent 3. ask it to make a plan 4. ask for a change 5. plan agent makes the changes 😱 ### Screenshot and/or share link Session share: https://opncd.ai/share/mvxL26AW Here's a screenshot of the session showing it in on the plan agent. <img width="755" height="1056" alt="Image" src="https://github.com/user-attachments/assets/5d2d0d25-6261-41b1-aafb-a64b48133ebd" /> ### Operating System nixos (linux kernel v 6.18.3) ### Terminal terminal inside zed editor, I think the other time this happened was in ghostty on mac os.
yindo added the bugzen labels 2026-02-16 17:43:42 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 8, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #5475: Files were modified even being under 'Plan Mode' - Plan mode executing changes unexpectedly
  • #4627: Planning Mode instructions may be too strict - Model gets stuck in loops due to strict plan mode constraints
  • #4478: Gemini 3 never follows instructions in plan mode and always requests to modify code - Specific issue with Gemini 3 Pro in plan mode
  • #4391: Plan mode refuses to provide file edit instructions, leading to a deadlock - Agent blocked from providing guidance
  • #6636: Subagent with specific model results in model change in build and plan mode - Related model/agent behavior issue

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 8, 2026): This issue might be a duplicate of existing issues. Please check: - #5475: Files were modified even being under 'Plan Mode' - Plan mode executing changes unexpectedly - #4627: Planning Mode instructions may be too strict - Model gets stuck in loops due to strict plan mode constraints - #4478: Gemini 3 never follows instructions in plan mode and always requests to modify code - Specific issue with Gemini 3 Pro in plan mode - #4391: Plan mode refuses to provide file edit instructions, leading to a deadlock - Agent blocked from providing guidance - #6636: Subagent with specific model results in model change in build and plan mode - Related model/agent behavior issue Feel free to ignore if none of these address your specific case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4409