Repository navigation
test(coderd/x/chatd): merge the computer-use child CreateChat tests - #30943
ibetitsmike wants to merge 2 commits into
Conversation
|
@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. Swish! 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. Already looking forward to the next diff. 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". |
The four
TestSpawnComputerUseAgent_*tests insubagent_test.go(CreatesChildWithChatMode,SystemPromptFormat,ChildIsListedUnderParentandRootChatIDPropagation) each built a database and a server, created a parent and a computer-use child throughServer.CreateChatwith the same options, and checked a different part of the result. This PR merges them into one test,TestCreateChat_ComputerUseChildPersistsLineage, that builds the fixture once and keeps every check. The old names suggestedspawn_agentcoverage, butspawn_agentcreates its child throughchatstate.CreateChatWithID, and its tests live insubagent_internal_test.go, which this PR does not touch.Why it is safe
GetChatByIDread, and the test still checks that a system-role message contains the prompt.go test -overlayagainst the old tests onmainand against the new test. They drop ParentChatID, RootChatID or Mode from theCreateChatinput, from the insert or from the returned chat, drop the system prompt or store it with the user role, replace the returned chat with a zero chat, force every message role to user, or blank the message content. The old tests and the new test each catch all 14.Review focus
The loop over
{"returned": child, "fetched": got}runs the same six checks on both sources, and each failure message names its source.Validation
go test ./coderd/x/chatd/ -run 'TestSpawnComputerUseAgent|TestCreateChat_ComputerUse' -count=1 -p 4 -parallel 4: passes onmain(old names) and on this PR (new name)go vet ./coderd/x/chatd/: cleangolangci-lint run --fix=false ./coderd/x/chatd/: 0 issues