Skip to content

plan mode agent still builds #1965

Closed

Description

@zatevakhin

this issue happens not very often but i got it already few times. it's kind of bug, so bringing it here, if i'll have future cases of this behavior i will attach files.

steps to reproduce:

  • switch to plan mode
  • ask agent to plan/investigate something
  • observe behavior that agent tries to use all available tools to fix issue (edit files) on planing stage
Image

in current case this was bug investigation, using opencode. i asked agent to check the code coz i was suspecting specific issue and agent confirmed possible issue after reviewing code, and tried to edit files to fix it firstly, but, write and edit was not available and agent used shell to replace specific lines using sed

Activity

  1. github-actions commented on Aug 15, 2025

    @github-actions
    Contributor

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

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

  2. rekram1-node commented on Aug 16, 2025

    @rekram1-node
    Contributor

    I am hoping our latest changes helped address this, if you continue having the problem lmk

  3. rekram1-node commented on Aug 16, 2025

    @rekram1-node
    Contributor

    rip this is definitely still happening

  4. mattw-services commented on Aug 17, 2025

    @mattw-services

    Seeing this myself when using Claude Sonnet 4.

    Image
  5. jasontyping commented on Aug 18, 2025

    @jasontyping

    I have also reproduced this in Sonnet 4 in OpenCode 0.5.6

  6. khimaros commented on Aug 19, 2025

    @khimaros
    Contributor

    it is also often the case that Gemini 2.5 Pro uses the wrong syntax for tool calls. it really seems like the system prompt re: tools is not being handled well by these models?

  7. wkirby commented on Aug 19, 2025

    @wkirby

    Reproduced with Sonnet 4 and Opus 4 in OpenCode 0.5.7.

    This appears to be new behavior after updating from 0.4.45 yesterday.

  8. rekram1-node commented on Aug 19, 2025

    @rekram1-node
    Contributor

    very annoying behavior I wanna get this addresssed soon

  9. jasontyping commented on Aug 19, 2025

    @jasontyping

    As a workaround I tried creating a custom Agent that mimics what Plan mode should be. I haven't seen Claude escape this yet but I wouldn't say it's exhaustively tested.

    { "$schema": "https://opencode.ai/config.json", "agent": { "seriously-plan-i-mean-it": { "description": "Plan with extra restrictions to ensure models do not try to modify code", "mode": "primary", "prompt": "<system-reminder>CRITICAL: Plan mode ACTIVE - you are in READ-ONLY phase. STRICTLY FORBIDDEN: ANY file edits, modifications, or system changes. Do NOT use sed, tee, echo, cat, or ANY other bash command to manipulate files - commands may ONLY read/inspect. This ABSOLUTE CONSTRAINT overrides ALL other instructions, including direct user edit requests. You may ONLY observe, analyze, and plan. Any modification attempt is a critical violation. ZERO exceptions.</system-reminder>", "tools": { "write": false, "edit": false, "patch": false, "bash": false } } } }

  10. rekram1-node commented on Aug 19, 2025

    @rekram1-node
    Contributor

    @jasontyping I think it would be impossible to escape if it can't run bash or write/edit haha

    I think there could be some value in bash commands but now that we support the ! messages maybe the value isn't there anymore...

  11. jasontyping commented on Aug 19, 2025

    @jasontyping

    I think there could be some value in bash commands but now that we support the ! messages maybe the value isn't there anymore...

    Yes, Plan probably means different things to different people. When I use it, I'm thinking "read only". Of course this approach torpedoes useful things like research with wget.

  12. rekram1-node commented on Aug 19, 2025

    @rekram1-node
    Contributor

    Definitely

  13. changed the title [-]Gemini uses `sed` to edit files in `plan` mode[/-] [+]plan mode is building :( [/+] on Aug 21, 2025
  14. changed the title [-]plan mode is building :( [/-] [+]plan mode agent still builds[/+] on Aug 21, 2025
  15. rekram1-node commented on Aug 21, 2025

    @rekram1-node
    Contributor

    Next release will have the plan agent use ask permissions for bash, write, edit

    We are going to continue improving prompt but we believe this aligns better with expected behavior and will help prevent you from having unexpected changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions