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
bug(tui): subagent navigation broken for nested sessions and imprecise for multiple concurrent tasks #15972
When already inside a child session, session()?.parentID is set, so parentID resolves to the grandparent. children() then returns the current session's siblings, not its children. moveFirstChild() searches these siblings for one with parentID set — which finds a sibling, not a deeper child.
2. No way to navigate to a specific subagent when multiple tasks are concurrent
Previously, each BlockTool Task had an onClick handler that navigated directly to that specific subagent's session. Now the only option is:
session_child_first → jumps to the first child
left/right → cycle through siblings
When an agent spawns 3+ concurrent subagent tasks, there's no way to directly enter a specific one. You have to cycle blindly, which is significantly worse UX than the previous click-to-enter behavior.
Suggestion
Consider one or more of:
Restore onClick on Task items (re-add click-to-navigate via BlockTool or add onClick to InlineTool)
Fix children() / moveFirstChild() to support arbitrary nesting depth
Add a picker UI (e.g., a dialog listing child sessions) when session_child_first is pressed and multiple children exist
If these don't fully cover your report (particularly the nested subagent children() logic bug), please clarify what's new so maintainers can decide whether to keep this open or consolidate.
Thanks for flagging the potential duplicates. After reviewing them:
Re #15769 — covers the same click-to-navigate regression (Bug 2 in this issue). Our fix restores BlockTool with onClick directly on the Task component, rather than making the hint text clickable (which is the approach in PR #15770). Both address the same root cause from 90270c615.
Re #10444 — related but distinct. That issue covers session_child_cycle / session_child_cycle_reverse not working at all (terminal key parsing + guard logic). Our Bug 1 is specifically about session_child_first / moveFirstChild() not drilling into nested subagents because children() computes siblings rather than the current session's own children. The fix adds a separate subagents memo scoped to direct children of the viewed session, leaving children() untouched.
So this issue covers ground that partially overlaps with #15769 (Bug 2) but also includes the nested navigation logic bug (Bug 1) which is not reported there. Happy to consolidate if maintainers prefer.
Confirming this bug — regression from PR #14814 in v1.2.16
I can confirm this issue. I've been using OpenCode daily and this is a clear regression introduced in v1.2.16. Navigation with Ctrl+X + Down Arrow into nested sub-agents (sub-sub-agents / grandchildren) is completely broken — it only traverses one level deep.
What changed
In v1.2.15, the old keybindings (Ctrl+X Left/Right) cycled through all agents flatly — the main agent and every sub-agent regardless of nesting depth. This worked correctly for multi-level sub-agent trees.
In v1.2.16, PR #14814 ("Change keybindings to navigate between child sessions" by @jlongster) introduced a new hierarchical navigation model:
Ctrl+X Down → enter the child session level
Left/Right → cycle between sibling sub-agents
Up → go back to the parent
While the hierarchical approach is a great UX improvement in concept, the implementation only works for the first level of children. When a sub-agent spawns another sub-agent (which is common with tools like Task/background_task), pressing Down again from a child session does nothing — the grandchild sessions are unreachable.
Steps to reproduce
Install OpenCode v1.2.16
Give the agent a task complex enough that it spawns a sub-agent via Task, and that sub-agent also spawns its own sub-agent (2+ levels deep)
Press Ctrl+X Down to navigate into the first-level sub-agent ✅ works
Press Ctrl+X Down again to navigate into the second-level sub-agent ❌ nothing happens
Expected behavior
Ctrl+X Down should recursively navigate deeper into the sub-agent hierarchy, allowing access to any nesting depth. The Up key should then walk back up through each parent level.
Environment
OpenCode version: v1.2.16
OS: Ubuntu 24.04 (Linux x64)
Previous version: v1.2.15 (worked correctly with the old flat navigation)
The behavior changed once again in the release 1.2.20!
Now the subagents sessions are clicable, so we could click no navigate, and in the inner session we could click again, and/or press up to back to upper levels.
Still reproducing on my side with nested subagent navigation:
enter first child with Ctrl+X, Down
from there, create another child
Ctrl+X, Down no longer descends into the sub-subagent
The bug came from computing child navigation relative to the wrong session level
once you were inside a child session, OpenCode was effectively looking at the parent level again
so Ctrl+X, Down could no longer find the current child’s own children
The fix:
computes visible child navigation from the current session id
picks the first direct child of the current session when descending
keeps sibling cycling scoped to the current depth
So after the fix:
parent -> child still works
child -> sub-child now also works
sibling navigation stays at the right level instead of mixing levels
Activity
github-actions commentedon Mar 4, 2026
This issue might be a duplicate of existing issues. Please check:
90270c615replacingBlockToolwithInlineToolremovingonClicknavigation) — covers the "no way to navigate to a specific subagent" point directlysession_child_cycle/session_child_firstkeybinds not working as expected for subagent navigationIf these don't fully cover your report (particularly the nested subagent
children()logic bug), please clarify what's new so maintainers can decide whether to keep this open or consolidate.guazi04 commentedon Mar 4, 2026
Thanks for flagging the potential duplicates. After reviewing them:
Re #15769 — covers the same click-to-navigate regression (Bug 2 in this issue). Our fix restores
BlockToolwithonClickdirectly on theTaskcomponent, rather than making the hint text clickable (which is the approach in PR #15770). Both address the same root cause from90270c615.Re #10444 — related but distinct. That issue covers
session_child_cycle/session_child_cycle_reversenot working at all (terminal key parsing + guard logic). Our Bug 1 is specifically aboutsession_child_first/moveFirstChild()not drilling into nested subagents becausechildren()computes siblings rather than the current session's own children. The fix adds a separatesubagentsmemo scoped to direct children of the viewed session, leavingchildren()untouched.So this issue covers ground that partially overlaps with #15769 (Bug 2) but also includes the nested navigation logic bug (Bug 1) which is not reported there. Happy to consolidate if maintainers prefer.
diegonix commentedon Mar 4, 2026
Confirming this bug — regression from PR #14814 in v1.2.16
I can confirm this issue. I've been using OpenCode daily and this is a clear regression introduced in v1.2.16. Navigation with Ctrl+X + Down Arrow into nested sub-agents (sub-sub-agents / grandchildren) is completely broken — it only traverses one level deep.
What changed
In v1.2.15, the old keybindings (Ctrl+X Left/Right) cycled through all agents flatly — the main agent and every sub-agent regardless of nesting depth. This worked correctly for multi-level sub-agent trees.
In v1.2.16, PR #14814 ("Change keybindings to navigate between child sessions" by @jlongster) introduced a new hierarchical navigation model:
Ctrl+X Down → enter the child session level
Left/Right → cycle between sibling sub-agents
Up → go back to the parent
While the hierarchical approach is a great UX improvement in concept, the implementation only works for the first level of children. When a sub-agent spawns another sub-agent (which is common with tools like Task/background_task), pressing Down again from a child session does nothing — the grandchild sessions are unreachable.
Steps to reproduce
Install OpenCode v1.2.16
Give the agent a task complex enough that it spawns a sub-agent via Task, and that sub-agent also spawns its own sub-agent (2+ levels deep)
Press Ctrl+X Down to navigate into the first-level sub-agent ✅ works
Press Ctrl+X Down again to navigate into the second-level sub-agent ❌ nothing happens
Expected behavior
Ctrl+X Down should recursively navigate deeper into the sub-agent hierarchy, allowing access to any nesting depth. The Up key should then walk back up through each parent level.
Environment
OpenCode version: v1.2.16
OS: Ubuntu 24.04 (Linux x64)
Previous version: v1.2.15 (worked correctly with the old flat navigation)
diegonix commentedon Mar 6, 2026
The behavior changed once again in the release 1.2.20!
Now the subagents sessions are clicable, so we could click no navigate, and in the inner session we could click again, and/or press up to back to upper levels.
doer-ee commentedon Apr 19, 2026
Still reproducing on my side with nested subagent navigation:
The bug came from computing child navigation relative to the wrong session level
once you were inside a child session, OpenCode was effectively looking at the parent level again
so Ctrl+X, Down could no longer find the current child’s own children
The fix:
computes visible child navigation from the current session id
picks the first direct child of the current session when descending
keeps sibling cycling scoped to the current depth
So after the fix:
parent -> child still works
child -> sub-child now also works
sibling navigation stays at the right level instead of mixing levels
I opened a fix here:
#23365
github-actions commentedon Jul 5, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.