Excessive token consumption with tool search
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.4k
- PR merge metrics
- PR metrics pending
Description
What version of Codex CLI is running?
codex-cli 0.153.4
What subscription do you have?
Max 20
Which model were you using?
gpt-6-astra medium
What platform is your computer?
MacOS
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.
What steps can reproduce the bug?
Uploaded thread: 01a0871a-f281-7442-b91b-f1e4458089a5
What is the expected behavior?
Agent does more precise search for the tools, and only loads full tool definitions to candidates it actually wants to use.
Additional information
https://gist.github.com/jlitola/381d15761ec108918ddca4e53d1d097f
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the uploaded thread 01a0871a-f281-7442-b91b-f1e4458089a5 and the linked gist, then reproduce the wide tool search with codex-cli 0.153.4 on macOS. Done means search results avoid unnecessary tool definitions, preserve relevant candidates without truncation, and substantially reduce the session's token usage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- ai-infra-agents, cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100