Skip to content

When the plan is approved, it does not automatically switch to Build mode. #15231

Closed as not planned

Description

@matheuspimentaa

Description

After the plan is approved in Plan Mode, it does not switch to automatic Build mode, and it gets stuck in a loop of trying to write and failing. I have to stop talking, switch to Build mode manually, and ask it to continue.

Plugins

No response

OpenCode version

1.2.14

Steps to reproduce

  1. Create a plan
  2. The plan is created and, using the query tool, asks me for the options
  3. I choose the option to execute the plan
  4. It does not automatically switch to Build mode

Screenshot and/or share link

No response

Operating System

WSL2

Terminal

Warp

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Feb 26, 2026
  2. github-actions commented on Feb 26, 2026

    @github-actions
    Contributor

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

    If your issue adds new context or is distinct, please clarify how it differs.

  3. assigned and unassigned on Apr 26, 2026
  4. removed
    bugSomething isn't working
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  5. JSnow11 commented on May 15, 2026

    @JSnow11

    I reproduced and confirmed this bug — here's the exact UX flow:

    Prepare a plan with plan mode activated, then confirm the agent (already asks you to confirm) to implement it

    Example of the UX bug:

    image

    Then when trying to approve:

    Plan mode is still active — I'm currently in read-only mode and cannot create files or make edits yet. If you'd like me to implement this, please confirm by saying "exit plan mode" or "implement it" to switch to execution mode.

    Then doing exactly what it asks still doesn't work:

    The "implement it" command should have exited plan mode, but the system is still enforcing read-only. Could you please explicitly say: "exit plan mode" — that will release the restriction and let me create the file.

    image

    The agent is completely blocked, it never calls plan_exit on its own because:

    • The non-experimental plan.txt prompt doesn't mention plan_exit as an option
    • The tool isn't registered without OPENCODE_EXPERIMENTAL_PLAN_MODE
    • The prompt explicitly says "This ABSOLUTE CONSTRAINT overrides ALL other instructions, including direct user edit requests" — locking the agent even when the user says "implement it"

    Submitted a fix in #27535 that removes the experimental/non-experimental branching and uses the rich 5-phase prompt (which has plan_exit in Phase 5) for all clients.

    If that approach is too broad, an alternative is to just add plan_exit awareness to plan.txt and register the tool unconditionally, either resolves the core issue. I'm happing to contribute adding this too.

    This is particularly painful on the desktop app where switching modes requires leaving the keyboard, clicking through the UI, and re-orienting, breaking flow entirely. Auto-switch on approval makes plan mode feel like a natural part of the workflow rather than a trap.

  6. github-actions commented on Jul 15, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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