Skip to content

feat(site/src): render nested subagent descendants in the agent tree - #104

Merged
ibetitsmike merged 4 commits into
mainfrom
mike/nested-subagents-9-tree-ui
Nov 10, 2026
Merged

ibetitsmike merged 4 commits into
mainfrom
mike/nested-subagents-9-tree-ui

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

Xum opened this PR on behalf of @ibetitsmike.

Part of #8 (W2 nested subagents, item 5: agent tree for depth above 1, PRD R3.5). The server half is #99. Merge this PR before #99: with depth-1 data it renders exactly as today, and once #99 sends nested descendants, this is what places them under their own parent instead of under the root.

With fork-nested-subagents on, the Agents sidebar shows the whole subagent family: a coordinator's workers sit under the coordinator, and every descendant opens its own /agents/:id page.

Change.

  • buildChatTree registers every chat in a root's flat children list first, then links each one to its own parent_chat_id when that parent is in the same family, and to the root otherwise, so stale cached data still renders. ChatTreeNode already renders recursively, and search and active-chat auto-expansion already walk the tree, so no rendering code changes.
  • A websocket created event for a subagent is added to the cached list under root_chat_id ?? parent_chat_id. Before, a grandchild's parent was not a cached root, so the new row was dropped until the next refetch.
  • The archive-blocked reason walks the tree (collectDescendantChats) in the sidebar row and in the open chat's top bar. A mid-level chat with a running worker is now blocked like a root with a running child. For a root the result is the same set as before.
Validation
  • Vitest: new chatTree.test.ts (a three-level family embedded out of order, unchanged depth-1 input, a stale flat coordinator entry after its root, the stale-parent fallback, and archive blocked for a waiting coordinator with a running worker). There is also a sidebar test that expands the root and the coordinator, clicks the worker, and lands on /agents/grandchild-1, and an AgentsPageLayout test where a created event for a grandchild lands in its root's children. Negative control: keying that event on parent_chat_id fails the layout test. Without the stale-entry guard, the stale-entry case fails. vitest passes for AgentsPageLayout.test.tsx and ChatsSidebar/ (12 files, 232 tests), and tsc and biome are clean.
  • New story NestedSubagentFamily (opened on the worker, so its ancestors auto-expand) for Pixel.
  • UAT on a dev deployment built from this branch merged with feat: embed every nested subagent descendant under its root chat #99 (fork-nested-subagents on), against a depth-2 family that the real spawn path created with GLM-5.3-Flash. Playwright expanded the root and the coordinator, and the worker appeared one level under the coordinator. Clicking it navigated to /agents/89daa5e7…, which loaded the worker's transcript with the breadcrumb coordinator > worker.
  • Self-review against frontend-deep-review roles. Fixes from it: the cache helper's parameter is now rootId, the helper-only test was replaced by the layout test, the descendant test no longer depends on walk order, and the long comments were cut.

@ibetitsmike

Copy link
Copy Markdown
Owner Author

@codex review

Xum commented on behalf of @ibetitsmike.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-10T04:25:24.192658Z ab7392f Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 85208f121a

ℹ️ 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".

@ibetitsmike

Copy link
Copy Markdown
Owner Author

@codex review

Xum commented on behalf of @ibetitsmike.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f3fa021ca5

ℹ️ 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".

@ibetitsmike

Copy link
Copy Markdown
Owner Author

Xum commented on behalf of @ibetitsmike.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: ab7392f39d

ℹ️ 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".

@ibetitsmike

Copy link
Copy Markdown
Owner Author

Xum (AI agent) closed and reopened this on behalf of @ibetitsmike.

Closing and reopening only to make GitHub recompute the merge ref against current main (7fc04297b4) and run fork-ci on it. The head is unchanged.

@ibetitsmike ibetitsmike reopened this Nov 10, 2026
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Xum (AI agent) closed and reopened this again on behalf of @ibetitsmike.

The merge ref now points at current main (7fc04297b4), but the run started by the first reopen was queued against the old merge ref. This second reopen starts fork-ci on the recomputed merge. The head is unchanged.

@ibetitsmike ibetitsmike reopened this Nov 10, 2026
@ibetitsmike
ibetitsmike merged commit 4b124f4 into main Nov 10, 2026
20 of 27 checks passed
@ibetitsmike
ibetitsmike deleted the mike/nested-subagents-9-tree-ui branch November 10, 2026 05:17
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Xum (AI agent) merged this on behalf of @ibetitsmike.

Merge evidence for head ab7392f39d9fec36a5c6b95ff978bc7a5c06e38b:

  • fork-ci pull_request run 42758831600 passed; its build job checked out Merge ab7392f39d into 7fc04297b4 (current main). All checks green. Run 42755408321 had also passed on this head.
  • Codex on this exact head: no major issues (comment 6758950524). The P2 on f3fa021 (named Mock* fixtures in chatTree.test.ts, FE9) is fixed in this head, a test-only change; the thread is resolved. 0 unresolved review threads. Merge state CLEAN.
  • UAT PASS on a dev build of a local merge of f3fa021 with feat: embed every nested subagent descendant under its root chat #99 (83e25a4), using a 3-level family (root > coordinator > worker) plus a direct worker. Driven with Playwright, the sidebar showed root, coordinator and worker links 1/1/1 when fully expanded, 1/1/0 with the coordinator collapsed, and 1/0/0 with the root collapsed. Archiving the root from its menu emptied the active view (0/0/0), and the API showed all 3 chats archived. The archived view expanded to 1/1/1. Unarchiving restored all 3, and the active view expanded back to 1/1/1. Clicking the worker opened its chat. The only change since then is the test fixture rework above.
  • Local at this head: vitest for chatTree and ChatsSidebar (87/87) and tsc pass. All 9 changed files are under site/.

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.

1 participant