Forked Worker Inherits Parent User Intent and Misinterprets It as Direct Instruction (Recursive Delegation Attempt)
Open 💬 9 comments Opened Mar 4, 2026 by khaled-wsa
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
What version of Codex CLI is running?
codex-cli 0.107.0
What subscription do you have?
Pro
Which model were you using?
gpt-5.3-codex
What platform is your computer?
_No response_
What terminal emulator and version are you using (if applicable)?
_No response_
What issue are you seeing?
When spawning a worker with fork_context: true, the worker can incorrectly treat the parent thread’s last user message (addressed to orchestrator) as if it were addressed to the worker. In this case, the user told the orchestrator to “send a subagent,” and the worker then tried to do that itself, overriding its assigned implementation instructions.
What steps can reproduce the bug?
- In parent thread, user says: “send a subagent to do X.”
- Orchestrator spawns worker with fork_context: true and explicit implementation instructions.
- Observe worker behavior: it interprets the inherited user message as instruction to itself and attempts further delegation instead of implementing X.
What is the expected behavior?
- Worker should follow only the explicit task payload sent to it by the orchestrator.
- Worker should not reinterpret parent-level user intent as its own command stream.
- Worker must not attempt orchestration actions (e.g., spawning more agents) unless explicitly supported and instructed.
Additional information
Suggested fix:
- On spawn with fork_context, enforce an instruction boundary:
- Parent user messages should be treated as historical context, not active directives for worker.
- Worker should execute only orchestrator-provided task payload as authoritative.
- Add role guardrails:
- Block recursive delegation intents in worker role by default.
- Add lint/diagnostic signal:
- Warn when worker output includes orchestrator-only actions (spawn_agent, “launch subagent”, etc.).
9 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Hi, could you
/feedbackfrom such a forked worker and send me the session ID?Hi. I lost the session, but I took a screenshot from the agent thread after running
/agentand opening the thread: https://i.imgur.com/eKnvRGR.pngIn the screenshot, the first message shown is the orchestrator’s instructions to the worker agent. Shortly after, the orchestrator interrupts with another message. As you can see, the worker then attempts to launch a subagent, but it doesn’t have permission to do so, so it ends up echoing:
echo "Launching subagent not possible from shell".Yes, happened to me many times.
Here is my story:
codex agent's context fork = true feature is really misleads spawned agents.
I discussed a big epic task with the main agent, then asked it to decompose epic into tasks, then asked it to spawn agents (with context fork = true) for each task and create files for each of these tasks.
Then each spawned agent with forked context thought he is the orchestrator and each of them tried to launch new agents! 😆
Pic is related. I have restrictions on agents max depth = 1 and spawn_agent tool is not available for them, so they're tried to use bash to spawn agents 😭
<img width="325" height="475" alt="Image" src="https://github.com/user-attachments/assets/40df001a-7373-42c4-918c-4d300eefbaaf" />
I am repeatedly getting subagents that are ignoring the fork directive:
And instead inheriting the parent context and acting as the parent, resulting in agents recursively spawning agents, essentially becoming a useless proxy agent and confusing the root agent.
See thread ID:
019d11aa-2f45-7813-bd18-f217fd22e335(I've sent several feedbacks from several subagents for this thread)---
The parent agent sent this initial message (after any built in spawn directives):
Which evidently did not help anything, because the first message response back from the subagent was:
Implying that it assumed there was some other reviewer subagent (there wasn't it was supposed to be the reviewer subagent) rather than taking on the reviewer role.
When I asked the subagent who inherited the wrong intent what went wrong, I got:
---
Exactly what went wrong:
So the exact misread was:
Why that happened:
What to fix/report:
spawn_agent, the environment should make the context switch unmistakableCONTEXT SWITCH: You are now agent <id> (<role>). You are not the parent agent.A practical rule that would have prevented this:
You are the newly spawned agent, discard all assumptions about being the parent and restate your role before doing anything elseSo the bug to report is not vague “subagent confusion.” It is:
I hit what looks like the same failure mode.
In my case, the parent spawned two research subagents with
fork_context: true. The child agents did not return empty output; they inherited the parent conversation context and behaved like orchestrators instead of workers.Observed behavior:
What fixed it for me:
fork_context: falseI'm also observing the same behaviour. Had to set
fork_context: falseto be able to get anything done...I am also specifically seeing this in Codex Desktop with reviewer-style/read-only subagents.
The failure mode is not just that the child inherits extra context. The more harmful symptom is that a subagent that was supposed to stay read-only starts acting like the parent orchestrator or even slips into implementation behavior.
Typical pattern:
fork_context: trueIn practice,
fork_context: falseis the only reliable workaround I have seen so far for this class of problem.So from my perspective, the core bug is an instruction-boundary failure:
full-history fork is carrying over parent intent with too much authority, instead of treating it as background context and treating the delegated task as the only active instruction for the child.
maybe fork_context: false should be default? same problem