Session does not automatically return to parent after subagent execution
Description
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.
Screenshot and/or share link
No response
Operating System
macOS Sonoma 15.7.3
Terminal
VSCode