Experimental Plan mode with gpt-5.2-codex does not make tool calls before launching explore agents #8463

Open
opened 2026-02-16 18:10:02 -05:00 by yindo · 3 comments
Owner

Originally created by @AdiRishi on GitHub (Feb 3, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

When planning work, I often provide additional context that requires an agent to make tool calls before it starts it's planning and exploration work.
This sort of behavior has always worked fine in Claude Code and also works in OpenCode when using Claude Opus 4.5, but in OpenCode's experiemental plan mode when using gpt-5.2-codex, it seems there are some restrictions placed on the model to explore before it can make any additional tool calls.

This leads to the exploration agents checking the codebase aimlessly rather than a focused exploration based on the requirements of the feature

Examples via screenshots

Here is a prompt I used on Claude Code, OpenCode with gpt-5.2-codex and OpenCode with claude-opus-4.5

Get the comments from this MR and plan a fix - https://gitlab.<redacted>/sme/mobile-ios-app/-/merge_requests/1829

We can see that Claude Code and OpenCode with Opus 4.5 behave correctly, by first getting the context needed and then delegating to an explore agent to understand the codebase

Image Image

However, when we run the same prompt on gpt-5.2-codex we see the following. The chain of throught summary clearly shows that either it is resricted or the prompt somehow tells it to not make any tool calls before exploring the code

Image

It would be great to fix this issue, since it severly limits how useful gpt-5.2-codex is in plan mode right now.
Happy to provide additional context or any other infromation that might help :)

Plugins

None

OpenCode version

1.1.49

Operating System

MacOS 26.2 (25C56)

Terminal

Ghostty

Originally created by @AdiRishi on GitHub (Feb 3, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description When planning work, I often provide additional context that requires an agent to make tool calls before it starts it's planning and exploration work. This sort of behavior has always worked fine in Claude Code and also works in OpenCode when using Claude Opus 4.5, but in OpenCode's experiemental plan mode when using gpt-5.2-codex, it seems there are some restrictions placed on the model to explore *before* it can make any additional tool calls. This leads to the exploration agents checking the codebase aimlessly rather than a focused exploration based on the requirements of the feature #### Examples via screenshots Here is a prompt I used on Claude Code, OpenCode with gpt-5.2-codex and OpenCode with claude-opus-4.5 ``` Get the comments from this MR and plan a fix - https://gitlab.<redacted>/sme/mobile-ios-app/-/merge_requests/1829 ``` We can see that Claude Code and OpenCode with Opus 4.5 behave correctly, by first getting the context needed and then delegating to an explore agent to understand the codebase <img width="1916" height="767" alt="Image" src="https://github.com/user-attachments/assets/13af6c16-ce94-40e0-b0b2-e6497b2187d0" /> <img width="1912" height="976" alt="Image" src="https://github.com/user-attachments/assets/503eca30-17fa-40bd-87a2-12814e680908" /> However, when we run the same prompt on gpt-5.2-codex we see the following. The chain of throught summary clearly shows that either it is resricted or the prompt somehow tells it to not make any tool calls before exploring the code <img width="1916" height="980" alt="Image" src="https://github.com/user-attachments/assets/92952b59-59f1-4492-ab4d-8a94d97c2fe7" /> It would be great to fix this issue, since it severly limits how useful gpt-5.2-codex is in plan mode right now. Happy to provide additional context or any other infromation that might help :) ### Plugins None ### OpenCode version 1.1.49 ### Operating System MacOS 26.2 (25C56) ### Terminal Ghostty
yindo added the bug label 2026-02-16 18:10:02 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 3, 2026):

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

  • #9296: Experimental plan mode handover -> build uses plan agent's model
  • #8432: partial fix: Issues in the new experimental Planning mode
  • #10314: Experimental Plan Mode made code changes

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

@github-actions[bot] commented on GitHub (Feb 3, 2026): This issue might be a duplicate of existing issues. Please check: - #9296: Experimental plan mode handover -> build uses plan agent's model - #8432: partial fix: Issues in the new experimental Planning mode - #10314: Experimental Plan Mode made code changes Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Feb 3, 2026):

will do

@rekram1-node commented on GitHub (Feb 3, 2026): will do
Author
Owner

@AdiRishi commented on GitHub (Feb 8, 2026):

@rekram1-node I figured I should be a helpful user and try to experiment with a fix myself 😆
After exploring the codebase and testing a bit more rigorously, I had a few interesting findings:

  1. The Codex models do not always refuse to get external details before starting explore agents; rarely, they will agree to actually invoke the MCP tools required to gain context.
  2. More often, Codex will choose to simplify and tell its explore agent to get MR details, which unfortunately compromises the quality of the code exploration, and also generally doesn't work since the explore agents cannot use GitLab MCP tools.

There is some definite improvement that can be made by tweaking the prompt. I've done some research and tested something I think works well. I'll raise a PR for it 🙏

@AdiRishi commented on GitHub (Feb 8, 2026): @rekram1-node I figured I should be a helpful user and try to experiment with a fix myself 😆 After exploring the codebase and testing a bit more rigorously, I had a few interesting findings: 1. The Codex models do not always refuse to get external details before starting explore agents; rarely, they will agree to actually invoke the MCP tools required to gain context. 2. More often, Codex will choose to simplify and tell its explore agent to get MR details, which unfortunately compromises the quality of the code exploration, and also generally doesn't work since the explore agents cannot use GitLab MCP tools. There is some definite improvement that can be made by tweaking the prompt. I've done some research and tested something I think works well. I'll raise a PR for it 🙏
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8463