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
Session does not automatically return to parent after subagent execution #6491
When working with a subagent, the system correctly handles the transition to a child session (e.g., when permissions are required). However, once the child session's task is completed or permissions are granted, the focus remains in the child session.
Currently, the user has to switch back to the parent session manually every time, which creates significant friction and undermines the efficiency of using subagents.
Expected Behavior:
The session should automatically return to the parent context once the subagent's specific task or permission check is finished.
Actual Behavior:
The user stays stuck in the child session and must perform a manual switch to continue working in the parent session.
Additional Context:
This manual overhead defeats the purpose of a seamless subagent workflow. Ideally, the child session should be ephemeral or automatically yield back to the parent.
OpenCode version
1.0.218
Steps to reproduce
Start a task in the parent session.
Trigger an action that invokes a subagent (requiring a switch to a child session).
Complete the required action/permission in the child session.
Observe that the session remains in the "child" state instead of reverting.
I suspect this behavior might be a regression, but in any case, it creates a few critical issues:
Security Risks: When focus shifts to the subagent's session, the permission scope changes, potentially allowing that session to spawn nested sub-sessions.
Navigation Lock: There is no way to return to the parent session while a permission prompt is active.
Race Condition: If the user presses Esc to stop the subagent, the primary agent might try to resume or recreate the subagent faster than the user can switch back to the parent context.
Activity
github-actions commentedon Dec 31, 2025
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
rekram1-node commentedon Dec 31, 2025
Yeah thats a good point, subagent ux is being thought about more rn
diogosalazar commentedon Dec 31, 2025
I suspect this behavior might be a regression, but in any case, it creates a few critical issues:
thdxr commentedon Mar 25, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.
huornlmj commentedon May 15, 2026
Issue still present in version 1.14.50