`TestPostChats` started a full coderd and AI Bridge daemon for each of
its 34 subtests. This PR adds a `Rejects` table on one shared server and
moves the 9 model and organization rejection subtests into it: the
non-default org model cases, disabled, provider-disabled and denied
model configs, `NilOrganizationID`, and `NonMemberOrganization`. Each
case creates its own state in `prepare` and returns the caller.
Four rejection subtests keep their own servers because they need or
change state that the cases share: `MissingDefaultModelConfig` needs a
default org with no model, `ProviderDisabledDefaultModelRejected`
disables the default model's provider,
`DeniedSameOrganizationDefaultIsRejected` adds a second default model to
the org, and `AgentsAccessDefaultRole` rewrites org roles.
### Why it is safe
- Cases keep the old subtest names, callers, status, and message checks,
and now also check the exact `Detail` (empty where the old subtests did
not check it).
- I mutated 11 lines in `postChats` and its model helpers and ran the
old and new test files against each one. The old file caught 8 and the
new file catches the same 8, each in the case that owns it. The 3
mutants that both survive return the same response through another
check: dbauthz hides other-org configs from members, and the provider
status check repeats the provider-enabled check.
### Review focus
Cases run in parallel against one deployment. Each case writes only to
its own new orgs, users, providers, or non-default configs. No case
changes the default model, its provider, or member roles.
### Timing
From 5 alternating runs, the moved subtests took 3.12 s summed (median);
the table setup plus its 9 cases take 0.59 s.
### Validation
- `go test ./coderd -run '^TestPostChats$' -count=3`: pass
- the same run with `-race`: pass
- `go test -overlay` mutant runs against the old and new test files:
results above
- `go vet ./coderd` and `golangci-lint run ./coderd/...`: clean; the
pre-commit hook passed
### Stack
The stack runs every isolated `TestPostChats` rejection case on one
shared server instead of one server per case.
1. #30975 Model and organization rejection cases (this PR)
2. #30976 Workspace, request input, and MCP server rejection cases
> Xum, an AI agent, opened this PR for @ibetitsmike and wrote this
description.