mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-21 14:05:11 +00:00
fix: codex thinking handling
This commit is contained in:
parent
22870ae0c2
commit
02b72b49d5
23 changed files with 205 additions and 754 deletions
|
|
@ -145,12 +145,12 @@ describe("AI Providers Abort Tests", () => {
|
|||
|
||||
describe("OpenAI Codex Provider Abort", () => {
|
||||
it.skipIf(!openaiCodexToken)("should abort mid-stream", { retry: 3 }, async () => {
|
||||
const llm = getModel("openai-codex", "gpt-5.2-xhigh");
|
||||
const llm = getModel("openai-codex", "gpt-5.2-codex");
|
||||
await testAbortSignal(llm, { apiKey: openaiCodexToken });
|
||||
});
|
||||
|
||||
it.skipIf(!openaiCodexToken)("should handle immediate abort", { retry: 3 }, async () => {
|
||||
const llm = getModel("openai-codex", "gpt-5.2-xhigh");
|
||||
const llm = getModel("openai-codex", "gpt-5.2-codex");
|
||||
await testImmediateAbort(llm, { apiKey: openaiCodexToken });
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -271,9 +271,9 @@ describe("Context overflow error handling", () => {
|
|||
|
||||
describe("OpenAI Codex (OAuth)", () => {
|
||||
it.skipIf(!openaiCodexToken)(
|
||||
"gpt-5.2-xhigh - should detect overflow via isContextOverflow",
|
||||
"gpt-5.2-codex - should detect overflow via isContextOverflow",
|
||||
async () => {
|
||||
const model = getModel("openai-codex", "gpt-5.2-xhigh");
|
||||
const model = getModel("openai-codex", "gpt-5.2-codex");
|
||||
const result = await testContextOverflow(model, openaiCodexToken!);
|
||||
logResult(result);
|
||||
|
||||
|
|
|
|||
|
|
@ -577,37 +577,37 @@ describe("AI Providers Empty Message Tests", () => {
|
|||
|
||||
describe("OpenAI Codex Provider Empty Messages", () => {
|
||||
it.skipIf(!openaiCodexToken)(
|
||||
"gpt-5.2-xhigh - should handle empty content array",
|
||||
"gpt-5.2-codex - should handle empty content array",
|
||||
{ retry: 3, timeout: 30000 },
|
||||
async () => {
|
||||
const llm = getModel("openai-codex", "gpt-5.2-xhigh");
|
||||
const llm = getModel("openai-codex", "gpt-5.2-codex");
|
||||
await testEmptyMessage(llm, { apiKey: openaiCodexToken });
|
||||
},
|
||||
);
|
||||
|
||||
it.skipIf(!openaiCodexToken)(
|
||||
"gpt-5.2-xhigh - should handle empty string content",
|
||||
"gpt-5.2-codex - should handle empty string content",
|
||||
{ retry: 3, timeout: 30000 },
|
||||
async () => {
|
||||
const llm = getModel("openai-codex", "gpt-5.2-xhigh");
|
||||
const llm = getModel("openai-codex", "gpt-5.2-codex");
|
||||
await testEmptyStringMessage(llm, { apiKey: openaiCodexToken });
|
||||
},
|
||||
);
|
||||
|
||||
it.skipIf(!openaiCodexToken)(
|
||||
"gpt-5.2-xhigh - should handle whitespace-only content",
|
||||
"gpt-5.2-codex - should handle whitespace-only content",
|
||||
{ retry: 3, timeout: 30000 },
|
||||
async () => {
|
||||
const llm = getModel("openai-codex", "gpt-5.2-xhigh");
|
||||
const llm = getModel("openai-codex", "gpt-5.2-codex");
|
||||
await testWhitespaceOnlyMessage(llm, { apiKey: openaiCodexToken });
|
||||
},
|
||||
);
|
||||
|
||||
it.skipIf(!openaiCodexToken)(
|
||||
"gpt-5.2-xhigh - should handle empty assistant message in conversation",
|
||||
"gpt-5.2-codex - should handle empty assistant message in conversation",
|
||||
{ retry: 3, timeout: 30000 },
|
||||
async () => {
|
||||
const llm = getModel("openai-codex", "gpt-5.2-xhigh");
|
||||
const llm = getModel("openai-codex", "gpt-5.2-codex");
|
||||
await testEmptyAssistantMessage(llm, { apiKey: openaiCodexToken });
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -398,19 +398,19 @@ describe("Tool Results with Images", () => {
|
|||
|
||||
describe("OpenAI Codex Provider", () => {
|
||||
it.skipIf(!openaiCodexToken)(
|
||||
"gpt-5.2-xhigh - should handle tool result with only image",
|
||||
"gpt-5.2-codex - should handle tool result with only image",
|
||||
{ retry: 3, timeout: 30000 },
|
||||
async () => {
|
||||
const llm = getModel("openai-codex", "gpt-5.2-xhigh");
|
||||
const llm = getModel("openai-codex", "gpt-5.2-codex");
|
||||
await handleToolWithImageResult(llm, { apiKey: openaiCodexToken });
|
||||
},
|
||||
);
|
||||
|
||||
it.skipIf(!openaiCodexToken)(
|
||||
"gpt-5.2-xhigh - should handle tool result with text and image",
|
||||
"gpt-5.2-codex - should handle tool result with text and image",
|
||||
{ retry: 3, timeout: 30000 },
|
||||
async () => {
|
||||
const llm = getModel("openai-codex", "gpt-5.2-xhigh");
|
||||
const llm = getModel("openai-codex", "gpt-5.2-codex");
|
||||
await handleToolWithTextAndImageResult(llm, { apiKey: openaiCodexToken });
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -879,8 +879,8 @@ describe("Generate E2E Tests", () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe("OpenAI Codex Provider (gpt-5.2-xhigh)", () => {
|
||||
const llm = getModel("openai-codex", "gpt-5.2-xhigh");
|
||||
describe("OpenAI Codex Provider (gpt-5.2-codex)", () => {
|
||||
const llm = getModel("openai-codex", "gpt-5.2-codex");
|
||||
|
||||
it.skipIf(!openaiCodexToken)("should complete basic text generation", { retry: 3 }, async () => {
|
||||
await basicTextGeneration(llm, { apiKey: openaiCodexToken });
|
||||
|
|
@ -895,7 +895,7 @@ describe("Generate E2E Tests", () => {
|
|||
});
|
||||
|
||||
it.skipIf(!openaiCodexToken)("should handle thinking", { retry: 3 }, async () => {
|
||||
await handleThinking(llm, { apiKey: openaiCodexToken });
|
||||
await handleThinking(llm, { apiKey: openaiCodexToken, reasoningEffort: "high" });
|
||||
});
|
||||
|
||||
it.skipIf(!openaiCodexToken)("should handle multi-turn with thinking and tools", { retry: 3 }, async () => {
|
||||
|
|
|
|||
|
|
@ -222,10 +222,10 @@ describe("Token Statistics on Abort", () => {
|
|||
|
||||
describe("OpenAI Codex Provider", () => {
|
||||
it.skipIf(!openaiCodexToken)(
|
||||
"gpt-5.2-xhigh - should include token stats when aborted mid-stream",
|
||||
"gpt-5.2-codex - should include token stats when aborted mid-stream",
|
||||
{ retry: 3, timeout: 30000 },
|
||||
async () => {
|
||||
const llm = getModel("openai-codex", "gpt-5.2-xhigh");
|
||||
const llm = getModel("openai-codex", "gpt-5.2-codex");
|
||||
await testTokensOnAbort(llm, { apiKey: openaiCodexToken });
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -248,10 +248,10 @@ describe("Tool Call Without Result Tests", () => {
|
|||
|
||||
describe("OpenAI Codex Provider", () => {
|
||||
it.skipIf(!openaiCodexToken)(
|
||||
"gpt-5.2-xhigh - should filter out tool calls without corresponding tool results",
|
||||
"gpt-5.2-codex - should filter out tool calls without corresponding tool results",
|
||||
{ retry: 3, timeout: 30000 },
|
||||
async () => {
|
||||
const model = getModel("openai-codex", "gpt-5.2-xhigh");
|
||||
const model = getModel("openai-codex", "gpt-5.2-codex");
|
||||
await testToolCallWithoutResult(model, { apiKey: openaiCodexToken });
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -541,10 +541,10 @@ describe("totalTokens field", () => {
|
|||
|
||||
describe("OpenAI Codex (OAuth)", () => {
|
||||
it.skipIf(!openaiCodexToken)(
|
||||
"gpt-5.2-xhigh - should return totalTokens equal to sum of components",
|
||||
"gpt-5.2-codex - should return totalTokens equal to sum of components",
|
||||
{ retry: 3, timeout: 60000 },
|
||||
async () => {
|
||||
const llm = getModel("openai-codex", "gpt-5.2-xhigh");
|
||||
const llm = getModel("openai-codex", "gpt-5.2-codex");
|
||||
|
||||
console.log(`\nOpenAI Codex / ${llm.id}:`);
|
||||
const { first, second } = await testTotalTokensWithCache(llm, { apiKey: openaiCodexToken });
|
||||
|
|
|
|||
|
|
@ -619,28 +619,28 @@ describe("AI Providers Unicode Surrogate Pair Tests", () => {
|
|||
|
||||
describe("OpenAI Codex Provider Unicode Handling", () => {
|
||||
it.skipIf(!openaiCodexToken)(
|
||||
"gpt-5.2-xhigh - should handle emoji in tool results",
|
||||
"gpt-5.2-codex - should handle emoji in tool results",
|
||||
{ retry: 3, timeout: 30000 },
|
||||
async () => {
|
||||
const llm = getModel("openai-codex", "gpt-5.2-xhigh");
|
||||
const llm = getModel("openai-codex", "gpt-5.2-codex");
|
||||
await testEmojiInToolResults(llm, { apiKey: openaiCodexToken });
|
||||
},
|
||||
);
|
||||
|
||||
it.skipIf(!openaiCodexToken)(
|
||||
"gpt-5.2-xhigh - should handle real-world LinkedIn comment data with emoji",
|
||||
"gpt-5.2-codex - should handle real-world LinkedIn comment data with emoji",
|
||||
{ retry: 3, timeout: 30000 },
|
||||
async () => {
|
||||
const llm = getModel("openai-codex", "gpt-5.2-xhigh");
|
||||
const llm = getModel("openai-codex", "gpt-5.2-codex");
|
||||
await testRealWorldLinkedInData(llm, { apiKey: openaiCodexToken });
|
||||
},
|
||||
);
|
||||
|
||||
it.skipIf(!openaiCodexToken)(
|
||||
"gpt-5.2-xhigh - should handle unpaired high surrogate (0xD83D) in tool results",
|
||||
"gpt-5.2-codex - should handle unpaired high surrogate (0xD83D) in tool results",
|
||||
{ retry: 3, timeout: 30000 },
|
||||
async () => {
|
||||
const llm = getModel("openai-codex", "gpt-5.2-xhigh");
|
||||
const llm = getModel("openai-codex", "gpt-5.2-codex");
|
||||
await testUnpairedHighSurrogate(llm, { apiKey: openaiCodexToken });
|
||||
},
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue