new_pull
This commit is contained in:
@@ -186,4 +186,28 @@ describe("provider error body passthrough (per-tier regression)", () => {
|
||||
expect(output.errorMessage).toContain("blocked by gateway WAF");
|
||||
expect(output.errorMessage).not.toContain("Unknown: UnknownError");
|
||||
});
|
||||
|
||||
it("bedrock preserves the SDK validation message when the response body is a stream", async () => {
|
||||
bedrockMock.sendError = Object.assign(
|
||||
new Error(
|
||||
"Invocation of model ID anthropic.claude-opus-5 with on-demand throughput isn't supported. Retry with an inference profile.",
|
||||
),
|
||||
{
|
||||
name: "ValidationException",
|
||||
$metadata: { httpStatusCode: 400 },
|
||||
$response: {
|
||||
statusCode: 400,
|
||||
body: { pipe: () => undefined, _readableState: { buffer: [], length: 0 } },
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
const model = getModel("amazon-bedrock", "global.anthropic.claude-opus-5");
|
||||
const output = await drainResult(streamSimpleBedrock(model, { messages: context.messages }, {}));
|
||||
|
||||
expect(output.stopReason).toBe("error");
|
||||
expect(output.errorMessage).toContain("on-demand throughput isn't supported");
|
||||
expect(output.errorMessage).toContain("inference profile");
|
||||
expect(output.errorMessage).not.toContain("_readableState");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user