Skip to content

bug(tui): subagent navigation broken for nested sessions and imprecise for multiple concurrent tasks #15972

@guazi04

Description

@guazi04

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:

  1. Start a session that spawns a subagent (task tool)
  2. Press <leader>down (session_child_first) to enter the child session — works fine
  3. 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:

  1. session_child_first → jumps to the first child
  2. 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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions