Skip to content

fix: stop pinning spawn_agent agent_type and child model - #87

Merged
sf-jin-ku merged 1 commit into
mainfrom
fix/codex-0145-spawn-agent-compat
Jul 29, 2026
Merged

fix: stop pinning spawn_agent agent_type and child model#87
sf-jin-ku merged 1 commit into
mainfrom
fix/codex-0145-spawn-agent-compat

Conversation

@sf-jin-ku

Copy link
Copy Markdown
Contributor

Summary

Codex 0.145 changed two things the built-in forwarding contracts depended on:

  • spawn_agent.agent_type is only advertised when custom agents are configured ([agents] in config.toml). The tool schema is additionalProperties: false, so the pinned agent_type: "default" is not a valid argument for a default install.
  • The child-model catalog no longer contains gpt-5.4-mini or gpt-5.4. The advertised overrides are now gpt-5.6-sol, gpt-5.6-terra, gpt-5.6-luna, gpt-5.5, gpt-5.2, and the tool description explicitly says spawned agents inherit the parent model and model should not be set without a reason.

So the review, adversarial-review, and rescue background paths pinned an unadvertised parameter plus an unavailable model, and the documented "retry once with gpt-5.4" fallback pointed at another model that no longer exists.

Root cause

The plugin duplicated host-owned routing state (agent roles, model catalog) in its skill contracts. Both are owned by the Codex CLI and move between releases. The fix removes the duplication at that boundary instead of re-pinning newer names:

  • omit agent_type — an omitted value already selects the built-in default agent, in both configurations
  • omit model — the child inherits the parent model, which is what the host recommends
  • keep reasoning_effort: "medium" so the transient forwarder stays cheap and predictable
  • drop the now-dead gpt-5.4 fallback branch

Contract tests assert doesNotMatch(/gpt-5/) on all three public skills so no Codex model name can be re-pinned there.

Evidence

CI on main-based PRs has been red since codex-cli 0.145.0 shipped (14/22 E2E failures, first seen 2026-07-27; the 2026-07-20 run on 0.144 was green). The mock provider captured the new schema:

"spawn_agent" parameters: fork_context, items, message, model, reasoning_effort, service_tier

No agent_type.

Validation

Local, with codex-cli 0.145.0:

  • npm run check — version-sync, changelog, lint, typecheck all pass
  • unit: 505 passed, 0 failed
  • integration: 41 passed, 0 failed
  • E2E: 22 passed, 0 failed (was 8 passed / 14 failed before this change)

🤖 Generated with Claude Code

Codex 0.145 only advertises `spawn_agent.agent_type` when custom agents
are configured, and its child-model catalog no longer contains
`gpt-5.4-mini`/`gpt-5.4`. The built-in review, adversarial-review, and
rescue forwarding contracts pinned both, so every background forwarding
spawn hit an unadvertised parameter and an unavailable model.

Omit `agent_type` (an omitted value already selects the built-in default
agent) and omit `model` so the child inherits the parent model, keeping
`reasoning_effort: "medium"` for a cheap transient forwarder. Contract
tests now assert the absence of any Codex model pin.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant