Tools are sent to the model even if not configured
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?
- Have no MCP servers configured.
- Log the actual network traffic. I had it log to a file based on the session file Codex was already making, but also with
-trafficin the name. Happy to share the patch, but Codex made it for me. Log outbound aroundcodex-rs/codex-api/src/endpoint/responses.rs:137andcodex-rs/codex-api/src/endpoint/responses_websocket.rs:254, and inbound aroundcodex-rs/codex-api/src/sse/responses.rs:372andcodex-rs/codex-api/src/endpoint/responses_websocket.rs:296. - Conduct a session.
- 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.
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