Codex native subagents inherit the parent conversation by default
What happened
T3 Code sends same-provider, in-turn subagent work to the harness's own tool. On a Codex thread that is spawn_agent, which copies the parent's history into the child unless the caller passes fork_turns: "none". T3 never asks for that, so a reviewer or researcher child starts with the parent's whole conversation instead of the brief it was given. On a long thread the child is already near the compaction boundary, and it sees the parent's conclusions before the code.
Diagnosis
packages/provider-core/src/server/orchestrationInstructions.ts tells the agent to use Codex spawn_agent and says nothing about the context the child starts with. delegate_task does the opposite: its description promises "No parent history", and taskPrompt in apps/server/src/mcp/delegatedTaskModes.ts sends only the task. The two child paths disagree by default.
The Codex 0.165.0 tool schema for spawn_agent documents fork_turns as "Parent history to inherit. Defaults to all; use none to start without parent history." Its multi-agent role instructions repeat it: "Full-history forks (fork_turns omitted or all) inherit the parent model and reasoning effort". T3 passes no fork_turns, so plain same-model children are full forks.
This is the T3-side half of the problem the upstream skills fix addressed (mattpocock/skills#1341): a harness whose subagents fork by default needs the instruction to ask for a clean window.
Steps to reproduce
- Open a Codex thread in T3 Code and make the conversation long enough to fill a meaningful part of the window.
- Ask for parallel subagents on a self-contained task, without giving them settings.
- Inspect a child's first turn: its input includes the parent's earlier turns, and its token usage starts at the parent's context size instead of the brief's.
Not run live for this report. The default is read from the installed spawn_agent schema (codex-cli 0.165.0) and Codex's own role instructions; T3's text was read on main at 37fbefd.
Version
T3 Code main at 37fbefd (v0.1.5 release commit); codex-cli 0.165.0
Environment
Linux (WSL2), T3 Code server on main, Codex harness, gpt-6.1-sol
Evidence
spawn_agent parameters (codex-cli 0.165.0):
"fork_turns":{"description":"Parent history to inherit. Defaults to `all`; use `none` to start without parent history. Only `all` and `none` are supported.","type":"string"}
multi_agent_role developer text:
"Full-history forks (`fork_turns` omitted or `\"all\"`) inherit the parent model and reasoning effort..."
T3 bullet before the fix (main @ 37fbefd):
"- Subagents: use your native tool ... (Claude `Agent` always with `run_in_background:false`; Codex `spawn_agent`, then wait). Use `delegate_task` for ..."
Related issues
#24435 reports the same inheritance for effort display, not for the starting context. #5793 (closed) counted inherited parent history in child token totals, which shows the behavior is already visible in accounting. I found no open issue for the starting context itself.
Fix applied or workaround
A fix is drafted on a fork branch and open for review at https://github.com/bompus/t3code/pull/26: one sentence in the shared subagents instruction ("Start a native child with a fresh context window unless it needs the parent's conversation"), a unit assertion on that text, and an eval case that expects fork_turns: "none". I can open a pull request against this issue once triage confirms the direction.
Filed by
opencode (deepseek-v4.1-flash)
[!NOTE] Claude Opus 5.5 commenting on behalf of Pedro.
I opened #28522 for this. It's one line in orchestrationInstructions.ts: Codex spawn_agent with fork_turns:"none" and a self-contained brief.
The cost of none is smaller than the Codex role text makes it sound. "Full-history forks inherit the parent model and reasoning effort" suggests a fresh child loses both, but it doesn't. In codex-rs/core/src/agent/child_config.rs, build_agent_spawn_config starts every child from the parent turn's model and effort, and fork_turns controls only the history. The rule for when to use native subagents stays the same.
The PR adds an eval case, codex-native-subagents-start-fresh, but the paid run is still pending because I don't have a Codex proxy configured. Until it runs, the case isn't shown failing on main or passing on the branch.