🤖 feat: sub-agent sidebar hierarchy (connector lines + completed expansion)#2836
🤖 feat: sub-agent sidebar hierarchy (connector lines + completed expansion)#2836
Conversation
Add a UI integration test covering completed child sub-agent visibility in the sidebar. The test seeds a parent workspace with active and reported child workspaces and verifies: - reported children are hidden by default - parent expansion reveals reported children - collapsing hides reported children again
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: de5100cda5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
@codex review Addressed both P1 and P2 feedback:
|
|
Codex Review: Didn't find any major issues. 🚀 ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 65d7ae1d35
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 65d7ae1d35
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
@codex review Addressed the age-tier issues and resolved the related review threads. Please take another look. |
|
Codex Review: Didn't find any major issues. Another round soon, please! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3d783b70c2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary - restore automatic cleanup for completed sub-agent workspaces instead of retaining them in the sidebar indefinitely - keep the patch-artifact safety gate so exec-style sub-agents still finish artifact generation before deletion - preserve the interrupted+reportedAt self-heal so stale completed rows can still be recognized and pruned Background PR #2836 intentionally kept completed sub-agents around for optional sidebar expansion. That was an undue UX consideration in practice: once a sub-agent had finished, or had already produced a completed report before later showing as `interrupted`, it could stick around forever unless the user manually deleted it. Sub-agents used to disappear when they were no longer in use, and this restores that behavior. Implementation - restore structural-leaf cleanup in `TaskService.cleanupReportedLeafTask()` so completed descendants are deleted again - require ancestors to have no remaining child task nodes before they can be auto-deleted, which avoids orphaning siblings while still allowing cleanup to cascade upward once the last child is gone - keep the restart/patch-artifact recheck path so exec and exec-derived tasks still generate their patch artifacts before cleanup resumes - update task-service regressions to cover immediate cleanup, cleanup-after-patch, upward cascade, and interrupted+reportedAt deletion Validation - `bun test src/node/services/taskService.test.ts` - `make static-check` Risks - Users lose the ability to browse completed sub-agent lineage from the sidebar once cleanup runs. That is the intended tradeoff here: the prior retention behavior regressed the default UX by leaving stale sub-agents around indefinitely. --- _Generated with `mux` • Model: `openai:gpt-5.4` • Thinking: `xhigh` • Cost: `$1.05`_ <!-- mux-attribution: model=openai:gpt-5.4 thinking=xhigh costs=1.05 -->
Summary
Redesigns the sidebar to visualize sub-agent parent/child hierarchy with connector lines, renames the row component from
WorkspaceListItemtoAgentListItem, retains completed sub-agents in config for optional sidebar expansion, and adds comprehensive test/story coverage.Background
The sidebar row component was named
WorkspaceListItemdespite representing agent tasks. Sub-agent relationships were invisible — completed sub-agents were auto-deleted, and there were no visual connectors showing hierarchy. This PR addresses all three gaps:Implementation
Rename (
WorkspaceListItem→AgentListItem)git mvpreserves file history; all exports/types/imports updated (9+ files)Connector metadata utilities
AgentRowRenderMetatype withconnectorPosition("single"/"middle"/"last"),rowKind, and completed-child visibility infofilterVisibleAgentRows()hides reported children unless parent is expandedcomputeAgentRowRenderMeta()computes per-row connector shapes from sibling positionsBackend: retain reported sub-agents
cleanupReportedLeafTaskno longer removes workspace metadata from config (runtime/worktree cleanup still happens)getWorkspaceSidebarKeynow includestaskStatusso status transitions trigger sidebar re-rendersConnector line rendering
SubAgentListItem.tsxwraps rows with positioned connector geometry (vertical trunk + horizontal elbow)AgentListItemdispatches toSubAgentListItemfor sub-agent rows, passes render metadataProjectSidebar integration
filterVisibleAgentRows()+computeAgentRowRenderMeta()in the render pipelineusePersistedState("expandedCompletedSubAgents")Validation
make static-checkpasses (lint, fmt, typecheck, docs link check)tests/ui/workspaces/subagents.test.ts) verifies completed children hidden by default, shown on expand, hidden on collapsetaskService.test.tsupdated — 71 tests pass with new retention behaviorworkspaceFiltering.test.ts— 6 new metadata tests passRisks
Generated with
mux• Model:anthropic:claude-opus-4-6• Thinking:xhigh• Cost:$21.58