Skip to content

test(coderd/x/chatd): remove end-to-end root and child tool list tests - #30992

Draft
ibetitsmike wants to merge 3 commits into
mike/chatd-remove-advisor-gating-e2efrom
mike/chatd-remove-tool-split-e2e
Draft

ibetitsmike wants to merge 3 commits into
mike/chatd-remove-advisor-gating-e2efrom
mike/chatd-remove-tool-split-e2e

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Oct 18, 2026 •

Copy link
Copy Markdown
Collaborator

This PR deletes three end-to-end checks of model request tool lists (309 lines); the rows from #30990 check the same lists on the turn environment.

  • TestSubagentChatExcludesWorkspaceProvisioningTools booted coderd with a provisioner and AI Bridge to compare root and child tool names.
  • The plan child tail of TestActiveServer_BasicAssistantGenerationAndPromptPreparation checked read_file and write_file. Its only helper, createPlanSubagentChatWithHistory, goes too.
  • TestPlanModeRootChatApprovedExternalMCPToolInvocation is the first half of TestPlanModeRootChatApprovedExternalMCPWorkflowCanReachProposePlan, with the same three checks.

Why it is safe

Each mutant of turn_environment.go below failed the deleted check and fails the remaining one:

Deleted assertion Remaining check Mutant
Root has the five workspace and five sub-agent tools Root root-only tools in no chat
Standard root has no ask_user_question or propose_plan Root either tool added there
Child has no workspace, sub-agent, or ask_user_question tools GeneralChild root-only tools or ask_user_question in children
Plan child has read_file and no write_file PlanChild each flipped
Plan root offers the approved MCP tool, ends waiting, and sends the result to the next call the workflow test, and PlanRoot approved MCP tools dropped

The split reads only ParentChatID, Mode, and PlanMode from the chat row (turn_environment.go:258-261), so a table child made with chatstate.CreateChat gets the tools of a spawn_agent child made with chatstate.CreateChatWithID. The TestSpawnAgent_* tests cover spawning. The deleted sub-agent test replied with an escaped NUL sequence but never checked the stored reply; TestNulEscapeRoundTrip/BackslashU0000Text covers that text.

Coverage: in 6 runs per head of go test ./coderd/x/chatd/... -count=1 -p 4 -covermode=set -coverpkg=./coderd/x/chatd/..., every block that all runs at #30990 reach is also reached at #30993. The other differences are blocks that some runs of the same head reach and others miss, mostly error paths that depend on timing, so one run per head can show them as lost or gained.

Timing

From 10 runs, the two deleted tests took 1.14 s summed (median per test). The basic test went from 0.51 s to 0.41 s (median of 5).

Validation

  • go test -overlay mutant runs of the whole ./coderd/x/chatd/ package before and after this PR: results above
  • go vet ./coderd/x/chatd/: clean; the pre-commit hook (gen, fmt, lint, slim build) passed

Stack

The stack moves advisor eligibility and the root versus child tool split into TestBuildTurnEnvironmentToolPolicy and deletes the end-to-end tests that only checked them, finishing #30868. It is based on #30911.

  1. test(coderd/x/chatd): cover advisor eligibility in the tool policy table #30990 Advisor and general child rows in the tool policy table
  2. test(coderd/x/chatd): remove the end-to-end advisor gating tests #30991 Remove the end-to-end advisor gating tests
  3. test(coderd/x/chatd): remove end-to-end root and child tool list tests #30992 Remove the end-to-end root and child tool list tests (this PR)
  4. test(coderd/x/chatd): fold the duplicate advisor scenarios #30993 Fold the duplicate advisor scenarios

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

TestSubagentChatExcludesWorkspaceProvisioningTools booted coderd with a
provisioner and AI Bridge to compare root and child tool names, and a
tail of the basic Anthropic prompt preparation test ran a plan child
turn to check read_file and write_file. The Root, GeneralChild and
PlanChild rows of TestBuildTurnEnvironmentToolPolicy check the same
names. Also remove the plan mode MCP invocation test
TestPlanModeRootChatApprovedExternalMCPToolInvocation: its steps and
checks are the first half of the kept propose_plan workflow test.
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

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

@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-18T19:34:50.485694Z a71016e 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. Nice work!

Reviewed commit: 2921c46721

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

Reviewed commit: a71016efe9

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