Files
coder/coderd
Michael Suchacz 8065f84af2 refactor(coderd/x/chatd): name the Server receiver p in turn_environment.go (#30869)
Renames the `*Server` receiver in `turn_environment.go` from `server` to
`p`. Nothing else changes: each changed line differs only in that name
(`git diff --word-diff` shows it).

#30870 moves helpers from `chatd.go` into this file. Those helpers name
the receiver `p`, as do 22 files in the package, and revive's
`receiver-naming` rule allows one receiver name per type in a file. With
this rename first, the move needs no edits.

Validation: build and vet pass, the `TestBuildTurnEnvironment*` tests
pass, and the pre-commit hook (`lint/go` with revive) passed.

## Stack

This stack splits #28757, as requested in review. It moves the code that
prepares a chat turn into one file, `turn_environment.go`, and moves the
tool policy tests from full turns to a table test. chatd behaves as on
`main`, except for the debug log in #30865.

1. #30864 Remove the no-op `allowedBehaviorToolNames` filter
2. #30865 Log workspace agent lookup errors in turn preparation
3. #30866 Rename `prepareGeneration` to `buildTurnEnvironment`
4. #30867 Cover the turn tool policy at `buildTurnEnvironment`
5. #30868 Remove seven end-to-end tool policy tests
6. #30869 Name the `*Server` receiver `p` in `turn_environment.go`
7. #30870 Move the turn preparation helpers into `turn_environment.go`

> Xum, an AI agent, opened this PR for @ibetitsmike and wrote this
description.
2026-10-16 21:58:06 +00:00
..