Codex in experimental plan mode create the plan file twice #7254

Open
opened 2026-02-16 18:06:35 -05:00 by yindo · 1 comment
Owner

Originally created by @ranqn on GitHub (Jan 22, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

Codex models are equipped with the apply_patch tool, not able to use the write tool, and when in the experimental plan mode, it will first create the plan file using apply_patch but found itself violated instructions to mandate the write tool, then delete and recreate the same plan file.

Its thinking often shows something like:

Thinking: Correcting file creation to use write tool

The initial plan file was created with apply_patch, but instructions mandate using the write tool in plan mode, so I'll rewrite the file with the write tool.
Thinking: Confirming only patch-based file writes

The available tools lack a direct write or edit command, so file modifications must use apply_patch despite system reminders mentioning write. I'll continue using apply_patch for file changes.

Plugins

No response

OpenCode version

1.1.32

Steps to reproduce

  1. Enable the experimental plan mode.
  2. Select GPT Codex 5.2 with plan mode.
  3. Ask to create a plan.
  4. Observe the agent try to create the plan file twice.

Screenshot and/or share link

No response

Operating System

Windows 11

Terminal

Windows Terminal

Originally created by @ranqn on GitHub (Jan 22, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description Codex models are equipped with the `apply_patch` tool, not able to use the `write` tool, and when in the experimental plan mode, it will first create the plan file using `apply_patch` but found itself violated instructions to mandate the `write` tool, then delete and recreate the same plan file. Its thinking often shows something like: ``` Thinking: Correcting file creation to use write tool The initial plan file was created with apply_patch, but instructions mandate using the write tool in plan mode, so I'll rewrite the file with the write tool. ``` ``` Thinking: Confirming only patch-based file writes The available tools lack a direct write or edit command, so file modifications must use apply_patch despite system reminders mentioning write. I'll continue using apply_patch for file changes. ``` ### Plugins _No response_ ### OpenCode version 1.1.32 ### Steps to reproduce 1. Enable the experimental plan mode. 2. Select GPT Codex 5.2 with plan mode. 3. Ask to create a plan. 4. Observe the agent try to create the plan file twice. ### Screenshot and/or share link _No response_ ### Operating System Windows 11 ### Terminal Windows Terminal
yindo added the bugzen labels 2026-02-16 18:06:35 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 22, 2026):

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

  • #10057: plan agent runs amock and starts writing - related issue where the plan agent is making unexpected changes and creating files twice
  • #9997: When using the experimental plan mode, allow opencode to write the plan without asking for permission - related feature request about plan mode file handling

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

@github-actions[bot] commented on GitHub (Jan 22, 2026): This issue might be a duplicate of existing issues. Please check: - #10057: `plan` agent runs amock and starts writing - related issue where the plan agent is making unexpected changes and creating files twice - #9997: When using the experimental plan mode, allow opencode to write the plan without asking for permission - related feature request about plan mode file handling Feel free to ignore if none of these address your specific case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7254