Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 2 additions & 25 deletions packages/agent/src/adapters/codex/models.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
formatCodexModelName,
getReasoningEffortOptions,
modelIdFromConfigOptions,
supportsXhighEffort,
} from "./models";

describe("formatCodexModelName", () => {
Expand All @@ -17,34 +16,12 @@ describe("getReasoningEffortOptions", () => {
const values = (modelId: string) =>
getReasoningEffortOptions(modelId).map((o) => o.value);

it.each(["gpt-5.5", "gpt-5.5-codex", "openai/gpt-5.5", "GPT-5.5"])(
"offers Extra High for the gpt-5.5 family (%s)",
(modelId) => {
expect(values(modelId)).toEqual(["low", "medium", "high", "xhigh"]);
},
);

it.each(["gpt-5.3-codex", "gpt-5.1", "o3"])(
"caps at High for other models (%s)",
it.each(["gpt-5.5", "gpt-5.5-codex", "openai/gpt-5.5", "GPT-5.5", "o3"])(
"caps at High for all models (%s)",
(modelId) => {
expect(values(modelId)).toEqual(["low", "medium", "high"]);
},
);

it('labels the extra tier "Extra High"', () => {
const xhigh = getReasoningEffortOptions("gpt-5.5").find(
(o) => o.value === "xhigh",
);
expect(xhigh?.name).toBe("Extra High");
});
});

describe("supportsXhighEffort", () => {
it("is true for the gpt-5.5 family and false for other models", () => {
expect(supportsXhighEffort("gpt-5.5-codex")).toBe(true);
expect(supportsXhighEffort("GPT-5.5")).toBe(true);
expect(supportsXhighEffort("gpt-5.3-codex")).toBe(false);
});
});

describe("modelIdFromConfigOptions", () => {
Expand Down
14 changes: 2 additions & 12 deletions packages/agent/src/adapters/codex/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,10 @@ const CODEX_REASONING_EFFORT_OPTIONS: ReasoningEffortOption[] = [
{ value: "high", name: "High" },
];

// OpenAI's `reasoning_effort` exposes an "extra high" tier only on the gpt-5.5
// family, matching what the Codex app offers. Older models top out at "high".
export function supportsXhighEffort(modelId: string): boolean {
return modelId.toLowerCase().includes("gpt-5.5");
}

export function getReasoningEffortOptions(
modelId: string,
_modelId: string,
): ReasoningEffortOption[] {
const options = [...CODEX_REASONING_EFFORT_OPTIONS];
if (supportsXhighEffort(modelId)) {
options.push({ value: "xhigh", name: "Extra High" });
}
return options;
return [...CODEX_REASONING_EFFORT_OPTIONS];
}

export function formatCodexModelName(value: string): string {
Expand Down
9 changes: 3 additions & 6 deletions packages/agent/src/adapters/reasoning-effort.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@ import { describe, expect, it } from "vitest";
import { isSupportedReasoningEffort } from "./reasoning-effort";

describe("isSupportedReasoningEffort", () => {
it("accepts xhigh for the codex gpt-5.5 family", () => {
expect(isSupportedReasoningEffort("codex", "gpt-5.5", "xhigh")).toBe(true);
it("rejects xhigh for codex models, including the gpt-5.5 family", () => {
expect(isSupportedReasoningEffort("codex", "gpt-5.5", "xhigh")).toBe(false);
expect(isSupportedReasoningEffort("codex", "gpt-5.5-codex", "xhigh")).toBe(
true,
false,
);
});

it("rejects xhigh for other codex models", () => {
expect(isSupportedReasoningEffort("codex", "gpt-5.3-codex", "xhigh")).toBe(
false,
);
Expand Down
4 changes: 2 additions & 2 deletions packages/agent/src/agent.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe("Agent", () => {
await agent.run("task-1", "run-1", {
adapter: "codex",
model: "gpt-5.5",
reasoningEffort: "xhigh",
reasoningEffort: "high",
repositoryPath: "/tmp/repo",
});

Expand All @@ -51,7 +51,7 @@ describe("Agent", () => {
expect(config.codexOptions).toEqual(
expect.objectContaining({
model: "gpt-5.5",
reasoningEffort: "xhigh",
reasoningEffort: "high",
}),
);
});
Expand Down
4 changes: 2 additions & 2 deletions packages/workspace-server/src/services/agent/agent.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -323,15 +323,15 @@ describe("AgentService", () => {
await service.startSession({
...baseSessionParams,
adapter: "codex",
effort: "xhigh",
effort: "high",
});

expect(mockAgentRun).toHaveBeenCalledWith(
"task-1",
"run-1",
expect.objectContaining({
adapter: "codex",
reasoningEffort: "xhigh",
reasoningEffort: "high",
}),
);
});
Expand Down
Loading