openai / openai/codex

[Bug] Global Tool-Calling Regression: Native tools drop and raw <thinking> tags leak across sessions during model switching

Open
#39,774 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

app bug tool-calls
Dominant language
Rust
Stars
125k
Forks
19.4k
PR merge metrics
PR metrics pending

Description

What version of the Codex App are you using (From “About Codex” dialog)?

26.819.11345

What subscription do you have?

Pro

What platform is your computer?

Darwin 25.5.0 arm64 arm

What issue are you seeing?
Brief Summary

Global failure of native client tools (Terminal/File I/O) occurs across all projects and sessions. The model enters an infinite loop attempting to call tools, emitting unparsed raw <thinking> tags, and erroring out with Tool parser repeatedly rejecting malformed call. Switching models (e.g., from gpt-5.6-sol to terra) exacerbates or triggers this breakdown.


Environment Details
  • App Name / Platform: Codex Desktop App (macOS)
  • OS Version: macOS (Darwin arm64)
  • Client Action Taken: Fresh reinstall, complete deletion of ~/.codex, ~/Library/Application Support/Codex, and app sandboxes (issue persists after clean reinstall).

Actual Behavior
  1. Tool Chain Breakdown: The agent loses access to native tools (functions.exec, file system reader, terminal, MCPs) and falls back strictly to collaboration / wait interfaces.
  2. Raw CoT Leakage: Internal reasoning tags (<thinking>...</thinking>) are leaked directly into the chat response stream instead of being processed by the UI parser.
  3. Infinite Tool Retry Loop: The model repeatedly attempts to invoke functions.exec using various payload syntax formats, but all attempts are rejected by the client-side parser.

Error Logs & Model Output Evidence

Here is the exact raw output stream emitted by the model during the failure:

我会重新从 docs/START.md 定位阅读范围,然后系统研读 01–13、现有 ADR、任务记录与报告...
<thinking>Reading indexed docs and project progress</thinking>
<thinking>Using available exec tool</thinking>
<thinking>Trying to invoke exec via commentary</thinking>
<thinking>Tool invocation syntax issue</thinking>
<thinking>Switching to known functions.exec format</thinking>
<thinking>Tool call channel confusion</thinking>
<thinking>Attempting explicit function call payload</thinking>
<thinking>Correcting tool name to functions.exec</thinking>
<thinking>Switching to collaboration to inspect docs</thinking>
<thinking>Resolving tool invocation errors</thinking>
<thinking>Checking function tool declarations</thinking>
<thinking>Fallback to collaboration wait for tool state</thinking>
<thinking>Attempting to call shell through functions.exec</thinking>
<thinking>Trying to use provided exec tool schema</thinking>
<thinking>Using collaboration tools only when explicitly needed</thinking>
<thinking>Tool parser repeatedly rejecting malformed call; retrying correct payload</thinking>
<thinking>Switching call structure explicitly</thinking>
<thinking>Potential tool outage; checking with collaboration list</thinking>
<thinking>Inspecting available namespace directly</thinking>
<thinking>Trying direct shell tool invocation despite hidden declaration</thinking>
<thinking>Diagnosing inability to invoke command tools</thinking>
<thinking>Retrying proper exec call syntax</thinking>
<thinking>Considering direct textual tool call</thinking>
<thinking>Using functions.exec according to documented schema</thinking>
<thinking>Tool invocation stuck; trying alternate channel</thinking>
<thinking>Testing whether shell command execution is possible via commentary tool</thinking>
<thinking>Continuing despite tool parser glitch</thinking>
<thinking>Attempting raw exec namespace</thinking>
<thinking>Tool issue persists; attempting command via collaboration agent</thinking>
<thinking>Retry with explicit JSON object</thinking>
<thinking>Considering that functions.exec may be unavailable in current tool set</thinking>
<thinking>Attempting to issue shell command through wait tool impossible</thinking>
<thinking>Trying call with actual arguments instead of empty</thinking>
<thinking>Root tool registry only exposing collaboration tools; using available exec from previous context unavailable</thinking>
<thinking>Need proceed with document reading; tool invocation likely malformed by interface. Try known functions.exec symbol explicitly in source</thinking>
<thinking>Escalating issue? Try collaboration spawn with valid required fields</thinking>
<thinking>I accidentally keep emitting empty object due to tool UI; manually construct JSON</thinking>
<thinking>Attempting to use the intended namespace directly in tool target</thinking>
Image
What steps can reproduce the bug?
Steps to Reproduce
  1. Open any workspace in Codex Desktop App (e.g., /Users/gokyrie/projects/vg-api).
  2. Send an initial instruction requiring local tool execution (e.g., Exploring project docs).
  3. Switch active models mid-session or initialize a task using specific model variants (e.g., switching from gpt-5.6-sol to terra).
  4. Prompt the agent to perform read/exec actions on project documents.
What is the expected behavior?
Expected Behavior

The agent should parse the tool schema properly, silently execute the underlying shell/read tools via internal IPC, render the Chain of Thought appropriately, and return the aggregated markdown file contents.

Additional information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure in the Codex Desktop App on macOS using the listed workspace, tool-execution prompt, and model switch. Start by comparing the raw output and tool-parser errors across sessions; done means native terminal and file tools execute reliably, malformed-call retries stop, and raw tags no longer appear in chat.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, rust
Domain
ai, desktop, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.