You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
V2: subagent: no session resume / no session_id exposed #36654
The subagent tool launches one-shot child sessions with a fresh context and exposes no session identifier or resume API. There is no way to continue a conversation with the same subagent across multiple turns, forcing users to re-spawn a new agent (losing prior context) for every follow-up request.
Invoke the subagent tool with any agent and a prompt (e.g. "say hola").
Observe the child session runs with fresh context and returns its final response.
Attempt to continue the conversation with the same subagent (e.g. "now say adios").
The tool provides no session_id, resume method, or message injection; a new isolated subagent must be spawned instead.
Expected Behavior
The subagent tool should expose a session_id (or similar) and a resume/inject mechanism so an existing child session can be continued, preserving context across turns.
Actual Behavior
Each subagent call is isolated and ephemeral. Parameters are limited to agent, description, prompt, and background. No session handle is returned and no resume API exists, so multi-turn interaction with the same subagent is impossible.
Additional Context
Confirmed by inspecting the available tool surface: subagent returns only the child's final response (foreground) or launch confirmation (background).
Workaround: maintain an external long-lived agent process with its own message loop to retain state across turns.
This issue might be a duplicate of existing issues. Please check:
v2: subagent: no cancellation support for background subagents #36423: Same root issue — foreground subagents don't expose a session ID, preventing resume. That issue also notes the asymmetry between foreground and background subagents and suggests the same fix (returning a session ID from foreground calls).
Reproduced on opencode2 v0.0.0-next-15834 (next channel, Darwin arm64).
One correction/clarification: the V2 backend does support resuming and steering child
sessions. The missing surface is the model-facing subagent tool.
Current subagent tool parameters are only:
agent
description
prompt
background
A background launch returns a child session ID, but the tool exposes no operation for reading,
messaging, steering, or resuming that child.
I validated the API workaround with a disposable child session:
GET /api/session/{sessionID} showed the expected child parentID.
GET /api/session/{sessionID}/message exposed its conversation.
After the child completed, POST /api/session/{sessionID}/prompt with {"text":"...","resume":true,"delivery":"queue"} resumed it and produced a second response.
While it was active, another prompt with delivery:"steer" was incorporated into the same
turn.
POST /api/session/{sessionID}/wait waited until the resumed child became idle.
So the backend capability already exists. The remaining issue is tool exposure/discoverability:
agents commonly conclude that follow-up is impossible unless explicitly told to inspect and use
the local API through shell.
Suggested resolution: expose child session operations directly through subagent (or another
model-facing tool), including read/message/resume/steer. At minimum, advertise the supported API
fallback to orchestrating agents.
Activity
github-actions commentedon Jul 13, 2026
This issue might be a duplicate of existing issues. Please check:
magoz commentedon Jul 19, 2026
Reproduced on
opencode2 v0.0.0-next-15834(next channel, Darwin arm64).One correction/clarification: the V2 backend does support resuming and steering child
sessions. The missing surface is the model-facing
subagenttool.Current
subagenttool parameters are only:agentdescriptionpromptbackgroundA background launch returns a child session ID, but the tool exposes no operation for reading,
messaging, steering, or resuming that child.
I validated the API workaround with a disposable child session:
GET /api/session/{sessionID}showed the expected childparentID.GET /api/session/{sessionID}/messageexposed its conversation.POST /api/session/{sessionID}/promptwith{"text":"...","resume":true,"delivery":"queue"}resumed it and produced a second response.delivery:"steer"was incorporated into the sameturn.
POST /api/session/{sessionID}/waitwaited until the resumed child became idle.So the backend capability already exists. The remaining issue is tool exposure/discoverability:
agents commonly conclude that follow-up is impossible unless explicitly told to inspect and use
the local API through
shell.Suggested resolution: expose child session operations directly through
subagent(or anothermodel-facing tool), including read/message/resume/steer. At minimum, advertise the supported API
fallback to orchestrating agents.