FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat(tui): list active session subagents in the sidebar by iceteaSA · Pull Request #46109 · anomalyco/opencode · GitHub

feat(tui): list active session subagents in the sidebar - #46109

Open
iceteaSA wants to merge 1 commit into
anomalyco:devfrom
iceteaSA:tui-subagents-sidebar
Open

feat(tui): list active session subagents in the sidebar#46109
iceteaSA wants to merge 1 commit into
anomalyco:devfrom
iceteaSA:tui-subagents-sidebar

Conversation

iceteaSA commented Aug 29, 2026
edited
Loading

Copy link
Copy Markdown

Issue for this PR

Closes #41249. Supersedes #4865 by @franlol (open).

Type of change

  • New feature

Credit

The feature and the original implementation are @franlol's in #4865 — subagents in the sidebar, click to navigate. This is that, rebased onto dev, with one change that came out of using it: we ran an orchestration session with hundreds of subagents, and listing every one made the sidebar useless. So this lists only active subagents and dedupes by child session id, so a resumed task_id doesn't render twice. If @franlol revisits #4865, that filter is the part worth lifting. If theirs lands, I'll close this. @giovannic96 requested the same feature in #41249 after shipping it as an external plugin.

Parent navigation and the return-to-parent keybind #4865 also added are already on dev, so this is just the list.

What does this PR do?

Adds a collapsible "Subagents" section to the sidebar showing the session's active subagents; select one to open that child session. The derive helper sits in packages/core since packages/tui can't import opencode's private symbols.

Liveness comes from the child session's status, not the parent's task tool-part status. That distinction is load-bearing: a background dispatch completes the parent's tool part the instant the child spawns, so the parent part reads completed while the child runs for minutes. On my machine, of the last 300 task parts, 270 were completed and zero were running — including a subagent that was executing at the time. Filtering on the parent part yields an empty list forever and the section silently never renders. api.state.session.status(childID) is the correct signal, since idle sessions are absent from that map by design.

How did you verify your code works?

  • packages/tui: 257 pass / 0 fail — covers derive, dedup, the active filter, and the background-completed-parent-with-busy-child case that the parent-status approach got wrong
  • bun typecheck clean in packages/tui
  • Confirmed rendering in a live session with a running background subagent

Screenshots / recordings

A "Subagents" list in the sidebar, active only, collapsible like the other lists.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Related PRs Found

#4865: feat: add subagents sidebar with clickable navigation and parent keybind

#14043: feat(web): Show subagents under parent session, allow intuitive navigation between

#25712: feat(tui): show subagent cost rollup in sidebar and task history

Upstream PR anomalyco#4865 by @franlol, reimplemented against the current TUI. That PR targeted packages/opencode/src/cli/cmd/tui/routes/session/, which no longer exists.

Its navigation and parent keybind have since landed upstream independently, so this adds only the missing sidebar section. It also diverges from that PR deliberately: it lists only in-flight subagents (pending and running) rather than every historical one, because real sessions accumulate hundreds of dispatched subagents and a complete list is unusable.

Background dispatches complete the parent tool part immediately, so sidebar liveness is determined from child-session status.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Live Subagents sidebar section in the TUI

1 participant


Back | FazBrowse Home | New Git URL