Skip to content

[codex] Reject full-history spawn overrides#21404

Open
md-oai wants to merge 1 commit into
dev/friel/frodex-129-rollout-segment-referencesfrom
codex/reject-full-history-spawn-overrides
Open

[codex] Reject full-history spawn overrides#21404
md-oai wants to merge 1 commit into
dev/friel/frodex-129-rollout-segment-referencesfrom
codex/reject-full-history-spawn-overrides

Conversation

@md-oai
Copy link
Copy Markdown
Contributor

@md-oai md-oai commented May 6, 2026

Summary

This changes the MultiAgentV2 spawn_agent path to fail fast when a full-history fork (fork_turns: "all" or an omitted fork_turns) is combined with agent_type, model, or reasoning_effort overrides.

Full-history forks currently inherit the parent thread configuration. That means those child override fields are not applied in that path, which can make a session look like it requested an oracle/model override while the spawned child actually runs with the parent model. The guard turns that silent mismatch into a model-facing error and tells the caller to use fork_turns: "none" or a positive turn count when child role/model overrides need to apply.

The PR also updates the tool schema and root-agent prompt so agents get the rule before they call the tool, and it adjusts the tests that used to assert the old silent-ignore behavior.

Why this is useful

  • Prevents misleading rollout traces where a tool call appears to request one agent/model but the spawned thread records another.
  • Makes oracle/model override failures explicit and actionable instead of silently inheriting parent config.
  • Preserves full-history fork behavior for plain context cloning while steering configurable subagents to fork modes that actually apply child config.

Validation

  • cargo test -p codex-core multi_agent_v2_spawn -- --nocapture
  • cargo test -p codex-tools spawn_agent_tool_v2_requires_task_name_and_lists_visible_models -- --nocapture
  • cargo test -p codex-core root_agent_prompt_requires_explicit_fork_turns -- --nocapture
  • git diff --check

@md-oai md-oai marked this pull request as ready for review May 6, 2026 19:49
@md-oai md-oai requested a review from a team as a code owner May 6, 2026 19:49
@md-oai md-oai requested a review from friel-openai May 6, 2026 19:50
@friel-openai friel-openai requested a review from jif-oai May 6, 2026 19:51
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