openai / openai/codex

mcp-server: `model` parameter schema documents stale example ids (gpt-5.2), misleading MCP clients into pinning an old model

Open Beginner friendly
#40,986 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

CLI documentation mcp-server
Dominant language
Rust
Stars
125k
Forks
19.4k
PR merge metrics
PR metrics pending

Description

Summary

The model parameter of the codex tool exposed by codex mcp-server documents gpt-5.2 / gpt-5.2-codex as its examples. Those ids are several releases stale, and the doc comment is still on main.

codex-rs/mcp-server/src/codex_tool_config.rs:

/// Optional override for the model name (e.g. 'gpt-5.2', 'gpt-5.2-codex').
Why this is worth fixing rather than cosmetic

For an MCP client, that string is not decoration — it is the only concrete model id anywhere in the tool contract. An LLM-driven client reading the schema to learn how to call the tool sees gpt-5.2 presented as the exemplar and can reasonably pass it, silently pinning a session to an old model. The parameter is a free-form string with no enum and no validation, so nothing rejects the stale value; the downgrade is invisible until someone inspects the session rollout.

This is not hypothetical. Driving the tool from two MCP client agents, one of them stopped and asked whether gpt-5.2 was the model it was supposed to use, because the schema was the only model information available to it. The same binary's own model registry lists the current family, so the doc comment is the sole stale surface.

Reproduce
$ codex --version
codex-cli 0.148.0

$ strings "$(npm root -g)/@openai/codex/node_modules/@openai/codex-darwin-arm64/vendor/aarch64-apple-darwin/bin/codex" \
    | grep -oE "Optional override for the model name \(e\.g\.[^)]*\)\."
Optional override for the model name (e.g. 'gpt-5.2', 'gpt-5.2-codex').

Or start codex mcp-server and read the model property description in the codex tool's tools/list schema.

Confirmed present on main as of this writing, so 0.150.0 does not fix it.

Suggested fix

Either refresh the examples to current ids, or — since any literal id will drift again the same way — drop the examples and describe the fallback behaviour instead, which is stable:

/// Optional override for the model name. When omitted, the model is resolved
/// from CODEX_HOME/config.toml.

The second form is self-maintaining and, for an MCP client, more actionable than any example: what a client most needs to know is that omitting the field is the correct default.

Environment
  • codex-cli 0.148.0, macOS (darwin-arm64), installed via npm
  • Also verified against codex-rs/mcp-server/src/codex_tool_config.rs on main

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

Start in codex-rs/mcp-server/src/codex_tool_config.rs and inspect the doc comment for the codex tool's model parameter. Update the description so it documents the stable fallback behavior or current model information, then run codex mcp-server and inspect the tools/list schema to confirm the stale example is gone.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
88/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.