test(agents): align provider-error assertions with friendly copy (#163642)

Fix red main after #163381 changed friendly provider-error copy. Align five expectations with the existing connection and model-not-found formatting owners while preserving required-answer finalization, permanent WebSocket failure, and model-catalog lifecycle assertions. No production changes.

Proof: provider-error 19/19 and model-dispatch 3/3 on Node 24.21.0 and Bun 1.4.3; changed-file checks and git diff --check passed; P2 autoreview scoped-clean; exact-head ClawSweeper found no actionable defects.
This commit is contained in:
Peter Steinberger 2026-10-02 10:04:05 -07:00 • committed by GitHub
parent a324281c67
commit f8015dfe3f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 4 deletions

View file

@ -45,7 +45,7 @@ describe("prepared provider errors after settled tools", () => {
expect(request.payloadsWithToolMedia).toEqual([
expect.objectContaining({
isError: true,
text: expect.stringContaining("connection refused"),
text: expect.stringContaining("Couldn't connect to the AI service."),
}),
]);
expect(resolveSettledTurnFinalizationRequest(request)).toContain(
@ -154,7 +154,9 @@ describe("prepared provider errors after settled tools", () => {
expect.objectContaining({
isError: true,
text: expect.stringContaining(
failure === "provider refusal" ? "refused this request" : "connection refused",
failure === "provider refusal"
? "refused this request"
: "Couldn't connect to the AI service.",
),
}),
]);

View file

@ -474,7 +474,7 @@ it("models.list retains executable rows on failed refresh and replaces them afte
});
await expect(fixture.send("account-a-only", "withdrawn-after-restart")).resolves.toMatchObject({
status: "error",
error: expect.stringContaining("The selected model is unavailable from the provider"),
error: expect.stringContaining("This model was not found."),
});
expect(fixture.requests).toHaveLength(3);
});
@ -500,7 +500,7 @@ it("models.authRefresh revokes old executable rows before discovery and config.p
);
await expect(fixture.send("account-a-only", "during-replacement")).resolves.toMatchObject({
status: "error",
error: expect.stringContaining("The selected model is unavailable from the provider"),
error: expect.stringContaining("This model was not found."),
});
expect(fixture.requests).toHaveLength(1);
} finally {