spawn_agent's model override list is capped at five rows
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.4k
- PR merge metrics
- PR metrics pending
Description
What happened
spawn_agent's tool description advertises at most five model overrides, taken from the first five picker-visible rows of the model catalogue. When the catalogue comes from model_catalog_json (a custom/local provider, or any setup that merges extra models into the picker), every model past the first five is invisible in that list even though model/list and the picker return all of them.
Evidence
Client: codex-cli 0.154.0-alpha.6.2 (bundled app-server), -c model_catalog_json=<file> with a 26-row catalogue. A local sink that answers 426 to the WebSocket upgrade recorded the first /responses body, and the spawn_agent declaration inside it reads:
Available model overrides (optional; inherited parent model is preferred):
- `gpt-6-astra`: ...
- `gpt-5.6-sol`: ...
- `gpt-5.6-terra`: ...
- `gpt-5.6-luna`: ...
- `gpt-5.5`: ...
Exactly the first five rows of the catalogue, in order. Raising the catalogue to more rows does not extend the list. This matches MAX_SPAWN_AGENT_MODEL_OVERRIDES = 5 in codex-rs/core/src/tools/handlers/multi_agents_common.rs (checked against rust-v0.153.4).
Passing an id outside the list still works: find_spawn_agent_model_name searches the full model list, so a model id the user knows about is routed correctly. The cap therefore costs discoverability, not correctness - an agent that has not been told the id cannot see it exists.
Suggestion
One of:
- list every eligible model in the description,
- raise or remove
MAX_SPAWN_AGENT_MODEL_OVERRIDES, - keep the cap but emit
and N moreso a reader knows the list is truncated (today the text reads as if five were all there is).
Happy to test a build with any of these.
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 in codex-rs/core/src/tools/handlers/multi_agents_common.rs, inspect MAX_SPAWN_AGENT_MODEL_OVERRIDES and the code that builds the spawn_agent description from the model catalogue. Reproduce with a model_catalog_json file containing more than five rows and compare the advertised overrides with model/list and picker results. Done means the description accurately communicates the available eligible models, including how any truncation is represented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 74/100