Plan mode refuses to provide file edit instructions, leading to a deadlock. The agent thinks it is instructed to edit files, which is not the case. System instructions should help the AI understand this. #2906

Open
opened 2026-02-16 17:37:45 -05:00 by yindo · 4 comments
Owner

Originally created by @raymelon on GitHub (Nov 16, 2025).

Originally assigned to: @rekram1-node on GitHub.

Description

Plan mode refuses simple things like providing the user file edit instructions.

Once it happens, there is no way out of it. The agent is stubborn enough since it mistakenly thinks providing edit instructions is the same as editing the files. Switching to Build mode defeats the purpose as well, because it guarantees the agent doing the edits.

The instruction is to give file edit instructions, not edit the files. I just think the agent fails to distinguish that because of hard Plan and Build agent rules.

As for the workaround, unless the user reverts (undo or timeline) and hope that the agent cooperates the second time around, there is no way out of the situation within the bounds of the session.

Imo the system instructions should help the AI make a clear distinction between writing edit instructions vs doing the edits itself.

The Plan agent will not edit files anyway (because it's on Plan mode), so it should not prevent itself from instructing the user on how to execute specific file edits, in case the user wants to do edits themselves.

At the end of the day, if the agent refuses to provide file edit instructions, it's basically a dead end. That makes session unusable, unless inconvenient actions are attempted like reverting.

However, reverting alone that does not guarantee success. Relying on second, third, fourth attempt is not foolproof since the user is now at the mercy of the LLM responding slightly differently — with the hopes of the agent finally providing instructions, just like in the screenshot below:

Image

OpenCode version

1.0.67

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Originally created by @raymelon on GitHub (Nov 16, 2025). Originally assigned to: @rekram1-node on GitHub. ### Description Plan mode refuses simple things like providing the user file edit instructions. Once it happens, there is no way out of it. The agent is stubborn enough since it mistakenly thinks providing edit instructions is the same as editing the files. Switching to Build mode defeats the purpose as well, because it guarantees the agent doing the edits. The instruction is to give file edit instructions, not edit the files. I just think the agent fails to distinguish that because of hard Plan and Build agent rules. As for the workaround, unless the user reverts (undo or timeline) and hope that the agent cooperates the second time around, there is no way out of the situation within the bounds of the session. Imo the system instructions should help the AI make a clear distinction between writing edit instructions vs doing the edits itself. The Plan agent will not edit files anyway (because it's on Plan mode), so it should not prevent itself from instructing the user on how to execute specific file edits, in case the user wants to do edits themselves. At the end of the day, if the agent refuses to provide file edit instructions, it's basically a dead end. That makes session unusable, unless inconvenient actions are attempted like reverting. However, reverting alone that does not guarantee success. Relying on second, third, fourth attempt is not foolproof since the user is now at the mercy of the LLM responding slightly differently — with the hopes of the agent finally providing instructions, just like in the screenshot below: <img width="1068" height="255" alt="Image" src="https://github.com/user-attachments/assets/5c4b02f5-9988-4157-8162-3f5b0aa733aa" /> ### OpenCode version 1.0.67 ### Steps to reproduce _No response_ ### Screenshot and/or share link _No response_ ### Operating System _No response_ ### Terminal _No response_
yindo added the bug label 2026-02-16 17:37:45 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Nov 16, 2025):

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

  • #3991: Similar problem where Plan agent refuses file operations due to system instructions overriding permissions
  • #3858: Exact same scenario where user requests plan file creation, Plan mode refuses, and switching to Build mode causes unwanted edits
  • #3351: Related issue where Plan Agent refuses to show code snippets, indicating overly restrictive behavior

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

@github-actions[bot] commented on GitHub (Nov 16, 2025): This issue might be a duplicate of existing issues. Please check: - #3991: Similar problem where Plan agent refuses file operations due to system instructions overriding permissions - #3858: Exact same scenario where user requests plan file creation, Plan mode refuses, and switching to Build mode causes unwanted edits - #3351: Related issue where Plan Agent refuses to show code snippets, indicating overly restrictive behavior Feel free to ignore if none of these address your specific case.
Author
Owner

@raymelon commented on GitHub (Nov 16, 2025):

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

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

Yup, I reported it before. Right now I'm using Grok Code Fast 1, not Code Supernova.

