Summary
After #15607 replaced BlockTool (with onClick) with InlineTool (keybind-only) for the Task component, subagent session navigation has two issues:
1. session_child_first does not work in nested subagent sessions
Steps to reproduce:
- Start a session that spawns a subagent (task tool)
- Press
<leader>down (session_child_first) to enter the child session — works fine
- If that child session also spawns subagents, press
<leader>down again — nothing happens
Root cause:
children() in session/index.tsx (line 125-130) computes siblings, not descendants:
const children = createMemo(() => {
const parentID = session()?.parentID ?? session()?.id
return sync.data.session
.filter((x) => x.parentID === parentID || x.id === parentID)
.toSorted(...)
})
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
Environment
Summary
After #15607 replaced
BlockTool(withonClick) withInlineTool(keybind-only) for the Task component, subagent session navigation has two issues:1.
session_child_firstdoes not work in nested subagent sessionsSteps to reproduce:
<leader>down(session_child_first) to enter the child session — works fine<leader>downagain — nothing happensRoot cause:
children()insession/index.tsx(line 125-130) computes siblings, not descendants:When already inside a child session,
session()?.parentIDis set, soparentIDresolves to the grandparent.children()then returns the current session's siblings, not its children.moveFirstChild()searches these siblings for one withparentIDset — which finds a sibling, not a deeper child.2. No way to navigate to a specific subagent when multiple tasks are concurrent
Previously, each
BlockToolTask had anonClickhandler that navigated directly to that specific subagent's session. Now the only option is:session_child_first→ jumps to the first childleft/right→ cycle through siblingsWhen 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:
onClickon Task items (re-add click-to-navigate viaBlockToolor addonClicktoInlineTool)children()/moveFirstChild()to support arbitrary nesting depthsession_child_firstis pressed and multiple children existEnvironment
packages/opencode/src/cli/cmd/tui/routes/session/index.tsx