Repository navigation
Multi-agent V2 regression: resumed root sessions cannot resume existing subagents #33002
Description
Codex version
codex-cli 0.144.3
Variant
Codex CLI with Multi-agent V2
Platform
macOS, arm64
Summary
After a root session is resumed in a new CLI process, Multi-agent V2 cannot resume or route a follow-up to a subagent created by the previous process.
The root conversation history is restored, including the recorded child identifier, but the live agent tree is not. V2 has no equivalent of the V1 resume_agent(id) operation, and followup_task cannot resolve the historical child by either its UUID or canonical task path.
This is a behavioral regression from Multi-agent V1, where a resumed root can explicitly resume a completed child by ID and continue that same child conversation.
Minimal reproduction
With Multi-agent V2 enabled:
- Start root process A.
- Spawn one child and ask it to remember a distinctive sentinel.
- Wait for the child to complete and record its UUID and canonical task path.
- Exit process A completely.
- Start process B with
codex exec resume <root-session-id>. - Ask the resumed root to continue the historical child using
followup_task.
Observed results:
- targeting the UUID returns an
agent with id ... not founderror; - targeting the canonical task path returns a
live agent path ... not founderror; - the root history resumes, but the child cannot be resumed;
- the only practical fallback is spawning a new child and losing the previous child context.
V1 control experiment
I repeated the same cross-process experiment with codex-cli 0.142.5 and Multi-agent V1:
- Process A spawned one child with
fork_context=false. - The child memorized a sentinel, returned it, and completed.
- Process A exited without closing the child.
- Process B resumed the same root session.
- The resumed root called
resume_agent(child_id), which returnedpending_init. - It then called
send_input(child_id)with a message that did not contain the sentinel. - The same child returned the sentinel from its first-turn context.
- The resumed root made zero
spawn_agentcalls.
The child rollout retained the same session ID and contained both turns, confirming actual child-session reuse rather than reconstruction by the root.
Expected behavior
Resuming a root session should preserve the ability to continue its existing subagents. Multi-agent V2 could satisfy this by either:
- rehydrating the persisted agent tree when the root resumes; or
- providing an explicit
resume_agent-style operation that accepts a persisted child thread ID and reconnects it beforesend_message/followup_task.
If persistent child resumption is intentionally unsupported in V2, this should be documented as an incompatibility and exposed through a deterministic capability/status result so orchestrators can safely fall back.
Why this matters
Long-running orchestrators commonly resume the root session across phases or process restarts. Without child resumption, they cannot continue a specialized review or implementation worker with its accumulated context, even when they persist the exact child ID. This causes avoidable context loss, repeated work, and additional token usage.
Related issues
- Multi-agent V2 regression: subagent instructions are no longer observable #32753 tracks a separate Multi-agent V2 regression in operator observability caused by encrypted inter-agent messages.
- resume_agent restores subagent history but not original model/reasoning settings #26718 concerns V1
resume_agentrestoring history without the original model/reasoning settings; it demonstrates the earlier persistent-resume surface but is not this V2 failure.
Activity
Lansongxxxx commentedon Jul 15, 2026
I have an additional Codex Desktop reproduction that narrows the trigger for this issue. It does not require exiting or restarting the app-server process.
Environment
codex-cli 0.144.2Desktop reproduction
thread/unsubscribefor the root and marks itneeds_resume.thread/resume; the request carries the current permission profile.followup_taskwith a previously valid canonical path.Observed:
The root history resumes successfully, and persisted child identifiers remain visible in reconstructed context, but the new root control plane cannot resolve the old canonical paths. Spawning a new same-named child works, but that is not child-session reuse.
In the captured timeline, only about 46 seconds elapsed between
thread/unsubscribeandthread/resume, so the normal 30-minute no-subscriber idle unload delay cannot explain it.Likely immediate trigger
Current app-server code appears to create an avoidable cold replacement:
collect_resume_override_mismatchestreats any non-nullThreadResumeParams.permissionsas a mismatch, even when the requested permission profile is semantically identical to the loaded thread's active profile.resume_running_thread, when the loaded root is idle, not running, and has no subscribers, any mismatch causes the existingCodexThreadto be shut down and removed immediately.AgentControl/AgentRegistry.The Desktop logs for this reproduction show:
This means Desktop task subscription eviction plus an equivalent permissions override can turn a routine UI navigation into the same V2 child-resume failure described here.
Additional V2 recovery gap
The V2 message path currently resolves the target before attempting lazy reload:
resolve_agent_referenceonly checks the in-memoryAgentRegistry. After the root control plane is replaced, it returnslive agent path ... not found, soensure_v2_agent_loadedis never reached even though the child rollout and storedagent_pathstill exist.Suggested acceptance criteria
agent_pathmetadata, re-register the child, and then callensure_v2_agent_loaded.thread/unsubscribe -> thread/resume(with equivalent permissions) -> followup_task(existing canonical path).This Desktop-specific path makes the issue much easier to reproduce because it can occur during ordinary task switching without an app restart.
SaravananJaichandar commentedon Jul 20, 2026
Ran into something adjacent last week. Moving subagent state out of the runtime and into an external memory store helped, since the resumed root could rehydrate from the shared store rather than depend on the CLI still knowing about children. Doing this via world-model-mcp. Not a fix for the regression but might unblock the workflow while it gets sorted.
hoganfan commentedon Jul 27, 2026
Confirmed fixed in
codex-cli 0.145.0with Multi-agent V2.The matching fix is #32837 (
Restore V2 agent identities on root thread resume, commit088239294a5f). The earliest published prerelease containing that commit is0.145.0-alpha.8;0.145.0is the first stable release containing it. The0.144.xpatch releases do not contain the fix.I repeated the original cross-process reproduction on macOS arm64 with
0.145.0:fork_turns="none", waited for it to complete, and exited.codex exec resume <root-session-id>.followup_taskusing the child canonical path.spawn_agent; the original child thread received a second turn and retained its own prior context.I also repeated the control with
fork_turns="all"; both variants succeeded. This confirms that restored child routing is independent of parent-context inheritance.Closing as fixed in
0.145.0. Thanks!