@raymelon commented on GitHub (Nov 16, 2025): > This issue might be a duplicate of existing issues. Please check: > > * [Plan agent ignores permissions and always forbids file edits #3991](https://github.com/sst/opencode/issues/3991): Similar problem where Plan agent refuses file operations due to system instructions overriding permissions > * [[FEATURE]: EDIT PLAN mode or allow editing of only certain (.md) files in PLAN mode #3858](https://github.com/sst/opencode/issues/3858): Exact same scenario where user requests plan file creation, Plan mode refuses, and switching to Build mode causes unwanted edits > * [Plan Agent refuses to show code snippets #3351](https://github.com/sst/opencode/issues/3351): Related issue where Plan Agent refuses to show code snippets, indicating overly restrictive behavior > > Feel free to ignore if none of these address your specific case. Yup, I reported it before. Right now I'm using Grok Code Fast 1, not Code Supernova.
Author
Owner

@atkr commented on GitHub (Nov 16, 2025):

FWIW, I've encountered this same issue before. And I haven't realized it is not happening to me anymore as when I use the plan mode I also almost always use a custom command.

This is one I use after an initial prompt or 2 about what I'm trying to do: (file is ./command/plan-detailed)

---
description: create a detailed implementation plan based on the discussed requirements
subtask: false
---

Create a detailed plan covering all required implementation details.
This plan will later be used by an LLM / specialized AI model (like you) for implementation.

$ARGUMENTS

I've also created a custom primary agent / mode called "deep-plan" (😆), which has instructions to come up with the ideal solution by breaking down the problem in research tasks that can be delegated to subagents, the subagents are instructed to perform extensive research and use tools/mcp to obtain information from different sources, etc.

I definitely suggest experimenting with this, it makes grok-code-fast-1 significantly more useful.

@atkr commented on GitHub (Nov 16, 2025): FWIW, I've encountered this same issue before. And I haven't realized it is not happening to me anymore as when I use the plan mode I also almost always use a custom command. This is one I use after an initial prompt or 2 about what I'm trying to do: (file is ./command/plan-detailed) ``` --- description: create a detailed implementation plan based on the discussed requirements subtask: false --- Create a detailed plan covering all required implementation details. This plan will later be used by an LLM / specialized AI model (like you) for implementation. $ARGUMENTS ``` I've also created a custom primary agent / mode called "deep-plan" (😆), which has instructions to come up with the ideal solution by breaking down the problem in research tasks that can be delegated to subagents, the subagents are instructed to perform extensive research and use tools/mcp to obtain information from different sources, etc. I definitely suggest experimenting with this, it makes grok-code-fast-1 significantly more useful.
Author
Owner

@raymelon commented on GitHub (Nov 17, 2025):

FWIW, I've encountered this same issue before. And I haven't realized it is not happening to me anymore as when I use the plan mode I also almost always use a custom command.

This is one I use after an initial prompt or 2 about what I'm trying to do: (file is ./command/plan-detailed)

---
description: create a detailed implementation plan based on the discussed requirements
subtask: false
---

Create a detailed plan covering all required implementation details.
This plan will later be used by an LLM / specialized AI model (like you) for implementation.

$ARGUMENTS

I've also created a custom primary agent / mode called "deep-plan" (😆), which has instructions to come up with the ideal solution by breaking down the problem in research tasks that can be delegated to subagents, the subagents are instructed to perform extensive research and use tools/mcp to obtain information from different sources, etc.

I definitely suggest experimenting with this, it makes grok-code-fast-1 significantly more useful.

Cool, love it. Yes I agree it never happened in subagents, and I think it's more on me using subagents in build mode most of the time.

I will try your prompt. Thanks @atkr !

@raymelon commented on GitHub (Nov 17, 2025): > FWIW, I've encountered this same issue before. And I haven't realized it is not happening to me anymore as when I use the plan mode I also almost always use a custom command. > > This is one I use after an initial prompt or 2 about what I'm trying to do: (file is ./command/plan-detailed) > > ``` > --- > description: create a detailed implementation plan based on the discussed requirements > subtask: false > --- > > Create a detailed plan covering all required implementation details. > This plan will later be used by an LLM / specialized AI model (like you) for implementation. > > $ARGUMENTS > ``` > > I've also created a custom primary agent / mode called "deep-plan" (😆), which has instructions to come up with the ideal solution by breaking down the problem in research tasks that can be delegated to subagents, the subagents are instructed to perform extensive research and use tools/mcp to obtain information from different sources, etc. > > I definitely suggest experimenting with this, it makes grok-code-fast-1 significantly more useful. Cool, love it. Yes I agree it never happened in subagents, and I think it's more on me using subagents in build mode most of the time. I will try your prompt. Thanks @atkr !
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2906