Skip to content

test(coderd/x/chatd): move the Anthropic guard unit test into chatsanitize - #30969

Draft
ibetitsmike wants to merge 2 commits into
mike/chatd-guard-test-own-filefrom
mike/chatsanitize-guard-test-move
Draft

ibetitsmike wants to merge 2 commits into
mike/chatd-guard-test-own-filefrom
mike/chatsanitize-guard-test-move

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Oct 18, 2026 •

Copy link
Copy Markdown
Collaborator

Renames coderd/x/chatd/anthropic_guard_test.go to coderd/x/chatd/chatsanitize/anthropic_guard_test.go and moves the ten helpers only TestAnthropicProviderToolPreRequestGuard uses from chatd_test.go into it. The test now lives in chatsanitize, the package it tests.

Why it is safe

This is a pure move. The only changed lines are the package clause (chatd_test to chatsanitize_test) and the chatsanitize import that chatd_test.go no longer needs. Git records the file as a rename (R056).

  • Every moved helper had no other caller in package chatd_test (git grep -nw per name), and none collides with a name in chatsanitize_test.
  • Purity check: the sorted -/+ diff prints only the package clause and the removed import. git diff --color-moved=plain marks all 128 moved helper lines as moved and leaves those 3 lines unmarked.
  • The same four subtests pass in ./coderd/x/chatd/chatsanitize/ as before in ./coderd/x/chatd/.

Review focus

Confirm that the helpers arrived unchanged. git diff -M --color-moved=plain shows it.

Validation

  • go test ./coderd/x/chatd/chatsanitize/... -count=1 and -run '^TestAnthropicProviderToolPreRequestGuard$' -v: pass, same 4 subtests.
  • go vet ./coderd/x/chatd/ ./coderd/x/chatd/chatsanitize/: clean.
  • Pre-commit hook: passed.

Stack

This stack moves the Anthropic guard unit test into chatsanitize, then deletes the guard escalation that can never repair a prompt.

  1. test(coderd/x/chatd): move the Anthropic guard unit test into its own file #30968 Move the Anthropic guard unit test into its own file
  2. test(coderd/x/chatd): move the Anthropic guard unit test into chatsanitize #30969 Move the Anthropic guard unit test into chatsanitize
  3. refactor(coderd/x/chatd/chatsanitize): drop Anthropic guard escalation passes #30970 Drop the Anthropic guard escalation passes

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:36:13.024036Z ddd29e3 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. 🚀

Reviewed commit: dfa7f15ffc

ℹ️ 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, requested this review for Mike.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: ddd29e3d7d

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