Skip to content

Mode switch Plan -> Code still behaves like Plan #10185

Closed as not planned
Closed as not planned

Description

@0xdeafbeef

What version of Codex is running?

codex-cli 0.92.0

What subscription do you have?

pro

Which model were you using?

No response

What platform is your computer?

Linux 6.18.0-364.vanilla.fc43.x86_64 x86_64 unknown

What terminal emulator and version are you using (if applicable)?

No response

What issue are you seeing?

  1. Start a session in Code mode.
  2. Switch to Plan mode (shift‑tab).
  3. Switch back to Code mode.
  4. Ask for an execution command (e.g., “go”).
    Observed: agent claims it’s still in Plan mode and refuses execution.
    Workaround: shift‑tab to Plan and back fixes it.
• Execution is blocked in Plan Mode despite user saying go; must respond with a status update that
  execution can't proceed until mode switches, without asking questions directly.

  Preparing user confirmation prompt

  Planning to request user confirmation to proceed with execution once mode switches, asking
  explicitly to confirm running commands now.

• I’m still in Plan Mode, which forbids executing commands. Please switch me back to code mode

What steps can reproduce the bug?

  • Plan mode instruction injected at 2026‑01‑29T18:04:55.152Z (developer message
    <collaboration_mode>).
  • Turn context later switches to Code mode at 2026‑01‑29T18:53:37.015Z (collaboration_mode:
    { mode: "code" }).
  • Despite that, at 2026‑01‑29T20:09:32.854Z the agent reasons “Execution is blocked in Plan Mode
    …” and emits a request_user_input tool call and message stating it is still in Plan Mode.

What is the expected behavior?

Shift tab removes prev instructions

Additional information

thread ID 019c0aed-2138-7b32-acf5-f3fb174f84f3

