Repository navigation
feat: embed every nested subagent descendant under its root chat - #99
Conversation
|
@codex review
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b888ff02a4
ℹ️ 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
|
…-8-tree-api # Conflicts: # docs/reference/api/chats.md
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ 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
|
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ 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". |
Closing and reopening only to make GitHub recompute the merge ref against current main ( |
The merge ref now points at current main ( |
Merge evidence for head
|
Part of #8 (W2 nested subagents, item 5: agent tree for depth above 1, PRD R3.5, and the depth-2 hook payload test, R3.7). The sidebar half is #104. Merge #104 first: without it, the current sidebar would list a coordinator's workers as siblings of the coordinator.
With
fork-nested-subagentson, the chat list and the single-chat GET of a root chat embed every descendant of that root, not only its direct children. With the experiment off, both responses are unchanged.Why. A subagent can spawn its own subagents behind the experiment, but
listChatsandgetChatembedGetChildChatsByParentIDs(roots), which returns direct children only. Workers of a coordinator never reach the client, so the sidebar cannot show or open them.Change.
forkEmbeddedChildChats(newcoderd/fork_chat_tree.go) runs upstream'sGetChildChatsByParentIDsonce with the experiment off. With it on, it repeats the same query level by level until a level is empty, with a seen set and a depth cap of 64 against a corrupt hierarchy. No new SQL: authorization filtering,has_unreadand the archive filter still come from the upstream query, so a descendant the caller cannot read also hides its subtree. The two handlers inexp_chats.gochange by one call each.db2sdk.ChatRowsWithChildrengroups embedded rows byroot_chat_id(falling back toparent_chat_id). A direct child's root is its parent, so depth-1 output is identical. The JSON shape does not change: a root'schildrenstays one flat list, and each entry'sparent_chat_idgives its place in the tree. Child chats still embed nothing.Chat.Childrendoc comment says this, and the generated TypeScript type and API docs follow (the docs diff is table re-padding around that one row).Validation
TestForkChatsEmbedDescendants(real Postgres in Colima) inserts a root, child and grandchild.Enabled: the list and the root GET each embed both descendants, the grandchild withparent_chat_id= child androot_chat_id= root; the child's own GET embeds nothing; after archiving the root, the root GET and thearchived:truelist still embed both.Disabled: only the child is embedded. Negative control: forcing the experiment-off path failsEnabledand keepsDisabledgreen.TestNestedSubagentHookPayload(R3.7) spawns root, child and grandchild through the real spawn path withagent-lifecycle-hooksandfork-nested-subagentson, and asserts that the grandchild'suser_prompt_submitpayload names the child as parent and the root as root.