fix(ai): update copilot claude test model
This commit is contained in:
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
### Fixed
|
### 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.
|
- 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
|
## [0.74.0] - 2026-05-07
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ describe("Context overflow error handling", () => {
|
|||||||
it.skipIf(!githubCopilotToken)(
|
it.skipIf(!githubCopilotToken)(
|
||||||
"claude-sonnet-4 - should detect overflow via isContextOverflow",
|
"claude-sonnet-4 - should detect overflow via isContextOverflow",
|
||||||
async () => {
|
async () => {
|
||||||
const model = getModel("github-copilot", "claude-sonnet-4");
|
const model = getModel("github-copilot", "claude-sonnet-4.6");
|
||||||
const result = await testContextOverflow(model, githubCopilotToken!);
|
const result = await testContextOverflow(model, githubCopilotToken!);
|
||||||
logResult(result);
|
logResult(result);
|
||||||
|
|
||||||
|
|||||||
@@ -669,7 +669,7 @@ describe("AI Providers Empty Message Tests", () => {
|
|||||||
"claude-sonnet-4 - should handle empty content array",
|
"claude-sonnet-4 - should handle empty content array",
|
||||||
{ retry: 3, timeout: 30000 },
|
{ retry: 3, timeout: 30000 },
|
||||||
async () => {
|
async () => {
|
||||||
const llm = getModel("github-copilot", "claude-sonnet-4");
|
const llm = getModel("github-copilot", "claude-sonnet-4.6");
|
||||||
await testEmptyMessage(llm, { apiKey: githubCopilotToken });
|
await testEmptyMessage(llm, { apiKey: githubCopilotToken });
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@@ -678,7 +678,7 @@ describe("AI Providers Empty Message Tests", () => {
|
|||||||
"claude-sonnet-4 - should handle empty string content",
|
"claude-sonnet-4 - should handle empty string content",
|
||||||
{ retry: 3, timeout: 30000 },
|
{ retry: 3, timeout: 30000 },
|
||||||
async () => {
|
async () => {
|
||||||
const llm = getModel("github-copilot", "claude-sonnet-4");
|
const llm = getModel("github-copilot", "claude-sonnet-4.6");
|
||||||
await testEmptyStringMessage(llm, { apiKey: githubCopilotToken });
|
await testEmptyStringMessage(llm, { apiKey: githubCopilotToken });
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@@ -687,7 +687,7 @@ describe("AI Providers Empty Message Tests", () => {
|
|||||||
"claude-sonnet-4 - should handle whitespace-only content",
|
"claude-sonnet-4 - should handle whitespace-only content",
|
||||||
{ retry: 3, timeout: 30000 },
|
{ retry: 3, timeout: 30000 },
|
||||||
async () => {
|
async () => {
|
||||||
const llm = getModel("github-copilot", "claude-sonnet-4");
|
const llm = getModel("github-copilot", "claude-sonnet-4.6");
|
||||||
await testWhitespaceOnlyMessage(llm, { apiKey: githubCopilotToken });
|
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",
|
"claude-sonnet-4 - should handle empty assistant message in conversation",
|
||||||
{ retry: 3, timeout: 30000 },
|
{ retry: 3, timeout: 30000 },
|
||||||
async () => {
|
async () => {
|
||||||
const llm = getModel("github-copilot", "claude-sonnet-4");
|
const llm = getModel("github-copilot", "claude-sonnet-4.6");
|
||||||
await testEmptyAssistantMessage(llm, { apiKey: githubCopilotToken });
|
await testEmptyAssistantMessage(llm, { apiKey: githubCopilotToken });
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { describe, expect, it, vi } from "vitest";
|
import { describe, expect, it, vi } from "vitest";
|
||||||
import { getModel } from "../src/models.js";
|
import { getModel } from "../src/models.js";
|
||||||
|
import { streamAnthropic } from "../src/providers/anthropic.js";
|
||||||
import type { Context } from "../src/types.js";
|
import type { Context } from "../src/types.js";
|
||||||
|
|
||||||
const mockState = vi.hoisted(() => ({
|
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 () => {
|
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");
|
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" });
|
const s = streamAnthropic(model, context, { apiKey: "tid_copilot_session_test_token" });
|
||||||
for await (const event of s) {
|
for await (const event of s) {
|
||||||
if (event.type === "error") break;
|
if (event.type === "error") break;
|
||||||
@@ -85,15 +85,14 @@ describe("Copilot Claude via Anthropic Messages", () => {
|
|||||||
|
|
||||||
// Payload is valid Anthropic Messages format
|
// Payload is valid Anthropic Messages format
|
||||||
const params = mockState.createParams!;
|
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.stream).toBe(true);
|
||||||
expect(params.max_tokens).toBeGreaterThan(0);
|
expect(params.max_tokens).toBeGreaterThan(0);
|
||||||
expect(Array.isArray(params.messages)).toBe(true);
|
expect(Array.isArray(params.messages)).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("includes interleaved-thinking beta when reasoning is enabled", async () => {
|
it("includes interleaved-thinking beta when reasoning is enabled", async () => {
|
||||||
const model = getModel("github-copilot", "claude-sonnet-4");
|
const model = getModel("github-copilot", "claude-sonnet-4.6");
|
||||||
const { streamAnthropic } = await import("../src/providers/anthropic.js");
|
|
||||||
const s = streamAnthropic(model, context, {
|
const s = streamAnthropic(model, context, {
|
||||||
apiKey: "tid_copilot_session_test_token",
|
apiKey: "tid_copilot_session_test_token",
|
||||||
interleavedThinking: true,
|
interleavedThinking: true,
|
||||||
|
|||||||
@@ -464,7 +464,7 @@ describe("Tool Results with Images", () => {
|
|||||||
"claude-sonnet-4 - should handle tool result with only image",
|
"claude-sonnet-4 - should handle tool result with only image",
|
||||||
{ retry: 3, timeout: 30000 },
|
{ retry: 3, timeout: 30000 },
|
||||||
async () => {
|
async () => {
|
||||||
const llm = getModel("github-copilot", "claude-sonnet-4");
|
const llm = getModel("github-copilot", "claude-sonnet-4.6");
|
||||||
await handleToolWithImageResult(llm, { apiKey: githubCopilotToken });
|
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",
|
"claude-sonnet-4 - should handle tool result with text and image",
|
||||||
{ retry: 3, timeout: 30000 },
|
{ retry: 3, timeout: 30000 },
|
||||||
async () => {
|
async () => {
|
||||||
const llm = getModel("github-copilot", "claude-sonnet-4");
|
const llm = getModel("github-copilot", "claude-sonnet-4.6");
|
||||||
await handleToolWithTextAndImageResult(llm, { apiKey: githubCopilotToken });
|
await handleToolWithTextAndImageResult(llm, { apiKey: githubCopilotToken });
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ describe("responseId E2E Tests", () => {
|
|||||||
"Anthropic path should expose responseId",
|
"Anthropic path should expose responseId",
|
||||||
{ retry: 3, timeout: 30000 },
|
{ retry: 3, timeout: 30000 },
|
||||||
async () => {
|
async () => {
|
||||||
const llm = getModel("github-copilot", "claude-sonnet-4");
|
const llm = getModel("github-copilot", "claude-sonnet-4.6");
|
||||||
await expectResponseId(llm, { apiKey: githubCopilotToken });
|
await expectResponseId(llm, { apiKey: githubCopilotToken });
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1245,7 +1245,7 @@ describe("Generate E2E Tests", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe("GitHub Copilot Provider (claude-sonnet-4 via Anthropic Messages)", () => {
|
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 () => {
|
it.skipIf(!githubCopilotToken)("should complete basic text generation", { retry: 3 }, async () => {
|
||||||
await basicTextGeneration(llm, { apiKey: githubCopilotToken });
|
await basicTextGeneration(llm, { apiKey: githubCopilotToken });
|
||||||
|
|||||||
@@ -301,7 +301,7 @@ describe("Token Statistics on Abort", () => {
|
|||||||
"claude-sonnet-4 - should include token stats when aborted mid-stream",
|
"claude-sonnet-4 - should include token stats when aborted mid-stream",
|
||||||
{ retry: 3, timeout: 30000 },
|
{ retry: 3, timeout: 30000 },
|
||||||
async () => {
|
async () => {
|
||||||
const llm = getModel("github-copilot", "claude-sonnet-4");
|
const llm = getModel("github-copilot", "claude-sonnet-4.6");
|
||||||
await testTokensOnAbort(llm, { apiKey: githubCopilotToken });
|
await testTokensOnAbort(llm, { apiKey: githubCopilotToken });
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -309,7 +309,7 @@ describe("Tool Call Without Result Tests", () => {
|
|||||||
"claude-sonnet-4 - should filter out tool calls without corresponding tool results",
|
"claude-sonnet-4 - should filter out tool calls without corresponding tool results",
|
||||||
{ retry: 3, timeout: 30000 },
|
{ retry: 3, timeout: 30000 },
|
||||||
async () => {
|
async () => {
|
||||||
const model = getModel("github-copilot", "claude-sonnet-4");
|
const model = getModel("github-copilot", "claude-sonnet-4.6");
|
||||||
await testToolCallWithoutResult(model, { apiKey: githubCopilotToken });
|
await testToolCallWithoutResult(model, { apiKey: githubCopilotToken });
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -726,7 +726,7 @@ describe("totalTokens field", () => {
|
|||||||
"claude-sonnet-4 - should return totalTokens equal to sum of components",
|
"claude-sonnet-4 - should return totalTokens equal to sum of components",
|
||||||
{ retry: 3, timeout: 60000 },
|
{ retry: 3, timeout: 60000 },
|
||||||
async () => {
|
async () => {
|
||||||
const llm = getModel("github-copilot", "claude-sonnet-4");
|
const llm = getModel("github-copilot", "claude-sonnet-4.6");
|
||||||
|
|
||||||
console.log(`\nGitHub Copilot / ${llm.id}:`);
|
console.log(`\nGitHub Copilot / ${llm.id}:`);
|
||||||
const { first, second } = await testTotalTokensWithCache(llm, { apiKey: githubCopilotToken });
|
const { first, second } = await testTotalTokensWithCache(llm, { apiKey: githubCopilotToken });
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ function anthropicNormalizeToolCallId(
|
|||||||
|
|
||||||
function makeCopilotClaudeModel(): Model<"anthropic-messages"> {
|
function makeCopilotClaudeModel(): Model<"anthropic-messages"> {
|
||||||
return {
|
return {
|
||||||
id: "claude-sonnet-4",
|
id: "claude-sonnet-4.6",
|
||||||
name: "Claude Sonnet 4",
|
name: "Claude Sonnet 4.6",
|
||||||
api: "anthropic-messages",
|
api: "anthropic-messages",
|
||||||
provider: "github-copilot",
|
provider: "github-copilot",
|
||||||
baseUrl: "https://api.individual.githubcopilot.com",
|
baseUrl: "https://api.individual.githubcopilot.com",
|
||||||
|
|||||||
@@ -426,7 +426,7 @@ describe("AI Providers Unicode Surrogate Pair Tests", () => {
|
|||||||
"claude-sonnet-4 - should handle emoji in tool results",
|
"claude-sonnet-4 - should handle emoji in tool results",
|
||||||
{ retry: 3, timeout: 30000 },
|
{ retry: 3, timeout: 30000 },
|
||||||
async () => {
|
async () => {
|
||||||
const llm = getModel("github-copilot", "claude-sonnet-4");
|
const llm = getModel("github-copilot", "claude-sonnet-4.6");
|
||||||
await testEmojiInToolResults(llm, { apiKey: githubCopilotToken });
|
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",
|
"claude-sonnet-4 - should handle real-world LinkedIn comment data with emoji",
|
||||||
{ retry: 3, timeout: 30000 },
|
{ retry: 3, timeout: 30000 },
|
||||||
async () => {
|
async () => {
|
||||||
const llm = getModel("github-copilot", "claude-sonnet-4");
|
const llm = getModel("github-copilot", "claude-sonnet-4.6");
|
||||||
await testRealWorldLinkedInData(llm, { apiKey: githubCopilotToken });
|
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",
|
"claude-sonnet-4 - should handle unpaired high surrogate (0xD83D) in tool results",
|
||||||
{ retry: 3, timeout: 30000 },
|
{ retry: 3, timeout: 30000 },
|
||||||
async () => {
|
async () => {
|
||||||
const llm = getModel("github-copilot", "claude-sonnet-4");
|
const llm = getModel("github-copilot", "claude-sonnet-4.6");
|
||||||
await testUnpairedHighSurrogate(llm, { apiKey: githubCopilotToken });
|
await testUnpairedHighSurrogate(llm, { apiKey: githubCopilotToken });
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user