Gearclickist, after v0.1.1214: the lead still saw only five models for
its subagents. v0.1.1214 (5d33f060b) widened spawn_agent in the request's
tools only. Codex 0.162 doesn't put it there for a model that can search
tools: with supports_search_tool the multi-agent V1 tools are Deferred
(codex-rs rust-v0.162.1 core/src/tools/spec_plan.rs:1475-1479), the lead
calls tool_search, and spawn_agent, with Codex's five
(core/src/agent/child_config.rs:20 MAX_SPAWN_AGENT_MODEL_OVERRIDES = 5,
used in core/src/tools/handlers/multi_agents_spec.rs:830), arrives in a
tool_search_output item in the conversation. Codex resends that item on
every later turn. magpie's /models entries and Codex's own say
supports_search_tool, so this is the usual case, and the fix never fired.
The limit is only in what Codex writes. find_spawn_agent_model_name
(child_config.rs:318) takes any model of the catalog Codex loaded; the
five also appear in its error text (child_config.rs:335).
spawnAgentModels now widens the spawn_agent in each tool_search_output
in input as well as in tools (moreSpawnTools, shared by both). The added
text is unchanged and stays neutral; base_instructions are untouched.
The same output is widened the same way on each turn, so the history
Codex resends stays byte-stable.
Run:
- Real Codex 0.162.1 in a sandbox HOME/CODEX_HOME, wired by a sandbox
magpie (`magpie codex fake/m1`, gateway on 127.0.0.1:3593) to a fake
Responses upstream with 40 models that calls tool_search, then
spawn_agent with model fake/m12.
- Before: the lead's searched spawn_agent named fake/m1..m5 only.
- After: it names all 40, Codex's five then the other 35 under the
added header.
- Both times Codex accepted fake/m12 and the child's request reached
the upstream on m12.
- The same Codex pointed straight at the fake (no magpie) gave the raw
request saved as testdata/workdir/codex-0.162.1-tool-search.json
(sandbox paths replaced).
- TestSpawnAgentNamesEveryModelAfterToolSearch (/v1, CodexPath with a
magpie lead, CodexPath with a ChatGPT lead and V1) fails on the old
codex_spawn_models.go in all 3 subtests ("doesn't name fake/m6") and
passes now.
- go test ./internal/gateway -count=1 under a sandbox HOME: ok.
- gofmt -l clean; go vet ./internal/gateway on darwin, GOOS=linux -tags
nogui, GOOS=windows.
Not run: a real ChatGPT-account lead at CodexPath (covered by the stub
backend test only), the Codex App, and a V2 lead (V2 keeps spawn_agent in
tools, which v0.1.1214 already covers).
5d33f060b added the rest of the catalog to spawn_agent's description
under "More models that may be set as `model` (Codex names only five
above; magpie serves these too):". That text goes upstream with the
prompt, to OpenAI too when the lead is a ChatGPT account, and the
project keeps Codex's prompts and identity unrewritten (ban risk). The
header is now "More models that may be set as `model`:". The check that
a description already has it (spawnMore) is unchanged, so a request is
still widened once.
TestSpawnAgentNamesEveryModel now fails when the added text names
magpie, Codex or "five".
Run: TestSpawnAgentNamesEveryModel (4 subtests) and the gateway's Codex
tests pass. With the old header restored by hand, the three subtests
that add models fail ("the added text names \"magpie\""); V2 adds
nothing and passes. gofmt -l clean; go vet ./internal/gateway on
darwin, linux (-tags nogui) and windows.
Not run: the full gateway package, a real Codex lead.
Gearclickist turned on "Codex subagents on any model", but when Codex
dispatched subagents only a few models could be picked. Codex itself caps
the list: spawn_agent's description names only the first five
show_in_picker models of its catalog (codex-rs child_config.rs
MAX_SPAWN_AGENT_MODEL_OVERRIDES, multi_agents_spec.rs
spawn_agent_models_description), Codex's own ahead of magpie's. Yet it
takes any catalog model by name (find_spawn_agent_model_name). So the lead
saw none of magpie's models.
spawnAgentModels (codex_spawn_models.go) adds the rest of the catalog
Codex was handed after Codex's own list, under a line of its own, at most
200. It covers spawn_agent at the top level and in Codex's multi_agent_v1
namespace, at CodexPath (codexBackend) and at /v1/responses for Codex
(handle).
- At CodexPath the list is Codex's own listed models less those hidden on
the Agents page, then CodexListed unless Codex is held to its own.
- At /v1 it is CodexCatalog under the key's allowance.
- A lead the ChatGPT backend answers in multi-agent V2 seals its
subagents' tasks for a ChatGPT account (#619), so it is offered Codex's
own only.
Only the tool's description changes, never base_instructions. With V1 on,
it does change in requests to the ChatGPT backend too.
Not covered: the model_catalog_in_context feature (under development, off
by default) puts a five-model catalog in context, and it is not widened.
Run:
- go test ./internal/gateway ./internal/agent -count=1 under a sandbox
HOME: ok.
- TestSpawnAgentNamesEveryModel uses 40 models on a real Codex 0.162.0
request (testdata/workdir/codex-0.162.0.json). Its 4 subtests are
CodexPath, /v1, a sealed V2 lead and a V1 lead, and all pass.
- With spawnAgentModels returning body by hand: CodexPath, /v1 and V1
go red.
- With the sealed rule taken out: V2 goes red.
- go vet on darwin, GOOS=linux -tags nogui, and GOOS=windows; gofmt -l
is clean.
Not verified: a real Codex lead picking one of magpie's models past the
fifth from the longer list.