Activity

  1. added
    bug
    on Jan 29, 2026
  2. added
    CLI
    TUI
    on Jan 29, 2026
  3. swordfish444 commented on Jan 29, 2026

    @swordfish444
    Contributor

    @etraut-openai This looks like the same underlying issue as #9997 (Plan-mode instructions still influencing behavior after switching back to Code). This report has a nice timestamped repro; suggest consolidating the details into #9997 and closing this as a dup.

  4. yuvrajangadsingh commented on Jan 30, 2026

    @yuvrajangadsingh
    Contributor

    Root Cause Analysis

    I investigated the collaboration mode templates and found the issue:

    Plan mode template (codex-rs/core/templates/collaboration_mode/plan.md) states:

    "You are in Plan Mode until a developer message explicitly ends it.
    Plan Mode is not changed by user intent, tone, or imperative language."

    Code mode template (codex-rs/core/templates/collaboration_mode/code.md) only says:

    "you are now in code mode."

    When switching Plan→Code, the Code mode instruction doesn't explicitly end Plan mode - it just announces Code mode. The model follows Plan mode's instruction to persist until an explicit end message.

    Proposed Fix

    Update code.md to explicitly end Plan mode:

    Plan Mode is now ended. You are in Code mode.
    You may now execute commands, edit files, and perform mutating actions.

    This ensures the model receives an unambiguous signal that Plan mode rules no longer apply.

    Repro Steps (from issue)

    1. Start in Code mode
    2. Switch to Plan mode (shift+tab)
    3. Switch back to Code mode
    4. Ask for execution → agent refuses, claims still in Plan mode

    Thread ID: 019c0aed-2138-7b32-acf5-f3fb174f84f3

  5. yuvrajangadsingh commented on Jan 30, 2026

    @yuvrajangadsingh
    Contributor

    Note: I see @swordfish444 mentioned this may be a dup of #9997, which was marked as mitigated.

    However, since the issue persists in 0.92.0, my analysis above might explain why the fix was incomplete - the code.md template still doesn't explicitly end Plan mode, so the model continues following Plan mode's instruction to persist "until a developer message explicitly ends it."

    If this is indeed a regression or incomplete fix of #9997, the root cause analysis above may help identify what was missed.

  6. added a commit that references this issue on Jan 30, 2026
    59f71c5
  7. charley-oai commented on Feb 2, 2026

    @charley-oai
    Contributor

    Hey @0xdeafbeef have you noticed this on newer versions? I was unable to repro this even on v0.92.0 following your instructions:

    Start a session in Code mode.
    Switch to Plan mode (shift‑tab).
    Switch back to Code mode.
    Ask for an execution command (e.g., “go”).
    Observed: agent claims it’s still in Plan mode and refuses execution.
    Workaround: shift‑tab to Plan and back fixes it.

    I worry the behavior is non-deterministic. Did it happen every time for you? Or only sometimes?

  8. charley-oai commented on Feb 2, 2026

    @charley-oai
    Contributor

    If non-deterministic than it may just be an issue with the code mode developer instructions (being too subtle) as @yuvrajangadsingh has suggested. But in the rollout of the thread you posted, it looked like the model was getting confused by repetitive insertion of the plan mode instructions, which makes me think there was some bug causing the plan mode instructions to be reinserted at the wrong times (in which case updating the code mode prompt wouldn't fix).

  9. 0xdeafbeef commented on Feb 2, 2026

    @0xdeafbeef
    Author

    Hey @0xdeafbeef have you noticed this on newer versions? I was unable to repro this even on v0.92.0 following your instructions:

    Start a session in Code mode.
    Switch to Plan mode (shift‑tab).
    Switch back to Code mode.
    Ask for an execution command (e.g., “go”).
    Observed: agent claims it’s still in Plan mode and refuses execution.
    Workaround: shift‑tab to Plan and back fixes it.

    I worry the behavior is non-deterministic. Did it happen every time for you? Or only sometimes?

    Happened in some latest alpha from today. Also there is an issue when you switch plan -> code and it tries to use ask questions tool, but it's available only in a plan mode.

    Also it pretty often just states that it's ready to impl plan and asks to manually switch to code mode.

    I think that it's the problem of me doing several edit rounds in a single context window without using /new.

  10. charley-oai commented on Feb 3, 2026

    @charley-oai
    Contributor

    Hopefully this PR will improve: #10545

  11. 0xdeafbeef commented on Feb 3, 2026

    @0xdeafbeef
    Author
  12. 0xdeafbeef commented on Mar 2, 2026

    @0xdeafbeef
    Author

    looks fixed

  13. 7 remaining items

  14. firecrauter commented on May 4, 2026

    @firecrauter

    I just hit what looks like the same bug.

    I asked Codex to create a plan, but I forgot to type /plan or enable the Plan Mode switch manually.

    After that:

    • The response included literal <proposed_plan> and </proposed_plan> tags.
    • Codex appeared to behave as if it was in Plan Mode.
    • I could not proceed normally from that state.

    To work around it, I had to fork from the previous message and retry the request, this time explicitly enabling Plan mode.

    Note: I did not try sending another message with Plan Mode on active, then off.

    Environment:

    • Codex: 26.429.30905
    • OS: Windows 11
    • Subscription: ChatGPT Plus
    Image
  15. justingolden21 commented on May 7, 2026

    @justingolden21
    Image

    Still a thing in May 2026.

    Plan mode is unchecked and it absolutely refuses to do anything. This is broken and it's very annoying. I just had it execute a plan half an hour ago and it worked fine, and the next plan now it doesn't work at all

    Workaround: I force closed codex and restarted and no dice. I copied its plan to a new chat and it's now not in plan mode.

  16. thevans101 commented on May 18, 2026

    @thevans101

    Still a thing in May 2026.

    Plan mode is unchecked and it absolutely refuses to do anything. This is broken and it's very annoying. I just had it execute a plan half an hour ago and it worked fine, and the next plan now it doesn't work at all

    Workaround: I force closed codex and restarted and no dice. I copied its plan to a new chat and it's now not in plan mode.

    Confirming that I'm also occasionally experiencing this issue with GPT-5.5 in Codex Version 26.513.31313 (2867). Repeated prompts and restarting Codex didn't fix it for me either, but turning plan mode on, sending a short prompt (to ignore the message), then turning plan mode off again seemed to fix it.

  17. dsinghjassal commented on May 21, 2026

    @dsinghjassal

    @charley-oai / @etraut-openai I am also facing this issue; I am trying to try out codex having used claude code for months but this is not a great start for sure.

  18. dsinghjassal commented on May 21, 2026

    @dsinghjassal

    Still a thing in May 2026.
    Plan mode is unchecked and it absolutely refuses to do anything. This is broken and it's very annoying. I just had it execute a plan half an hour ago and it worked fine, and the next plan now it doesn't work at all
    Workaround: I force closed codex and restarted and no dice. I copied its plan to a new chat and it's now not in plan mode.

    Confirming that I'm also occasionally experiencing this issue with GPT-5.5 in Codex Version 26.513.31313 (2867). Repeated prompts and restarting Codex didn't fix it for me either, but turning plan mode on, sending a short prompt (to ignore the message), then turning plan mode off again seemed to fix it.

    Thanks for the workaround.

  19. mecattaf commented on Jul 21, 2026

    @mecattaf

    still happening on latest gpt 5.6 sol max btw

  20. alvinccli commented on Jul 24, 2026

    @alvinccli

    For me, sometimes the session does not refresh correctly and the answer takes forever. If I restart codex, I can see the answer correctly displayed (as if it answered in the background way earlier), but it will be locked in plan mode if I exit codex within plan mode.

  21. fhsec commented on Aug 9, 2026

    @fhsec

    This happens with 5.6 Sol on the GUI App still, restarting the app solves it.

  22. F1xGOD commented on Sep 1, 2026

    @F1xGOD

    still same issue, GUI and CLI 5.6 sol, 0.151.0, wth, will they fix this??

  23. yuvrajangadsingh commented on Sep 1, 2026

    @yuvrajangadsingh
    Contributor

    still reproduces on 0.151.0. the plan template in the shipped binary still reads "You are in Plan Mode until a developer message explicitly ends it", and i can't find any corresponding plan-ending developer message in there, which is the same mechanism i traced in january.

    to be precise about what i checked: that's the template text in the 0.151.0 binary, not a fresh TUI repro, so treat it as evidence the mechanism is unchanged rather than a full reproduction.

    #10270 covered the template side but was closed under the no-unsolicited-contributions policy, so nothing about that path has moved since.

  24. tonxxd commented on Sep 24, 2026

    @tonxxd

    Also happening to me on codex desktop 26.915.31945

  25. lucky13820 commented on Sep 27, 2026

    @lucky13820

    I have the same issue with codex cli, i can't switch off plan mode with /plan. And i didn't turn in on myself either.

  26. XAheli commented on Oct 22, 2026

    @XAheli

    +1 same thing happening in codex cli 0.155.0

  27. etraut-openai commented on Nov 15, 2026

    @etraut-openai
    Contributor

    We will be deprecating plan mode soon, so we don't plan to make any new investments in it.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    TUIbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions