| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…ubtask tree
When a subagent spawns its own subagents (depth > 1), permission and
question requests from those nested sessions were never displayed in
the root session's TUI. This caused nested subagents to block forever
waiting for approval that no user could see or grant.
The root cause was the children memo only collecting direct children
(depth 1), then using that list to gather permissions and questions.
Changes:
1. Add a descendants memo that performs a full BFS traversal of the
session tree to collect all descendant session IDs. Use this for
permission and question collection while keeping the existing
children memo unchanged for sibling navigation.
2. Show the full subtask tree inline in the conversation view. When a
Task tool call has nested sub-tasks, recursively render them with
indentation, status indicators, and per-session statistics (tool
count, duration, tokens, cost). Child sessions are lazily synced
as they appear in the tree.
3. Improve the permission prompt UX for nested subagents:
- Show the session description (e.g. 'in Research macOS notification
methods') instead of just the agent type
- Display tool parameters for MCP/generic tool permission requests
The web/desktop app already handles descendant traversal correctly via
sessionTreeRequest() in session-request-tree.ts — this aligns the TUI
with that behavior.
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
Sorry, something went wrong.
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
Sorry, something went wrong.
|
Any updates here or plans to include the fix? Kinda annoying issue, especially when you have a batch of run agents. P.S. I frequently face the #11865 |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Issue for this PR
Fixes #13715
Fixes #7654
Type of change
What does this PR do?
The permissions and questions memos in the TUI session view only collect from direct children via children() — any grandchild or deeper descendant is excluded. When a subagent spawns its own subagent that needs permission (e.g. bash), the prompt never appears and the session hangs forever.
The fix adds a descendants memo that does a BFS traversal to collect all descendant session IDs, matching what the web/desktop app already does via sessionTreeRequest(). Both permissions and questions now use descendants() instead of children(). The existing children() memo is unchanged since it's still needed for sibling navigation.
Additionally, the Task component now recursively renders nested subtasks inline with indentation, status indicators, and per-session stats (duration, tool count, tokens, cost) so you can see what all levels of subagents are doing without clicking into each one.
Permission prompts now show the requesting session's description (e.g. "in Research macOS notification methods") and display tool parameters for MCP/generic tools, addressing the "from parameter" suggestion in #7654.
How did you verify your code works?
Screenshots / recordings
Subtask tree rendering:
│ General Task — Research content sources ✓ Research RSS and Twitter (8s · 3 tools · 4,521 tk · $0.0234) ✓ Research Python RSS libraries (5s · 5 tools · 2,100 tk · $0.0098) ✓ Research Twitter/X API (6s · 4 tools · 1,800 tk · $0.0087) ● Research LinkedIn and Reddit ✓ Research Reddit API (4s · 3 tools · 1,230 tk · $0.0052) ● Research LinkedIn API └ 45s · 12 tools · 18,432 tk · $0.0891Checklist