refactor(coderd/x/chatd): extract subagent manager - #28758
Open
ibetitsmike wants to merge 3 commits into
Open
Conversation
Collaborator
Author
|
@codex review |
Codex Review SummaryThis 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: Didn't find any major issues. Another round soon, please! 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". |
ibetitsmike
marked this pull request as ready for review
August 29, 2026 13:21
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extracts a SubagentManager that owns the child chat lifecycle in
coderd/x/chatd, splitting it out ofsubagent.gowhere it was interleaved with six fantasy tools defined as large inline closures onServer.Changes
subagent_manager.go: the manager owns child chat rows, pubsub watch loops, hook dispatch points, prompt hydration, report extraction, and model listing behind Spawn, Send, Await, Interrupt, and List methods.subagent.go: the six tools (task,wait_agent,message_agent,interrupt_agent,list_agents,list_subagent_models) shrink to thin adapters that map JSON arguments onto manager methods.subagent_catalog.gostays the catalog.subagent_internal_test.go: lifecycle coverage moved to direct table-driven manager tests with typed assertions, replacing Server-fixture boots and raw JSON string assertions; redundant fixture matrices deleted. An e2e smoke of the task, stream, and wait_agent report round trip is retained.Behavior
No user-visible behavior change. Spawn-time
user_prompt_submitdispatch semantics (including the sibling-results commit ordering on admission failure), nested-subagent prohibition, admission pools,wait_agenterror surfacing, report extraction, prompt hydration, and model selection are unchanged.resolveOrganizationModelOverrideand its call sites are byte-identical to main; a parallel branch owns that block.Testing
make gen(no drift),make lint,go build ./cmd/coder, andumask 022 && go test ./coderd/x/chatd/...all pass on this head; commits ran themake pre-commithook.wait_agent,message_agentsteering,interrupt_agent,list_agents,list_subagent_models, child chat page rendering, and an explicitmodel_config_idspawn honoring the requested model.