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

@@ -8,6 +8,7 @@
### Fixed
- Fixed GitHub Copilot Claude test coverage to use the current Claude Sonnet 4.6 model ID.
- Fixed OpenAI Responses requests for models that support disabling reasoning to send `reasoning.effort: "none"` when thinking is off.
## [0.74.0] - 2026-05-07

View File

@@ -143,7 +143,7 @@ describe("Context overflow error handling", () => {
it.skipIf(!githubCopilotToken)(
"claude-sonnet-4 - should detect overflow via isContextOverflow",
async () => {
const model = getModel("github-copilot", "claude-sonnet-4");
const model = getModel("github-copilot", "claude-sonnet-4.6");
const result = await testContextOverflow(model, githubCopilotToken!);
logResult(result);

View File

@@ -669,7 +669,7 @@ describe("AI Providers Empty Message Tests", () => {
"claude-sonnet-4 - should handle empty content array",
{ retry: 3, timeout: 30000 },
async () => {
const llm = getModel("github-copilot", "claude-sonnet-4");
const llm = getModel("github-copilot", "claude-sonnet-4.6");
await testEmptyMessage(llm, { apiKey: githubCopilotToken });
},
);
@@ -678,7 +678,7 @@ describe("AI Providers Empty Message Tests", () => {
"claude-sonnet-4 - should handle empty string content",
{ retry: 3, timeout: 30000 },
async () => {
const llm = getModel("github-copilot", "claude-sonnet-4");
const llm = getModel("github-copilot", "claude-sonnet-4.6");
await testEmptyStringMessage(llm, { apiKey: githubCopilotToken });
},
);
@@ -687,7 +687,7 @@ describe("AI Providers Empty Message Tests", () => {
"claude-sonnet-4 - should handle whitespace-only content",
{ retry: 3, timeout: 30000 },
async () => {
const llm = getModel("github-copilot", "claude-sonnet-4");
const llm = getModel("github-copilot", "claude-sonnet-4.6");
await testWhitespaceOnlyMessage(llm, { apiKey: githubCopilotToken });
},
);
@@ -696,7 +696,7 @@ describe("AI Providers Empty Message Tests", () => {
"claude-sonnet-4 - should handle empty assistant message in conversation",
{ retry: 3, timeout: 30000 },
async () => {
const llm = getModel("github-copilot", "claude-sonnet-4");
const llm = getModel("github-copilot", "claude-sonnet-4.6");
await testEmptyAssistantMessage(llm, { apiKey: githubCopilotToken });
},
);

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,

View File

@@ -464,7 +464,7 @@ describe("Tool Results with Images", () => {
"claude-sonnet-4 - should handle tool result with only image",
{ retry: 3, timeout: 30000 },
async () => {
const llm = getModel("github-copilot", "claude-sonnet-4");
const llm = getModel("github-copilot", "claude-sonnet-4.6");
await handleToolWithImageResult(llm, { apiKey: githubCopilotToken });
},
);
@@ -473,7 +473,7 @@ describe("Tool Results with Images", () => {
"claude-sonnet-4 - should handle tool result with text and image",
{ retry: 3, timeout: 30000 },
async () => {
const llm = getModel("github-copilot", "claude-sonnet-4");
const llm = getModel("github-copilot", "claude-sonnet-4.6");
await handleToolWithTextAndImageResult(llm, { apiKey: githubCopilotToken });
},
);

View File

@@ -106,7 +106,7 @@ describe("responseId E2E Tests", () => {
"Anthropic path should expose responseId",
{ retry: 3, timeout: 30000 },
async () => {
const llm = getModel("github-copilot", "claude-sonnet-4");
const llm = getModel("github-copilot", "claude-sonnet-4.6");
await expectResponseId(llm, { apiKey: githubCopilotToken });
},
);

View File

@@ -1245,7 +1245,7 @@ describe("Generate E2E Tests", () => {
});
describe("GitHub Copilot Provider (claude-sonnet-4 via Anthropic Messages)", () => {
const llm = getModel("github-copilot", "claude-sonnet-4");
const llm = getModel("github-copilot", "claude-sonnet-4.6");
it.skipIf(!githubCopilotToken)("should complete basic text generation", { retry: 3 }, async () => {
await basicTextGeneration(llm, { apiKey: githubCopilotToken });

View File

@@ -301,7 +301,7 @@ describe("Token Statistics on Abort", () => {
"claude-sonnet-4 - should include token stats when aborted mid-stream",
{ retry: 3, timeout: 30000 },
async () => {
const llm = getModel("github-copilot", "claude-sonnet-4");
const llm = getModel("github-copilot", "claude-sonnet-4.6");
await testTokensOnAbort(llm, { apiKey: githubCopilotToken });
},
);

View File

@@ -309,7 +309,7 @@ describe("Tool Call Without Result Tests", () => {
"claude-sonnet-4 - should filter out tool calls without corresponding tool results",
{ retry: 3, timeout: 30000 },
async () => {
const model = getModel("github-copilot", "claude-sonnet-4");
const model = getModel("github-copilot", "claude-sonnet-4.6");
await testToolCallWithoutResult(model, { apiKey: githubCopilotToken });
},
);

View File

@@ -726,7 +726,7 @@ describe("totalTokens field", () => {
"claude-sonnet-4 - should return totalTokens equal to sum of components",
{ retry: 3, timeout: 60000 },
async () => {
const llm = getModel("github-copilot", "claude-sonnet-4");
const llm = getModel("github-copilot", "claude-sonnet-4.6");
console.log(`\nGitHub Copilot / ${llm.id}:`);
const { first, second } = await testTotalTokensWithCache(llm, { apiKey: githubCopilotToken });

View File

@@ -13,8 +13,8 @@ function anthropicNormalizeToolCallId(
function makeCopilotClaudeModel(): Model<"anthropic-messages"> {
return {
id: "claude-sonnet-4",
name: "Claude Sonnet 4",
id: "claude-sonnet-4.6",
name: "Claude Sonnet 4.6",
api: "anthropic-messages",
provider: "github-copilot",
baseUrl: "https://api.individual.githubcopilot.com",

View File

@@ -426,7 +426,7 @@ describe("AI Providers Unicode Surrogate Pair Tests", () => {
"claude-sonnet-4 - should handle emoji in tool results",
{ retry: 3, timeout: 30000 },
async () => {
const llm = getModel("github-copilot", "claude-sonnet-4");
const llm = getModel("github-copilot", "claude-sonnet-4.6");
await testEmojiInToolResults(llm, { apiKey: githubCopilotToken });
},
);
@@ -435,7 +435,7 @@ describe("AI Providers Unicode Surrogate Pair Tests", () => {
"claude-sonnet-4 - should handle real-world LinkedIn comment data with emoji",
{ retry: 3, timeout: 30000 },
async () => {
const llm = getModel("github-copilot", "claude-sonnet-4");
const llm = getModel("github-copilot", "claude-sonnet-4.6");
await testRealWorldLinkedInData(llm, { apiKey: githubCopilotToken });
},
);
@@ -444,7 +444,7 @@ describe("AI Providers Unicode Surrogate Pair Tests", () => {
"claude-sonnet-4 - should handle unpaired high surrogate (0xD83D) in tool results",
{ retry: 3, timeout: 30000 },
async () => {
const llm = getModel("github-copilot", "claude-sonnet-4");
const llm = getModel("github-copilot", "claude-sonnet-4.6");
await testUnpairedHighSurrogate(llm, { apiKey: githubCopilotToken });
},
);