Tools are sent to the model even if not configured

Open 💬 5 comments Opened Feb 7, 2026 by darlingm

What version of Codex CLI is running?

0.98.0

What subscription do you have?

pro

Which model were you using?

gpt-5.3-codex

What platform is your computer?

Linux 6.18.6-arch1-1 x86_64 unknown

What terminal emulator and version are you using (if applicable)?

n/a

What issue are you seeing?

Codex CLI includes tools that are not configured in the list sent to the AI model.

What steps can reproduce the bug?

  1. Have no MCP servers configured.
  2. Log the actual network traffic. I had it log to a file based on the session file Codex was already making, but also with -traffic in the name. Happy to share the patch, but Codex made it for me. Log outbound around codex-rs/codex-api/src/endpoint/responses.rs:137 and codex-rs/codex-api/src/endpoint/responses_websocket.rs:254, and inbound around codex-rs/codex-api/src/sse/responses.rs:372 and codex-rs/codex-api/src/endpoint/responses_websocket.rs:296.
  3. Conduct a session.
  4. View the logged traffic, and observe the tools array includes list_mcp_resources, list_mcp_resource_templates, read_mcp_resource.

What is the expected behavior?

If a tool is not configured, it should not be sent to the AI model.

Sending it:

  • Unnecessarily burns (a small amount of) tokens.
  • Unnecessarily uses (a small amount of) context window, (very slightly) degrading model performance.

Additional information

Surely, more tools will be added in the future. I think getting the policy and code in place now to avoid sending unconfigured tools will have larger future benefits.

Additionally, I think a wider effort could be made to avoid sending unnecessary things to the model, so that parts of internal Codex prompt .md files can be omitted if they are not relevant in the current thread.

Note: In case anyone is looking for why more tokens are charged by the API than the Codex session logs show, the tools information is not currently in the sessions file but those are charged as input tokens.

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