Repository navigation
feat(site/src): show nested subagent family capacity in the agents sidebar - #116
Conversation
…ed Mock chat fixtures
Adds GET /api/v2/chats/fork/{chat}/family behind fork-nested-subagents. For a
root chat it returns the family's live subagent count and live limit, and the
running subagents that wait for a concurrency slot.
…api' into mike/nested-subagents-11-family-ui
…debar
A running subagent that waits for a concurrency slot shows a waiting icon,
and an expanded root whose family is at its live subagent limit shows a
live N/M chip. Both read GET /api/v2/chats/fork/{chat}/family behind
fork-nested-subagents.
…-11-family-ui # Conflicts: # coderd/database/dbauthz/fork_forkdb.go # coderd/database/dbauthz/fork_forkdb_test.go # coderd/database/dbmetrics/fork_forkdb.go # coderd/database/forkdb/chat_capacity.sql.go # coderd/database/forkdb/forkdbmock/forkdbmock.go # coderd/database/forkdb/querier.go # coderd/database/forkdb/queries/chat_capacity.sql # coderd/fork_chat_family.go # coderd/x/chatd/fork_family.go # coderd/x/chatd/fork_family_internal_test.go # site/src/pages/AgentsPage/components/ChatsSidebar/ChatsSidebar.stories.tsx # site/src/pages/AgentsPage/components/ChatsSidebar/ChatsSidebar.test.tsx # site/src/pages/AgentsPage/components/ChatsSidebar/tree/ChatTreeNode.tsx
|
@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: 85b759847b
ℹ️ 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".
UI UAT on head 85b7598 (dev server built from this head, A root spawned two workers. While worker-a held the family's only concurrency slot, the API reported: Playwright (Chromium, 1400x900) against the sidebar:
After worker-a finished ( worker-b now shows the running spinner, worker-a a check, and the root has no chip. The polling refetch also fired (2 requests in 7 s). |
|
@codex review
|
|
Codex Review: Didn't find any major issues. You're on a roll. 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". |
…-11-family-ui # Conflicts: # site/src/pages/AgentsPage/components/ChatsSidebar/tree/ChatTreeNode.tsx
|
@codex review
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 967c890c14
ℹ️ 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: 9412ccb35a
ℹ️ 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: 98f97b68cb
ℹ️ 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: c3c3df99ee
ℹ️ 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
|
1 similar comment
|
@codex review
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b26b7d5013
ℹ️ 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".
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 5b: family capacity in the sidebar). This is the UI half. It reads the family capacity endpoint from #109.
With
fork-nested-subagentson, the agents sidebar tree marks two capacity states:live N/Mchip after its title. Itstitleattribute and a screen reader suffix say the family cannot spawn another subagent until enough subagents finish.Why. Before this change, a subagent that waited for a slot looked the same as one that ran, and nothing in the sidebar told the user why the next spawn or
message_agentresume failed.Change.
site/src/api/forkChatFamily.tsandapi/queries/forkChatFamily.tscallGET /api/v2/chats/fork/{chat}/family. They live in fork files soapi.tsstays unchanged. No event announces a capacity change, so the query polls every 5 seconds, backing off to 30 seconds after a failed read.ChatsSidebar/tree/ForkFamilyCapacity.tsxhasuseForkFamilyCapacityand the chip. A root row asks only while it is expanded and has a live subagent. A subagent row asks only while it isrunning. All rows of a family share one query key and only the root row polls, so a family costs one request per interval. Rows of another user's shared chats never ask, because the endpoint answers only the owner. With the experiment off, nothing asks.ChatTreeNode.tsxgains about fifteen lines: the hook call, the status icon and subtitle override, and the chip.NestedSubagentFamilyAtCapacitycovers both markers for the visual check.Validation
ChatsSidebar nested subagent capacity: a collapsed root sends no family request, and expanding it sends exactly one for the whole family. A negative control (query disabled) fails the test. TheNestedSubagentFamilyAtCapacitystory covers the markers visually.vitestonChatsSidebar/,biome checkon the touched files andtsc --noEmitpass.