Repository navigation
feat: show a child chat's agent type behind fork-agent-definitions - #112
Conversation
…ses to the stories
…es-r1-7-agent-type-badge
…es-r1-7-agent-type-badge # Conflicts: # docs/reference/api/chats.md # docs/reference/api/schemas.md
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. |
|
@codex review
|
|
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
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0b06655b58
ℹ️ 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".
…es and share story fixtures
|
@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 #7
With
fork-agent-definitionson, the API now reports each child chat's agent type, and the Agents page shows it as a badge next to the child's title (brief item R1.7). Before this change, the type was only visible in the subagent tool results, so a reviewer child and a general child looked the same in the sidebar and the top bar.Change
codersdk.Chatgetsagent_type(omitempty). It is set only on child chats and only with the experiment on.GetChatSubagentTypesByChatIDs(forkdb, system-only in dbauthz) returns the type for a batch of child chats. A custom child's type is its storedchat_subagents.agent_type. A built-in child without a row gets its type from its mode, the same waysubagentTypeFromChatderives it:explore,computer_use, orgeneral.fillForkChatAgentTypes(coderd/fork_chat_agent_type.go) fills the field in the chat list andGET /api/v2/chats/{chat}, including every embedded descendant. It skips the query when the response has no child chats.fillForkWatchedChatAgentTypefills the field on a child'screatedevent inGET /api/v2/chats/watch. The Agents page adds a new child from that event alone, so without it a live spawn shows no badge until the next list fetch. Other event kinds never overwrite the cached field.ForkAgentTypeBadgeshows the type in the sidebar tree (ChatTreeNode) and the top bar (ChatTopBar). It renders nothing forgeneralor a missing type, truncates a long custom name (the full name is in itstitle), and screen readers hear "Agent type: ".docs/fork/pstack-adapter.mdmaps the field and cites the code.With the experiment off, responses have no
agent_typekey and the page shows no badges.Tests
TestForkChatAgentType(coderd), experiment on and off: list, root GET and child GET returnreviewerfor a stored custom type,generalandexplorefor children without a row, nothing on the root, and the type on acreatedwatch event.TestForkQuerier(dbauthz) covers the new system-only query.ChatTopBar/WithAgentTypeandChatsSidebar/ChildAgentTypescover the badge's look, including a hiddengeneralbadge and a truncated long name. The badge has no behavior beyond rendering, so it has no Vitest test.go test ./coderd -run 'TestForkChatAgentType|TestForkChatTree|TestWatchChats'ok,go test ./coderd/database/dbauthz -run TestForkQuerierok,go test ./coderd/database/db2sdkok, golangci-lint reports nothing in the touched files, sitetscok, and the AgentsPage sidebar Vitest files pass.UAT
Ran in Colima on a slim binary of
4f92ba3cf0with a mock provider. A member's root chat spawned a customreviewerchild, anexplorechild and ageneralchild. The chat list, the root GET and each child GET reportedreviewer,exploreandgeneral, and the root had no key. A WebSocket client on/api/v2/chats/watchreceived each child'screatedevent with the same types. With the experiment off on the same database, no response and no newcreatedevent had the key. An earlier UAT run caught that built-in children had no type at all, which led to the mode fallback.Size
About 420 changed lines: about 130 implementation, about 185 tests and stories, 2 doc lines, and about 100 generated lines (forkdb, mocks, metrics, API docs, Swagger and TypeScript types).