From cf7f2e3dbbb514446aa66d71855e9afec4eb2ab4 Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Sun, 10 May 2026 17:47:45 +0200 Subject: [PATCH] fix(ai): update copilot claude test model --- packages/ai/CHANGELOG.md | 1 + packages/ai/test/context-overflow.test.ts | 2 +- packages/ai/test/empty.test.ts | 8 ++++---- packages/ai/test/github-copilot-anthropic.test.ts | 9 ++++----- packages/ai/test/image-tool-result.test.ts | 4 ++-- packages/ai/test/responseid.test.ts | 2 +- packages/ai/test/stream.test.ts | 2 +- packages/ai/test/tokens.test.ts | 2 +- packages/ai/test/tool-call-without-result.test.ts | 2 +- packages/ai/test/total-tokens.test.ts | 2 +- ...ransform-messages-copilot-openai-to-anthropic.test.ts | 4 ++-- packages/ai/test/unicode-surrogate.test.ts | 6 +++--- 12 files changed, 22 insertions(+), 22 deletions(-) diff --git a/packages/ai/CHANGELOG.md b/packages/ai/CHANGELOG.md index 67c402e6..2be28e9b 100644 --- a/packages/ai/CHANGELOG.md +++ b/packages/ai/CHANGELOG.md @@ -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 diff --git a/packages/ai/test/context-overflow.test.ts b/packages/ai/test/context-overflow.test.ts index 56d6620d..f84c3f47 100644 --- a/packages/ai/test/context-overflow.test.ts +++ b/packages/ai/test/context-overflow.test.ts @@ -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); diff --git a/packages/ai/test/empty.test.ts b/packages/ai/test/empty.test.ts index b14e9e55..eaf0e666 100644 --- a/packages/ai/test/empty.test.ts +++ b/packages/ai/test/empty.test.ts @@ -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 }); }, ); diff --git a/packages/ai/test/github-copilot-anthropic.test.ts b/packages/ai/test/github-copilot-anthropic.test.ts index 2fb44f23..c09de06b 100644 --- a/packages/ai/test/github-copilot-anthropic.test.ts +++ b/packages/ai/test/github-copilot-anthropic.test.ts @@ -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, diff --git a/packages/ai/test/image-tool-result.test.ts b/packages/ai/test/image-tool-result.test.ts index 0477b162..72bd0414 100644 --- a/packages/ai/test/image-tool-result.test.ts +++ b/packages/ai/test/image-tool-result.test.ts @@ -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 }); }, ); diff --git a/packages/ai/test/responseid.test.ts b/packages/ai/test/responseid.test.ts index 6181ffa3..00e6cc5d 100644 --- a/packages/ai/test/responseid.test.ts +++ b/packages/ai/test/responseid.test.ts @@ -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 }); }, ); diff --git a/packages/ai/test/stream.test.ts b/packages/ai/test/stream.test.ts index 68d2810c..21199d38 100644 --- a/packages/ai/test/stream.test.ts +++ b/packages/ai/test/stream.test.ts @@ -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 }); diff --git a/packages/ai/test/tokens.test.ts b/packages/ai/test/tokens.test.ts index a63d9321..00c2b567 100644 --- a/packages/ai/test/tokens.test.ts +++ b/packages/ai/test/tokens.test.ts @@ -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 }); }, ); diff --git a/packages/ai/test/tool-call-without-result.test.ts b/packages/ai/test/tool-call-without-result.test.ts index 3f375e47..18a21f99 100644 --- a/packages/ai/test/tool-call-without-result.test.ts +++ b/packages/ai/test/tool-call-without-result.test.ts @@ -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 }); }, ); diff --git a/packages/ai/test/total-tokens.test.ts b/packages/ai/test/total-tokens.test.ts index 3e956ff0..f634a5c3 100644 --- a/packages/ai/test/total-tokens.test.ts +++ b/packages/ai/test/total-tokens.test.ts @@ -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 }); diff --git a/packages/ai/test/transform-messages-copilot-openai-to-anthropic.test.ts b/packages/ai/test/transform-messages-copilot-openai-to-anthropic.test.ts index 111bd8d4..1db3bad6 100644 --- a/packages/ai/test/transform-messages-copilot-openai-to-anthropic.test.ts +++ b/packages/ai/test/transform-messages-copilot-openai-to-anthropic.test.ts @@ -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", diff --git a/packages/ai/test/unicode-surrogate.test.ts b/packages/ai/test/unicode-surrogate.test.ts index 75fbf19a..5b348ca5 100644 --- a/packages/ai/test/unicode-surrogate.test.ts +++ b/packages/ai/test/unicode-surrogate.test.ts @@ -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 }); }, );