test: use default provider in TestPatchChatMessage/ChangesModel (#25189)

`TestPatchChatMessage/ChangesModel` hardcoded `"openai"` as the provider
for the override model config. After #25171, the shared chat test
harness registers a single `"openai-compat"` provider by default, so
calling `createAdditionalChatModelConfig(..., "openai", ...)` fails with
HTTP 400 `Chat provider is not configured` before the test can exercise
the model-change path. The subtest was added in #25084 after #25171 was
reviewed, so the harness change and the new hardcoded provider only met
on `main`.

Use `defaultModel.Provider` so the override always matches whatever
provider the harness registered. This mirrors every other call site of
`createAdditionalChatModelConfig` in the file.

Closes https://github.com/coder/internal/issues/1530
This commit is contained in:
Ethan
2026-05-12 14:05:08 +00:00
committed by GitHub
parent 38091f1d82
commit fabf7d31fc
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -7290,7 +7290,7 @@ func TestPatchChatMessage(t *testing.T) {
overrideModel := createAdditionalChatModelConfig(
t,
client,
"openai",
defaultModel.Provider,
"gpt-4o-mini-edit-override",
)
@@ -19,6 +19,7 @@ const getDisplayState = (message: ChatMessage) =>
message,
parsed: parseMessageContent(message.content),
hideActions: false,
hasActiveStream: false,
});
describe("deriveMessageDisplayState", () => {