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
{{ message }}
Repository navigation
Excessive token consumption with tool search #44228
CLIIssues related to the Codex CLIbugSomething isn't workingmodel-behaviorIssues related to behaviors exhibited by the modelrate-limitsIssues related to rate limits, quotas, and token usage reportingtool-callsIssues related to tool calling
What terminal emulator and version are you using (if applicable)?
Orca
Codex doctor report
What issue are you seeing?
Agent makes too wide tool search call causing 33k token response and 10k tokens added to session. Returned results include results widely with multiple plugins and tool descriptions contain their full Typescript definitions. This can also cause legit tool definitions to be missed as result get truncated.
Asked agent to check my Codex session history, and looks like this is triggering pretty often:
Deduped by call_id (history replay would otherwise double-count), attributed to the exec call that produced them:
┌─────────────┬───────────────────┬───────────┬──────┐
│ window │ ALL_TOOLS queries │ truncated │ rate │
├─────────────┼───────────────────┼───────────┼──────┤
│ last 24h │ 126 │ 20 │ 15% │
├─────────────┼───────────────────┼───────────┼──────┤
│ last 7 days │ 925 │ 182 │ 20% │
└─────────────┴───────────────────┴───────────┴──────┘
Original token counts on the truncated ones: median 11,766, max 62,980 — double the gist's case. Roughly 1.15M tokens discarded over 7 days, and since each truncated call still injects ~10k, that's ~1.8M tokens actually pushed into contexts in a week by these queries alone.
The pattern is always the same shape — a broad alternation regex over name + description:
/githits|skill/i.test(x.name + " " + x.description) → 62,980 tok
/githits|quick_start/i.test(x.name+" "+x.description) → 61,603 tok
/datadog|fly|github|log|metric|deploy/i.test(...) → 49,662 tok
The datadog and githits terms are what blow it up — both match enormous MCP catalogs, and matching against description pulls the full text of every hit.
Source-level follow-up from inspecting tag rust-v0.162.0-alpha.17.2:
codex-rs/code-mode-protocol/src/description.rs augments tool descriptions with TypeScript declarations and copies definition.description into EnabledToolMetadata.
codex-rs/core/src/tools/code_mode/execute_handler.rs constructs the enabled definitions for execution. The code-mode instructions expose ALL_TOOLS for metadata discovery.
codex-rs/core/src/tools/handlers/tool_search.rs accepts a caller-supplied result limit. Restricting which connector tools are enabled is a separate concern from restricting how much schema information discovery exports.
Can maintainers identify a supported desktop configuration, or an engine correction, that enforces ALL of the following across app/MCP connectors?
Apply the user's authorized-tool boundary before catalog discovery, definition disclosure, and execution.
Expose lightweight names/summaries for discovery, with full argument schemas loaded only for specifically selected operations.
Enforce bounded discovery and prevent bulk schema exports through the code-mode catalog, including repeated searches that bypass a per-call limit.
Emit inspectable policy-rejection events and a supported user notification.
Preserve enabled connector functionality and the model's full context window.
Disabling entire connectors, reducing the context window, and truncating useful connector data do not implement this selective-disclosure boundary. Please identify the exact supported configuration keys and versions, or track the missing runtime enforcement as an engineering fix.
CLIIssues related to the Codex CLIbugSomething isn't workingmodel-behaviorIssues related to behaviors exhibited by the modelrate-limitsIssues related to rate limits, quotas, and token usage reportingtool-callsIssues related to tool calling
Activity
jlitola commentedon Sep 9, 2026
Asked agent to check my Codex session history, and looks like this is triggering pretty often:
digital-asylum-ai commentedon Oct 12, 2026
Source-level follow-up from inspecting tag
rust-v0.162.0-alpha.17.2:codex-rs/code-mode-protocol/src/description.rsaugments tool descriptions with TypeScript declarations and copiesdefinition.descriptionintoEnabledToolMetadata.codex-rs/core/src/tools/code_mode/execute_handler.rsconstructs the enabled definitions for execution. The code-mode instructions exposeALL_TOOLSfor metadata discovery.codex-rs/core/src/tools/handlers/tool_search.rsaccepts a caller-supplied result limit. Restricting which connector tools are enabled is a separate concern from restricting how much schema information discovery exports.Can maintainers identify a supported desktop configuration, or an engine correction, that enforces ALL of the following across app/MCP connectors?
Disabling entire connectors, reducing the context window, and truncating useful connector data do not implement this selective-disclosure boundary. Please identify the exact supported configuration keys and versions, or track the missing runtime enforcement as an engineering fix.
Source links:
https://github.com/openai/codex/blob/rust-v0.162.0-alpha.17.2/codex-rs/code-mode-protocol/src/description.rs
https://github.com/openai/codex/blob/rust-v0.162.0-alpha.17.2/codex-rs/core/src/tools/handlers/tool_search.rs
These are source-inspection findings, not a claim that a candidate patch has been compiled or deployed.