Codex CLI v0.139.0: Code Mode Can Now Search the Web Mid-Task, and Complex Tool Schemas Finally Stay Intact
Codex CLI v0.139.0 lets code mode call web search directly, including from nested JS tool calls, and fixes oneOf/allOf schema preservation for MCP tools.
Codex CLI v0.139.0, released June 9, 2026, ships two improvements that quietly close some real gaps in agentic coding workflows: code mode can now call web search as a standalone tool, and the schema handling for MCP tool connectors has been fixed to properly preserve oneOf and allOf keywords. Neither of these is a headline feature in the flashy sense, but both matter a lot in practice if you’re building workflows that mix live research with code generation.
What changed with web search in code mode
Until this release, web search was available in Codex’s general agent mode but not directly callable as a standalone tool from within code mode. Code mode is the focused, purpose-built mode for reading, editing, running, and patching code in your working directory. It’s where most of the serious agentic coding work happens, and the absence of web search there was a real friction point.
As of v0.139.0 (PR #26719), that’s fixed. Code mode can now call standalone web search directly and receive plaintext results in return. More specifically, this works even from nested JavaScript tool calls inside a code-mode session.
That last part is worth pausing on. It means JavaScript-executed tool invocations running inside a code-mode context can themselves trigger a web search. So if you have a workflow that programmatically builds tool calls, or one where a piece of code under execution needs to resolve something against current documentation, Codex can now fetch that information without you needing to break out of code mode, switch contexts, or restructure your pipeline.
In practical terms: if you’re generating code that uses a library, and the agent needs to check the current API surface or a recent breaking change in the docs, it can do that lookup mid-turn. The results come back as plaintext and feed directly into what it’s building. Web search still defaults to cached mode (OpenAI’s pre-indexed web results), and you can switch to live browsing with the --search flag if you need fresher data.
What changed with oneOf and allOf schema preservation
The second fix is less visible but arguably more impactful for anyone building or consuming complex MCP tools.
JSON Schema uses oneOf and allOf to express conditional types, polymorphism, and validation combinators. If you have a tool parameter that can legitimately accept two distinct shapes depending on context, you describe that with oneOf. These keywords are central to how real-world tool schemas work, especially as tools get more sophisticated.
The problem was that Codex’s schema compaction process could strip those keywords. When Codex loads an MCP tool, it compacts large schemas to fit within processing constraints. Before this fix, that compaction could remove oneOf and allOf entirely, which meant tools with conditional or polymorphic parameters either failed silently or had their schemas misrepresented to the model. The model would then make tool calls based on an incomplete picture of what the tool actually accepts.
PRs #24118 and #27084 fix both parts of this: oneOf and allOf are now preserved, and large schemas retain more of their shallow structure during compaction rather than being aggressively collapsed. The practical result is that complex, real-world MCP tool schemas come through accurately. Tools that were previously unreliable or broken in Codex because of schema mangling should work correctly now.
What this means for you
If you’re using Codex CLI for straightforward single-file tasks, neither of these changes will feel dramatic. But if you’re building agentic pipelines, or you’ve invested time in MCP tool integrations, both are meaningful.
For research-plus-code workflows: You can now design a single code-mode session that pulls live (or cached) web data as needed, without architecture gymnastics to route through a different mode. A workflow that generates a data pipeline, checks current API rate limits in the docs, adjusts the code accordingly, and runs tests can now happen in one coherent session. Codex tracks progress with a to-do list internally and treats web search and MCP as connected tools in that flow. This release makes the connection tighter.
For MCP tool authors and integrators: If your tools use oneOf or allOf in their input schemas (and many well-designed tools do), you should now see those schemas behave correctly when Codex loads them. It’s worth retesting any tools that previously produced unexpected results or validation errors, since the underlying schema representation was likely being corrupted before.
For subagent workflows: A separate fix in this release also cleans up MCP startup behaviour when subagents are involved. Startup warnings from subagents now stay in the thread that owns them, rather than leaking into the parent thread and creating duplicate alerts or stuck spinners in the TUI. Small thing, but if you’re running parallel subagent setups, it removes some noise.
A note on the broader release
v0.139.0 also ships codex doctor improvements (editor and pager environment details now appear in the local report, redacted in JSON output), a fix for codex resume --last and codex fork --last incorrectly reading the trailing argument as a session ID rather than an initial prompt, and a new -P permissions profile flag for codex sandbox. These are useful housekeeping items rather than workflow changes.
The preceding v0.138.0 (June 8) added the /app command to hand off a CLI session to Codex Desktop on macOS and Windows, and fixed image edits to use the exact referenced file path rather than guessing from conversation history.
Codex CLI is open-source and available at github.com/openai/codex. If you’re on a Plus, Pro, Business, Edu, or Enterprise plan, these capabilities are available to you now.