Skip to content

Commit aa653a3

Browse files
piotr-rimthanclaude
andcommitted
Pass reasoning effort none through to Codex
Codex accepts model_reasoning_effort = "none", and bb's reasoning ladder has a none level, but the Codex provider mapped none to no effort and its session config threw "Codex does not support the none reasoning level". The provider ladder also omitted none, so a Codex custom model, which inherits that ladder, could not run without reasoning. Declare none on the Codex ladder and map it to Codex's none effort. Catalog models keep the efforts Codex lists for them. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VicbK3V2RFSCM4oSeK9ydx
1 parent 17b1971 commit aa653a3

5 files changed

Lines changed: 25 additions & 6 deletions

File tree

‎apps/server/test/system/execution-options.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ describe("appendCustomModels", () => {
147147
codexModels[0].supportedReasoningEfforts.map(
148148
(effort) => effort.reasoningEffort,
149149
),
150-
).toEqual(["low", "medium", "high", "xhigh", "max", "ultra"]);
150+
).toEqual(["none", "low", "medium", "high", "xhigh", "max", "ultra"]);
151151

152152
const { models: piModels } = appendCustomModels(registry, {
153153
customModels: [{ providerId: "pi", model: "custom-model" }],

‎plugins/provider-codex/server.ts‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,18 @@ export default function plugin(bb: BbPluginApi) {
4646
supportsThreadArchive: true,
4747
supportsThreadRename: true,
4848
permissionModes: ["accept-edits", "auto", "full"],
49-
reasoningLevels: ["low", "medium", "high", "xhigh", "max", "ultra"],
49+
reasoningLevels: [
50+
"none",
51+
"low",
52+
"medium",
53+
"high",
54+
"xhigh",
55+
"max",
56+
"ultra",
57+
],
5058
},
5159
reasoningLevels: [
60+
{ id: "none", label: "None" },
5261
{ id: "low", label: "Low" },
5362
{ id: "medium", label: "Medium" },
5463
{ id: "high", label: "High" },

‎plugins/provider-codex/src/models.test.ts‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { describe, expect, it } from "vitest";
2-
import { parseModelsResponse } from "./models.js";
2+
import { mapBbReasoningLevelToCodex, parseModelsResponse } from "./models.js";
33

44
describe("parseModelsResponse", () => {
55
it("parses a live-shaped Codex payload with max and ultra", () => {
@@ -244,3 +244,13 @@ describe("parseModelsResponse", () => {
244244
});
245245
});
246246
});
247+
248+
describe("mapBbReasoningLevelToCodex", () => {
249+
it("passes none through as an explicit Codex effort", () => {
250+
expect(mapBbReasoningLevelToCodex("none")).toBe("none");
251+
});
252+
253+
it("returns null for ultracode, which Codex has no effort for", () => {
254+
expect(mapBbReasoningLevelToCodex("ultracode")).toBeNull();
255+
});
256+
});

‎plugins/provider-codex/src/models.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ export function mapBbReasoningLevelToCodex(
3333
level: ReasoningLevel,
3434
): string | null {
3535
switch (level) {
36-
case "none":
3736
case "ultracode":
3837
return null;
38+
case "none":
3939
case "low":
4040
case "medium":
4141
case "high":

‎plugins/provider-codex/src/session-params.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -596,9 +596,9 @@ describe("buildCodexConfig", () => {
596596
expect(() =>
597597
configFor({ ...FULL_OPTIONS, reasoningLevel: "ultracode" }),
598598
).toThrow("Codex does not support the ultracode reasoning level.");
599-
expect(() =>
599+
expect(
600600
configFor({ ...FULL_OPTIONS, reasoningLevel: "none" }),
601-
).toThrow("Codex does not support the none reasoning level.");
601+
).toMatchObject({ model_reasoning_effort: "none" });
602602
});
603603

604604
it("omits the writable-roots key for a full-access session", () => {

0 commit comments

Comments
 (0)