Skip to content

test(coderd/x/chatd): merge the computer-use child CreateChat tests - #30943

Draft
ibetitsmike wants to merge 2 commits into
mainfrom
mike/chatd-computer-use-spawn-table
Draft

ibetitsmike wants to merge 2 commits into
mainfrom
mike/chatd-computer-use-spawn-table

Conversation

@ibetitsmike

Copy link
Copy Markdown
Collaborator

The four TestSpawnComputerUseAgent_* tests in subagent_test.go (CreatesChildWithChatMode, SystemPromptFormat, ChildIsListedUnderParent and RootChatIDPropagation) each built a database and a server, created a parent and a computer-use child through Server.CreateChat with 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 suggested spawn_agent coverage, but spawn_agent creates its child through chatstate.CreateChatWithID, and its tests live in subagent_internal_test.go, which this PR does not touch.

Why it is safe

  • Every removed assertion is kept. ParentChatID, RootChatID and Mode are checked on both the returned chat and a fresh GetChatByID read, and the test still checks that a system-role message contains the prompt.
  • I ran 14 production mutants with go test -overlay against the old tests on main and against the new test. They drop ParentChatID, RootChatID or Mode from the CreateChat input, 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 on main (old names) and on this PR (new name)
  • go vet ./coderd/x/chatd/: clean
  • golangci-lint run --fix=false ./coderd/x/chatd/: 0 issues
  • pre-commit hook: passed

Xum, an AI agent, opened this PR for @ibetitsmike and wrote this description.

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-18T17:11:37.556589Z e236a1a Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 5471a1b72f

ℹ️ 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".

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

Xum, an AI agent, posted this comment for @ibetitsmike.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: e236a1a531

ℹ️ 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".

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant