fix codex context window and add a few tests

This commit is contained in:
Markus Ylisiurunen 2026-03-05 21:17:55 +02:00 committed by Mario Zechner
parent 8a6384a925
commit f8d731a134
4 changed files with 90 additions and 11 deletions

View file

@ -231,7 +231,7 @@ describe("openai-codex streaming", () => {
await streamResult.result();
});
it("clamps gpt-5.3-codex minimal reasoning effort to low", async () => {
it.each(["gpt-5.3-codex", "gpt-5.4"])("clamps %s minimal reasoning effort to low", async (modelId) => {
const tempDir = mkdtempSync(join(tmpdir(), "pi-codex-stream-"));
process.env.PI_CODING_AGENT_DIR = tempDir;
@ -303,8 +303,8 @@ describe("openai-codex streaming", () => {
global.fetch = fetchMock as typeof fetch;
const model: Model<"openai-codex-responses"> = {
id: "gpt-5.3-codex",
name: "GPT-5.3 Codex",
id: modelId,
name: modelId,
api: "openai-codex-responses",
provider: "openai-codex",
baseUrl: "https://chatgpt.com/backend-api",

View file

@ -14,6 +14,12 @@ describe("supportsXhigh", () => {
expect(supportsXhigh(model!)).toBe(false);
});
it("returns true for GPT-5.4 models", () => {
const model = getModel("openai-codex", "gpt-5.4");
expect(model).toBeDefined();
expect(supportsXhigh(model!)).toBe(true);
});
it("returns false for OpenRouter Opus 4.6 (openai-completions API)", () => {
const model = getModel("openrouter", "anthropic/claude-opus-4.6");
expect(model).toBeDefined();