opencode in plan mode inside cursor is making edits to the codebase #1495

Closed
opened 2026-02-16 17:31:15 -05:00 by yindo · 17 comments
Owner

Originally created by @luisrudge on GitHub (Aug 26, 2025).

Originally assigned to: @thdxr on GitHub.

Image
Originally created by @luisrudge on GitHub (Aug 26, 2025). Originally assigned to: @thdxr on GitHub. <img width="620" height="318" alt="Image" src="https://github.com/user-attachments/assets/c81f65ae-016e-4509-8355-ed9a43cdcda6" />
yindo closed this issue 2026-02-16 17:31:15 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Aug 26, 2025):

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

  • #1682: BUG: dumps system prompt in an infinite loop for absolutely no reason.

The issue #1682 describes a similar problem where plan mode system prompts are being dumped/repeated infinitely, which could manifest as the agent making unwanted edits instead of staying in plan mode as expected.

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

@github-actions[bot] commented on GitHub (Aug 26, 2025): This issue might be a duplicate of existing issues. Please check: - #1682: BUG: dumps system prompt in an infinite loop for absolutely no reason. The issue #1682 describes a similar problem where plan mode system prompts are being dumped/repeated infinitely, which could manifest as the agent making unwanted edits instead of staying in plan mode as expected. Feel free to ignore if none of these address your specific case.
Author
Owner

@smazurov commented on GitHub (Aug 26, 2025):

yup, same here, not related to vscode integration (happens in terminal as well).

@smazurov commented on GitHub (Aug 26, 2025): yup, same here, not related to vscode integration (happens in terminal as well).
Author
Owner

@luisrudge commented on GitHub (Sep 7, 2025):

yeah this is pretty consistent now.. most things that I ask in plan mode are being edited right away.

@luisrudge commented on GitHub (Sep 7, 2025): yeah this is pretty consistent now.. most things that I ask in plan mode are being edited right away.
Author
Owner

@rekram1-node commented on GitHub (Sep 7, 2025):

thx for raising I will look into it

@rekram1-node commented on GitHub (Sep 7, 2025): thx for raising I will look into it
Author
Owner

@Sewer56 commented on GitHub (Sep 7, 2025):

I find that if thinking is disabled on the Anthropic models, then plan mode will often write to the files. With thinking, not so much.

Unfortunately, thinking mode is disabled by default, and it's not really clear for a user how to enable it, because the only documented way to do so is in a model configuration example in the docs.

@Sewer56 commented on GitHub (Sep 7, 2025): I find that if thinking is disabled on the Anthropic models, then plan mode will often write to the files. With thinking, not so much. Unfortunately, thinking mode is disabled by default, and it's not really clear for a user how to enable it, because the only documented way to do so is in a model configuration example in the docs.
Author
Owner

@pmatos commented on GitHub (Sep 8, 2025):

I just noticed that Qwen3 code + planning mode also just starts editing the source code instead of formulating a plan.

@pmatos commented on GitHub (Sep 8, 2025): I just noticed that Qwen3 code + planning mode also just starts editing the source code instead of formulating a plan.
Author
Owner

@rekram1-node commented on GitHub (Sep 8, 2025):

when yall are saying it tries to edit, you are referring to how it prompts you with edits even tho it is in plan mode, correct?

Permission is required from user to actually make edits

@rekram1-node commented on GitHub (Sep 8, 2025): when yall are saying it tries to edit, you are referring to how it prompts you with edits even tho it is in plan mode, correct? Permission is required from user to actually make edits
Author
Owner

@luisrudge commented on GitHub (Sep 8, 2025):

OC doesn't ask me anything.. I'm sure I already said 'always allow' or something in the past since I don't care about these permissions

@luisrudge commented on GitHub (Sep 8, 2025): OC doesn't ask me anything.. I'm sure I already said 'always allow' or something in the past since I don't care about these permissions
Author
Owner

@rekram1-node commented on GitHub (Sep 8, 2025):

@luisrudge what version are you on, that is unexpected behavior in plan mode (unless you always allowed it):

opencode --version
0.6.6
@rekram1-node commented on GitHub (Sep 8, 2025): @luisrudge what version are you on, that is unexpected behavior in plan mode (unless you always allowed it): ``` opencode --version 0.6.6 ```
Author
Owner

@luisrudge commented on GitHub (Sep 8, 2025):

0.6.5

@luisrudge commented on GitHub (Sep 8, 2025): 0.6.5
Author
Owner

@Sewer56 commented on GitHub (Sep 8, 2025):

What I experienced at least myself was that the (non-thinking) model would try to make an edit, and that edit would just... happen. No prompt asking the user, nothing. Autopilot.

On a fresh config, without any sort of permission overrides for slash commands or agents whatsoever.

On 0.6.4, when I made the comment above.

@Sewer56 commented on GitHub (Sep 8, 2025): What I experienced at least myself was that the (non-thinking) model would try to make an edit, and that edit would just... happen. No prompt asking the user, nothing. Autopilot. On a fresh config, without any sort of permission overrides for slash commands or agents whatsoever. On 0.6.4, when I made the comment above.
Author
Owner

@rekram1-node commented on GitHub (Sep 8, 2025):

should be fixed in next release: https://github.com/sst/opencode/pull/2505

@rekram1-node commented on GitHub (Sep 8, 2025): should be fixed in next release: https://github.com/sst/opencode/pull/2505
Author
Owner

@rekram1-node commented on GitHub (Sep 14, 2025):

closing for now lmk if anyone has more issues w/ plan mode

@rekram1-node commented on GitHub (Sep 14, 2025): closing for now lmk if anyone has more issues w/ plan mode
Author
Owner

@juanmpga commented on GitHub (Nov 30, 2025):

I've just had the same issue on the terminal, with Claude Opus 4.5. At some point I've probably answer some permission requirements with the "accept always" option in case that has anything to do (but I'd expect Plan mode not to intend any edits in the first place, regardless of permissions).

Btw, superhappy with the tool in general, what an amazing piece of work you've done!!

@juanmpga commented on GitHub (Nov 30, 2025): I've just had the same issue on the terminal, with Claude Opus 4.5. At some point I've probably answer some permission requirements with the "accept always" option in case that has anything to do (but I'd expect Plan mode not to intend any edits in the first place, regardless of permissions). Btw, superhappy with the tool in general, what an amazing piece of work you've done!!
Author
Owner

@Sewer56 commented on GitHub (Nov 30, 2025):

This tends to happen with certain models and is model specific.
Qwen 3 Coder, Gemini 3, Opus 4.5 are ones I've seen it in.

They'll just use commands like cat to overwrite the files in plan mode.

@Sewer56 commented on GitHub (Nov 30, 2025): This tends to happen with certain models and is model specific. Qwen 3 Coder, Gemini 3, Opus 4.5 are ones I've seen it in. They'll just use commands like `cat` to overwrite the files in plan mode.
Author
Owner

@juanmpga commented on GitHub (Dec 9, 2025):

Thanks for the info. As a quick update, over the last days I haven't had any unexpected edits on Plan mode, so it may be fixed now (at least for Opus 4.5).

@juanmpga commented on GitHub (Dec 9, 2025): Thanks for the info. As a quick update, over the last days I haven't had any unexpected edits on Plan mode, so it may be fixed now (at least for Opus 4.5).
Author
Owner

@alexfedosov commented on GitHub (Jan 13, 2026):

Still happens pretty consistently with Gemini 3 Pro and opencode 1.0.167

@alexfedosov commented on GitHub (Jan 13, 2026): Still happens pretty consistently with Gemini 3 Pro and opencode 1.0.167
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1495