Fix stale model references in AI tests after model regeneration

- Update GitHub Copilot tests to use available models (claude-haiku-4.5, gemini-2.5-pro)
- Update OpenRouter tests to use available models (google/gemini-2.5-flash, deepseek/deepseek-chat)
- Fix over-broad sed that incorrectly renamed OpenAI Responses gpt-4o test
- Remove nvidia.md from repo root
- Update packages/ai/CHANGELOG.md
This commit is contained in:
Mario Zechner
2026-06-02 11:37:32 +02:00
parent 7c531d0518
commit 7c08227019
9 changed files with 369 additions and 209 deletions

View File

@@ -120,15 +120,15 @@ describe("Context overflow error handling", () => {
// =============================================================================
// GitHub Copilot (OAuth)
// Tests both OpenAI and Anthropic models via Copilot
// Tests both Google and Anthropic models via Copilot
// =============================================================================
describe("GitHub Copilot (OAuth)", () => {
// OpenAI model via Copilot
// Google model via Copilot
it.skipIf(!githubCopilotToken)(
"gpt-4o - should detect overflow via isContextOverflow",
"gemini-2.5-pro - should detect overflow via isContextOverflow",
async () => {
const model = getModel("github-copilot", "gpt-4o");
const model = getModel("github-copilot", "gemini-2.5-pro");
const result = await testContextOverflow(model, githubCopilotToken!);
logResult(result);

View File

@@ -630,37 +630,37 @@ describe("AI Providers Empty Message Tests", () => {
describe("GitHub Copilot Provider Empty Messages", () => {
it.skipIf(!githubCopilotToken)(
"gpt-4o - should handle empty content array",
"claude-haiku-4.5 - should handle empty content array",
{ retry: 3, timeout: 30000 },
async () => {
const llm = getModel("github-copilot", "gpt-4o");
const llm = getModel("github-copilot", "claude-haiku-4.5");
await testEmptyMessage(llm, { apiKey: githubCopilotToken });
},
);
it.skipIf(!githubCopilotToken)(
"gpt-4o - should handle empty string content",
"claude-haiku-4.5 - should handle empty string content",
{ retry: 3, timeout: 30000 },
async () => {
const llm = getModel("github-copilot", "gpt-4o");
const llm = getModel("github-copilot", "claude-haiku-4.5");
await testEmptyStringMessage(llm, { apiKey: githubCopilotToken });
},
);
it.skipIf(!githubCopilotToken)(
"gpt-4o - should handle whitespace-only content",
"claude-haiku-4.5 - should handle whitespace-only content",
{ retry: 3, timeout: 30000 },
async () => {
const llm = getModel("github-copilot", "gpt-4o");
const llm = getModel("github-copilot", "claude-haiku-4.5");
await testWhitespaceOnlyMessage(llm, { apiKey: githubCopilotToken });
},
);
it.skipIf(!githubCopilotToken)(
"gpt-4o - should handle empty assistant message in conversation",
"claude-haiku-4.5 - should handle empty assistant message in conversation",
{ retry: 3, timeout: 30000 },
async () => {
const llm = getModel("github-copilot", "gpt-4o");
const llm = getModel("github-copilot", "claude-haiku-4.5");
await testEmptyAssistantMessage(llm, { apiKey: githubCopilotToken });
},
);

View File

@@ -443,19 +443,19 @@ describe("Tool Results with Images", () => {
describe("GitHub Copilot Provider", () => {
it.skipIf(!githubCopilotToken)(
"gpt-4o - should handle tool result with only image",
"claude-haiku-4.5 - should handle tool result with only image",
{ retry: 3, timeout: 30000 },
async () => {
const llm = getModel("github-copilot", "gpt-4o");
const llm = getModel("github-copilot", "claude-haiku-4.5");
await handleToolWithImageResult(llm, { apiKey: githubCopilotToken });
},
);
it.skipIf(!githubCopilotToken)(
"gpt-4o - should handle tool result with text and image",
"claude-haiku-4.5 - should handle tool result with text and image",
{ retry: 3, timeout: 30000 },
async () => {
const llm = getModel("github-copilot", "gpt-4o");
const llm = getModel("github-copilot", "claude-haiku-4.5");
await handleToolWithTextAndImageResult(llm, { apiKey: githubCopilotToken });
},
);

View File

@@ -295,10 +295,10 @@ describe("Token Statistics on Abort", () => {
describe("GitHub Copilot Provider", () => {
it.skipIf(!githubCopilotToken)(
"gpt-4o - should include token stats when aborted mid-stream",
"claude-haiku-4.5 - should include token stats when aborted mid-stream",
{ retry: 3, timeout: 30000 },
async () => {
const llm = getModel("github-copilot", "gpt-4o");
const llm = getModel("github-copilot", "claude-haiku-4.5");
await testTokensOnAbort(llm, { apiKey: githubCopilotToken });
},
);

View File

@@ -297,10 +297,10 @@ describe("Tool Call Without Result Tests", () => {
describe("GitHub Copilot Provider", () => {
it.skipIf(!githubCopilotToken)(
"gpt-4o - should filter out tool calls without corresponding tool results",
"claude-haiku-4.5 - should filter out tool calls without corresponding tool results",
{ retry: 3, timeout: 30000 },
async () => {
const model = getModel("github-copilot", "gpt-4o");
const model = getModel("github-copilot", "claude-haiku-4.5");
await testToolCallWithoutResult(model, { apiKey: githubCopilotToken });
},
);

View File

@@ -178,18 +178,22 @@ describe("totalTokens field", () => {
});
describe.skipIf(!process.env.OPENAI_API_KEY)("OpenAI Responses", () => {
it("gpt-4o - should return totalTokens equal to sum of components", { retry: 3, timeout: 60000 }, async () => {
const llm = getModel("openai", "gpt-4o");
it(
"claude-haiku-4.5 - should return totalTokens equal to sum of components",
{ retry: 3, timeout: 60000 },
async () => {
const llm = getModel("openai", "gpt-4o");
console.log(`\nOpenAI Responses / ${llm.id}:`);
const { first, second } = await testTotalTokensWithCache(llm);
console.log(`\nOpenAI Responses / ${llm.id}:`);
const { first, second } = await testTotalTokensWithCache(llm);
logUsage("First request", first);
logUsage("Second request", second);
logUsage("First request", first);
logUsage("Second request", second);
assertTotalTokensEqualsComponents(first);
assertTotalTokensEqualsComponents(second);
});
assertTotalTokensEqualsComponents(first);
assertTotalTokensEqualsComponents(second);
},
);
});
describe.skipIf(!hasAzureOpenAICredentials())("Azure OpenAI Responses", () => {
@@ -666,10 +670,10 @@ describe("totalTokens field", () => {
);
it(
"google/gemini-2.0-flash-001 - should return totalTokens equal to sum of components",
"google/gemini-2.5-flash - should return totalTokens equal to sum of components",
{ retry: 3, timeout: 60000 },
async () => {
const llm = getModel("openrouter", "google/gemini-2.0-flash-001");
const llm = getModel("openrouter", "google/gemini-2.5-flash");
console.log(`\nOpenRouter / ${llm.id}:`);
const { first, second } = await testTotalTokensWithCache(llm, { apiKey: process.env.OPENROUTER_API_KEY });
@@ -683,10 +687,10 @@ describe("totalTokens field", () => {
);
it(
"meta-llama/llama-4-scout - should return totalTokens equal to sum of components",
"deepseek/deepseek-chat - should return totalTokens equal to sum of components",
{ retry: 3, timeout: 60000 },
async () => {
const llm = getModel("openrouter", "meta-llama/llama-4-scout");
const llm = getModel("openrouter", "deepseek/deepseek-chat");
console.log(`\nOpenRouter / ${llm.id}:`);
const { first, second } = await testTotalTokensWithCache(llm, { apiKey: process.env.OPENROUTER_API_KEY });
@@ -706,10 +710,10 @@ describe("totalTokens field", () => {
describe("GitHub Copilot (OAuth)", () => {
it.skipIf(!githubCopilotToken)(
"gpt-4o - should return totalTokens equal to sum of components",
"claude-haiku-4.5 - should return totalTokens equal to sum of components",
{ retry: 3, timeout: 60000 },
async () => {
const llm = getModel("github-copilot", "gpt-4o");
const llm = getModel("github-copilot", "claude-haiku-4.5");
console.log(`\nGitHub Copilot / ${llm.id}:`);
const { first, second } = await testTotalTokensWithCache(llm, { apiKey: githubCopilotToken });

View File

@@ -396,28 +396,28 @@ describe("AI Providers Unicode Surrogate Pair Tests", () => {
describe("GitHub Copilot Provider Unicode Handling", () => {
it.skipIf(!githubCopilotToken)(
"gpt-4o - should handle emoji in tool results",
"claude-haiku-4.5 - should handle emoji in tool results",
{ retry: 3, timeout: 30000 },
async () => {
const llm = getModel("github-copilot", "gpt-4o");
const llm = getModel("github-copilot", "claude-haiku-4.5");
await testEmojiInToolResults(llm, { apiKey: githubCopilotToken });
},
);
it.skipIf(!githubCopilotToken)(
"gpt-4o - should handle real-world LinkedIn comment data with emoji",
"claude-haiku-4.5 - should handle real-world LinkedIn comment data with emoji",
{ retry: 3, timeout: 30000 },
async () => {
const llm = getModel("github-copilot", "gpt-4o");
const llm = getModel("github-copilot", "claude-haiku-4.5");
await testRealWorldLinkedInData(llm, { apiKey: githubCopilotToken });
},
);
it.skipIf(!githubCopilotToken)(
"gpt-4o - should handle unpaired high surrogate (0xD83D) in tool results",
"claude-haiku-4.5 - should handle unpaired high surrogate (0xD83D) in tool results",
{ retry: 3, timeout: 30000 },
async () => {
const llm = getModel("github-copilot", "gpt-4o");
const llm = getModel("github-copilot", "claude-haiku-4.5");
await testUnpairedHighSurrogate(llm, { apiKey: githubCopilotToken });
},
);