test(ai): align adaptive thinking payload assertions

This commit is contained in:
Mario Zechner
2026-04-17 00:35:07 +02:00
parent b2ed851e84
commit 8404fbafdb
3 changed files with 10 additions and 6 deletions

View File

@@ -4,7 +4,7 @@ import { streamSimple } from "../src/stream.js";
import type { Context, Model, SimpleStreamOptions } from "../src/types.js";
interface AnthropicThinkingPayload {
thinking?: { type: string; budget_tokens?: number };
thinking?: { type: string; budget_tokens?: number; display?: string };
output_config?: { effort?: string };
}
@@ -128,14 +128,14 @@ describe("Anthropic thinking disable payload", () => {
it("uses adaptive thinking for Claude Opus 4.7 when reasoning is enabled", async () => {
const payload = await capturePayload(getModel("anthropic", "claude-opus-4-7"), { reasoning: "high" });
expect(payload.thinking).toEqual({ type: "adaptive" });
expect(payload.thinking).toEqual({ type: "adaptive", display: "summarized" });
expect(payload.output_config).toEqual({ effort: "high" });
});
it("maps xhigh reasoning to effort=xhigh for Claude Opus 4.7", async () => {
const payload = await capturePayload(getModel("anthropic", "claude-opus-4-7"), { reasoning: "xhigh" });
expect(payload.thinking).toEqual({ type: "adaptive" });
expect(payload.thinking).toEqual({ type: "adaptive", display: "summarized" });
expect(payload.output_config).toEqual({ effort: "xhigh" });
});
});