You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What terminal emulator and version are you using (if applicable)?
GNU bash, version 5.0.17(1)-release (x86_64-pc-linux-gnu)
What issue are you seeing?
Codex appears to keep a stale MCP tool schema in-session, even when the server emits notifications/tools/list_changed.
What steps can reproduce the bug?
Start Codex with an MCP server exposing:
tool: count_detections
required input: duration
Call it successfully: {"duration":"1h"}
Change the server so the same tool name now requires:
lookback
not duration
Rebuild and restart the MCP server.
Server replays initialization and emits notifications/tools/list_changed.
In the same Codex session, call the tool again.
Codex still uses the old schema and the call fails with: Mcp error: -32602: invalid params: validating "arguments": validating root: unexpected additional properties ["duration"]
What is the expected behavior?
After notifications/tools/list_changed, Codex should refresh the tool definition and use the updated schema in the same session.
Additional information
Control
A fresh MCP client connected to the same restarted server immediately sees the new schema and can call the tool correctly, so this looks like a Codex-side stale cache/binding issue rather than an MCP server restart issue.
Current workaround
restart Codex after breaking MCP schema changes
or version tool names / temporarily accept both old and new params
Hey, I came across your Codex issue about the MCP tool schema changing from duration to lookback while Codex kept using the stale schema.
Curious after running into that, did you find a reliable way to catch MCP tool/schema changes before they cause calls to fail, or is restarting/updating clients still basically the workaround?
Hey, I came across your Codex issue about the MCP tool schema changing from duration to lookback while Codex kept using the stale schema.
Curious after running into that, did you find a reliable way to catch MCP tool/schema changes before they cause calls to fail, or is restarting/updating clients still basically the workaround?
Unfortunately not! I am still hoping that this will be resolved.
Hey, I came across your Codex issue about the MCP tool schema changing from duration to lookback while Codex kept using the stale schema.
Curious after running into that, did you find a reliable way to catch MCP tool/schema changes before they cause calls to fail, or is restarting/updating clients still basically the workaround?
Unfortunately not! I am still hoping that this will be resolved.
Not a fix for the Codex-side caching bug, no that's on OpenAI's end. But since you can't rely on the client catching tools/list_changed reliably, I ended up building something that watches the MCP server directly and flags schema changes (like your duration→lookback case) the moment they happen, independent of whether any client picks up the notification. Built it after hitting this exact class of problem myself happy to point you at it if useful, no pressure either way.
Related reproduction on the same active-thread stale-schema problem, with an installed native Codex CLI 0.163.0:
I ran the app-server against a disposable local Streamable HTTP MCP server using protocol 2025-06-18. Generation 1 exposed fixture_tool with an item_id schema; Generation 2 changed its description and added a return_to_implementation boolean.
In the existing thread, mcpServerStatus/list and the next model request retained Generation 1 across successive turns. The server recorded zero tools/list requests on the retained connection during config/mcpServer/reload, which returned {}. Tool calls in that thread did reach Generation 2.
Fresh discovery and a new codex exec --ephemeral session both fetched Generation 2 and exposed its description/schema to the model.
This fixture used only synthetic loopback servers and a mock model endpoint; it touched no live MCP service, user configuration, or credentials. It suggests that the current app-server reload path does not invalidate an unchanged healthy Streamable HTTP connection's cached catalog when the server cannot send notifications/tools/list_changed. I found no supported same-thread refresh in this 0.163.0 path. Please treat this as additional evidence for the existing stale-schema issue; fresh-session recovery is the bounded current workaround, not active-thread freshness.
Replying to the question of "a reliable way to catch MCP tool/schema changes before they cause calls to fail" - yes, there is one, and it is complementary to both the candidate fix above and the live-watcher approach described in this thread:
Pin the tool contracts at approval time and diff against them. We maintain rugsnare (Apache-2.0): scan captures every tool's {name, description, inputSchema} as a signed baseline, diff (or a CI step / GitHub Action) reports every change graded by direction - the duration -> lookback case would surface as a schema drift with the exact before/after, at upgrade time rather than at first failed call.
The three layers compose rather than compete: @barryw's fix makes the client honor tools/list_changed; a live watcher flags changes the moment they happen; a pin answers the question neither can - "is what the server serves now the same shape the user approved?" - including cases where nobody is watching (fresh CI run, new machine, first session after an upgrade). Field evidence for how often that matters: 25 of 28 MCP servers we watch changed at least one tool contract across version windows (corpus + repro).
Activity
barryw commentedon Jul 3, 2026
I have a candidate fix for this at https://github.com/barryw/codex/tree/codex/fix-mcp-tool-list-changed.
Summary:
This also looks related to #10105. Happy to open an invited PR if this matches the intended direction.
anythingoah commentedon Aug 30, 2026
Hey, I came across your Codex issue about the MCP tool schema changing from
durationtolookbackwhile Codex kept using the stale schema.Curious after running into that, did you find a reliable way to catch MCP tool/schema changes before they cause calls to fail, or is restarting/updating clients still basically the workaround?
abirmingham commentedon Aug 31, 2026
Unfortunately not! I am still hoping that this will be resolved.
anythingoah commentedon Sep 1, 2026
Not a fix for the Codex-side caching bug, no that's on OpenAI's end. But since you can't rely on the client catching tools/list_changed reliably, I ended up building something that watches the MCP server directly and flags schema changes (like your duration→lookback case) the moment they happen, independent of whether any client picks up the notification. Built it after hitting this exact class of problem myself happy to point you at it if useful, no pressure either way.
osewon10-netizen commentedon Oct 18, 2026
Related reproduction on the same active-thread stale-schema problem, with an installed native Codex CLI 0.163.0:
fixture_toolwith anitem_idschema; Generation 2 changed its description and added areturn_to_implementationboolean.mcpServerStatus/listand the next model request retained Generation 1 across successive turns. The server recorded zerotools/listrequests on the retained connection duringconfig/mcpServer/reload, which returned{}. Tool calls in that thread did reach Generation 2.codex exec --ephemeralsession both fetched Generation 2 and exposed its description/schema to the model.This fixture used only synthetic loopback servers and a mock model endpoint; it touched no live MCP service, user configuration, or credentials. It suggests that the current app-server reload path does not invalidate an unchanged healthy Streamable HTTP connection's cached catalog when the server cannot send
notifications/tools/list_changed. I found no supported same-thread refresh in this 0.163.0 path. Please treat this as additional evidence for the existing stale-schema issue; fresh-session recovery is the bounded current workaround, not active-thread freshness.Paraphern commentedon Oct 21, 2026
Replying to the question of "a reliable way to catch MCP tool/schema changes before they cause calls to fail" - yes, there is one, and it is complementary to both the candidate fix above and the live-watcher approach described in this thread:
Pin the tool contracts at approval time and diff against them. We maintain rugsnare (Apache-2.0):
scancaptures every tool's{name, description, inputSchema}as a signed baseline,diff(or a CI step / GitHub Action) reports every change graded by direction - theduration->lookbackcase would surface as a schema drift with the exact before/after, at upgrade time rather than at first failed call.The three layers compose rather than compete: @barryw's fix makes the client honor
tools/list_changed; a live watcher flags changes the moment they happen; a pin answers the question neither can - "is what the server serves now the same shape the user approved?" - including cases where nobody is watching (fresh CI run, new machine, first session after an upgrade). Field evidence for how often that matters: 25 of 28 MCP servers we watch changed at least one tool contract across version windows (corpus + repro).