Uh oh!
There was an error while loading. Please reload this page.
fix(tui): fix nested subagent navigation and restore click-to-navigate on tasks - #15974
fix(tui): fix nested subagent navigation and restore click-to-navigate on tasks#15974guazi04 wants to merge 1 commit into
Conversation
The following comment was made by an LLM, it may be inaccurate: Potential Duplicate PRs Found:
Why they're related: PR #15974 fixes both nested subagent navigation (the |
…e on tasks Two regressions from anomalyco#15607 are fixed: 1. Nested subagent navigation: moveFirstChild() used the children() memo which computes siblings of the current session, not its children. Added a separate subagents memo that finds sessions whose parentID matches the current session ID, so session_child_first works at any nesting depth. 2. Click-to-navigate on tasks: Task component was switched from BlockTool to InlineTool which removed the onClick handler. Restored BlockTool with onClick when the task has a sessionId, enabling direct navigation to a specific subagent session. InlineTool is still used as fallback when no sessionId exists. The existing children() memo is preserved unchanged for permissions and questions aggregation which needs sibling-level data. Closesanomalyco#15972 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
b249e5e to
94b7888CompareThanks for updating your PR! It now meets our contributing guidelines. 👍 |
guazi04
commented
Mar 4, 2026
Regarding the flagged potential duplicates: vs PR #15770 — Both fix the click-to-navigate regression. #15770 makes the "view subagents" hint text clickable (adds hover/click to a vs PR #15820 — Both fix nested subagent navigation. #15820 rewrites Both bugs are fixed in a single file change with minimal blast radius. |
…e on tasks (anomalyco#15974) Cherry-picked from upstream PR anomalyco#15974. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
nexxeln
left a comment
There was a problem hiding this comment.
Actually there is a problem. Please keep the Task row visually inline. This change swaps Task from InlineTool to BlockTool, which changes intended UI (panel/border/hover block). Can you restore click-to-navigate while preserving the existing inline presentation (e.g. inline click target or InlineTool click support)?
nexxeln
commented
Mar 4, 2026
I'm gonna be tackling this myself, so closing this. Thank you for your contribution. |
guazi04
commented
Mar 4, 2026
Hey @nexxeln, I went ahead and addressed the feedback before seeing the close — here's the approach in case it's useful as reference: InlineTool click support (keeps inline visual, no BlockTool swap):
Task component always renders constsid=props.metadata.sessionIdreturn(<InlineToolicon="│"spinner={isRunning()}complete={props.input.description}pending="Delegating..."part={props.part}onClick={sid ? ()=>navigate({type: "session",sessionID: sid}) : undefined}>{content()}</InlineTool>)Full diff on the branch: Good luck with the fix! 🙌 |
Issue for this PR
Closes#15972
Type of change
What does this PR do?
After #15607 replaced
BlockTool(clickable) withInlineTool(keybind-only) for the Task component, two navigation regressions were introduced:Bug 1:
session_child_firstkeybind broken for nested subagentschildren()computes siblings (sessions sharing the same parent), not the current session's own children. When you're already inside a child session and press the keybind,moveFirstChild()searches siblings instead of deeper children, so it can't drill down further.Fix: Added a
subagentsmemo that filters forparentID === route.sessionID(direct children of the currently viewed session).moveFirstChild()now usessubagents()[0]instead of searchingchildren(). The originalchildren()memo is untouched — it's still used bypermissions()andquestions()for sibling-level aggregation.Bug 2: No way to navigate to a specific subagent when multiple tasks run concurrently
Previously each Task had an
onClickhandler viaBlockToolthat navigated directly to that subagent's session. After #15607, the only option issession_child_first→ first child → cycle with left/right, which is imprecise.Fix: Task component now uses
BlockToolwithonClickwhensessionIdexists (restoring click-to-navigate), falling back toInlineToolwhen nosessionIdis available. All #15607 improvements (spinner, toolcall count, keybind hints) are preserved.How did you verify your code works?
subagentsmemo correctly scopes to direct children at any depth,children()still serves sibling aggregation for permissions/questionsmoveChild()has proper empty-array guard after the original guard was removedBlockToolonClick handler matches the pattern used in the codebase before feat(tui): improve task tool display with subagent keybind hints and spinner animations #15607Screenshots / recordings
N/A — terminal TUI change, navigation behavior only.
Checklist