fix(ai): update copilot claude test model

This commit is contained in:
Mario Zechner
2026-05-10 17:47:45 +02:00
parent e25415dd5f
commit cf7f2e3dbb
12 changed files with 22 additions and 22 deletions

View File

@@ -1,5 +1,6 @@
import { describe, expect, it, vi } from "vitest";
import { getModel } from "../src/models.js";
import { streamAnthropic } from "../src/providers/anthropic.js";
import type { Context } from "../src/types.js";
const mockState = vi.hoisted(() => ({
@@ -54,10 +55,9 @@ describe("Copilot Claude via Anthropic Messages", () => {
};
it("uses Bearer auth, Copilot headers, and valid Anthropic Messages payload", async () => {
const model = getModel("github-copilot", "claude-sonnet-4");
const model = getModel("github-copilot", "claude-sonnet-4.6");
expect(model.api).toBe("anthropic-messages");
const { streamAnthropic } = await import("../src/providers/anthropic.js");
const s = streamAnthropic(model, context, { apiKey: "tid_copilot_session_test_token" });
for await (const event of s) {
if (event.type === "error") break;
@@ -85,15 +85,14 @@ describe("Copilot Claude via Anthropic Messages", () => {
// Payload is valid Anthropic Messages format
const params = mockState.createParams!;
expect(params.model).toBe("claude-sonnet-4");
expect(params.model).toBe("claude-sonnet-4.6");
expect(params.stream).toBe(true);
expect(params.max_tokens).toBeGreaterThan(0);
expect(Array.isArray(params.messages)).toBe(true);
});
it("includes interleaved-thinking beta when reasoning is enabled", async () => {
const model = getModel("github-copilot", "claude-sonnet-4");
const { streamAnthropic } = await import("../src/providers/anthropic.js");
const model = getModel("github-copilot", "claude-sonnet-4.6");
const s = streamAnthropic(model, context, {
apiKey: "tid_copilot_session_test_token",
interleavedThinking: true,