Repository navigation
feat(coderd/x/chatd): report stored agent types in subagent tool results - #85
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: 244a7d2927
ℹ️ 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. 👍 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 subagent tool results now report the child's stored agent type. Before this PR, a child spawned from a custom type such asreviewerread as"type":"general"inspawn_agent,wait_agent,message_agent,interrupt_agentandlist_agents.subagentTypeFromChatderives the type from the chat mode, so it cannot know the custom name. The #69 UAT found this.Change
appendForkToolswraps those five tools instoredSubagentTypeTool(fork filefork_subagent_types.go). After the upstream tool runs, the wrapper readschat_subagents.agent_typefor eachchat_idin the result, including every entry oflist_agents'agents, and replacestypewhen the stored value differs.list_agentsreads all of the chat's children in one query, the new forkdbGetChatSubagentsByParentChatID, which dbauthz authorizes through the parent chat. The single-child tools useGetChatSubagentByChatID.subagentTypeFromChatfor built-ins. So built-in children keep reportinggeneralorexplore.typeor achat_idare left alone, and so are error results and chats without achat_subagentsrow. A failed read is logged and the upstream value is kept.subagent.gois untouched.Tests
TestForkAgentDefinitionToolResultType: spawns a workspace-tierreviewerand ageneralchild.spawn_agent,interrupt_agentandwait_agentreportreviewer, andlist_agentsreportsreviewerandgeneralfor the two children.TestForkQuerier/GetChatSubagentsByParentChatID: the new query asserts read on the parent chat.go test ./coderd/x/chatd/... ./coderd/database/dbauthz/ ./coderd/database/forkdb/..., all ok on the merge with main ec6cdd6. golangci-lint found nothing in the changed files.ARCHITECTURE.mdgets a TODO for the owner to describe this.Size
About 280 changed lines: about 55 generated (sqlc and mock), about 175 implementation and query plumbing, about 50 tests and 1 doc TODO.