Skip to content

fix: explicitly end Plan mode when switching to Code mode - #10270

Closed
yuvrajangadsingh wants to merge 1 commit into
openai:mainfrom
yuvrajangadsingh:fix/plan-mode-explicit-exit
Closed

yuvrajangadsingh wants to merge 1 commit into
openai:mainfrom
yuvrajangadsingh:fix/plan-mode-explicit-exit

Conversation

@yuvrajangadsingh

Copy link
Copy Markdown
Contributor

Summary

Fixes #10185

When switching from Plan to Code mode, the Code mode template now explicitly ends Plan mode.

Root Cause

The Plan mode template (plan.md) states:

"You are in Plan Mode until a developer message explicitly ends it."

But the Code mode template (code.md) only said:

"you are now in code mode."

This wasn't an explicit "end" to Plan mode, causing the model to continue following Plan mode instructions even after switching.

Changes

Updated 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.

Testing

  1. Start in Code mode
  2. Switch to Plan mode (shift+tab)
  3. Switch back to Code mode
  4. Ask for execution → agent should now execute instead of refusing

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

When switching from Plan to Code mode, the Code mode template now
explicitly ends Plan mode. This addresses the issue where the model
would continue following Plan mode instructions because Plan mode
states it persists 'until a developer message explicitly ends it.'

Fixes openai#10185
@yuvrajangadsingh

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. Can't wait for the next one!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@etraut-openai

Copy link
Copy Markdown
Contributor

We've updated our contribution guidelines to indicate that we're no longer accepting unsolicited code contributions. All code contributions are by invitation only. To read more about why we've taken this step, please refer to this announcement.

@yuvrajangadsingh
yuvrajangadsingh deleted the fix/plan-mode-explicit-exit branch January 30, 2026 22:45
@charley-oai

Copy link
Copy Markdown
Contributor

@yuvrajangadsingh we can continue the discussion in the issue comments, but in the session rollout posted in #10185, the issue looked like plan mode developer instructions being sent at wrong times, not just the code mode prompt being too subtle.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mode switch Plan -> Code still behaves like Plan

3 participants