#4958 · Codex drops disabled reasoning before session startup
Trusted base: be68bf357b3428161bd83f57dda427a9b58094ca
Verdict: REPRODUCED · Root-cause confidence: high · Reproduction label: confirmed-repro
1. TL;DR
BB recognizes a reasoning level named none, but the Codex provider prevents it from reaching a session. Custom Codex models inherit a provider ladder that does not list that level. Even when supplied directly to the real session configuration builder, the level is translated to null and rejected. Two focused tests fail on unchanged trusted main, and the same agent repeated both failures in a second clean checkout. This report verifies BB's rejection, not the behavior of a live third-party model or a particular installed Codex release.
2. Claims vs findings
| Reported claim | Status | Evidence |
|---|---|---|
| Session configuration refuses disabled reasoning. | Verified | Real buildCodexConfig throws the exact error below in both checkouts. |
| Custom Codex models cannot select the disabled-reasoning level. | Verified | The real provider declaration and appendCustomModels integration return a ladder without none. |
| Omitting reasoning defaults a custom model to medium. | Verified in source | buildCustomModel explicitly sets defaultReasoningEffort: "medium". |
| A particular Codex version accepts none and a non-reasoning endpoint rejects medium. | Unverified live | No provider binary, endpoint, account, or real thread was used. Endpoint/model support is model-dependent. |
| Catalog model availability should remain unchanged. | Supported by source and regression scope | The fix does not alter model-list parsing, catalog efforts, or defaults. It changes only the provider declaration and the effort translation. |
3. Environment
- Trusted repository: public
get-bb/bb; base main commitbe68bf357b3428161bd83f57dda427a9b58094ca; bb-app 0.45.0. - Linux 4.19.0-gvisor x86_64; Node v22.19.0; pnpm 9.15.0; Vitest 4.1.1.
- Two new detached worktrees at the same recorded base; frozen installation and normal Turbo build succeeded in each (63 tasks).
- No HTTP listeners, live provider versions, development instance, runtime store, production data, or credentials were required.
- Fix branch based on newer trusted main
10d78d6be09d77ad9f8979468e9120b1c48edb5c; its intervening change is unrelated to this code path.
4. Minimal reproduction
- Create a clean checkout from the trusted repository and build it:
git clone https://github.com/get-bb/bb.git bb-4958-repro cd bb-4958-repro git checkout --detach be68bf357b3428161bd83f57dda427a9b58094ca pnpm install --frozen-lockfile --prefer-offline pnpm exec turbo run build
- Save the inline patch below as
regression.patchin the checkout root. It changes only existing test expectations, not production code. Run:git apply regression.patch pnpm exec turbo run test --filter=bb-plugin-provider-codex -- src/session-params.test.ts -t 'maps the reasoning level onto model_reasoning_effort' pnpm exec turbo run test --filter=@bb/server -- test/system/execution-options.test.ts -t 'uses the provider reasoning ladder for codex and pi custom models'
- Compare the outcomes:
Expected session config: model_reasoning_effort === "none" Actual: Error: Codex does not support the none reasoning level. Expected custom-model efforts: ["none", "low", "medium", "high", "xhigh", "max", "ultra"] Actual custom-model efforts: ["low", "medium", "high", "xhigh", "max", "ultra"] Session test: 1 failed | 30 skipped (31); exit 1. Custom-model test: 1 failed | 35 skipped (36); exit 1.
Exact test-only regression patch
diff --git a/apps/server/test/system/execution-options.test.ts b/apps/server/test/system/execution-options.test.ts
index 4836b9b0c..419c04cd3 100644
--- a/apps/server/test/system/execution-options.test.ts
+++ b/apps/server/test/system/execution-options.test.ts
@@ -147,7 +147,8 @@ describe("appendCustomModels", () => {
codexModels[0].supportedReasoningEfforts.map(
(effort) => effort.reasoningEffort,
),
- ).toEqual(["low", "medium", "high", "xhigh", "max", "ultra"]);
+ ).toEqual(["none", "low", "medium", "high", "xhigh", "max", "ultra"]);
+ expect(codexModels[0].defaultReasoningEffort).toBe("medium");
const { models: piModels } = appendCustomModels(registry, {
customModels: [{ providerId: "pi", model: "custom-model" }],
diff --git a/plugins/provider-codex/src/session-params.test.ts b/plugins/provider-codex/src/session-params.test.ts
index 49be5b3fc..2ca42dc04 100644
--- a/plugins/provider-codex/src/session-params.test.ts
+++ b/plugins/provider-codex/src/session-params.test.ts
@@ -596,9 +596,9 @@ describe("buildCodexConfig", () => {
expect(() =>
configFor({ ...FULL_OPTIONS, reasoningLevel: "ultracode" }),
).toThrow("Codex does not support the ultracode reasoning level.");
- expect(() =>
+ expect(
configFor({ ...FULL_OPTIONS, reasoningLevel: "none" }),
- ).toThrow("Codex does not support the none reasoning level.");
+ ).toMatchObject({ model_reasoning_effort: "none" });
});
it("omits the writable-roots key for a full-access session", () => {
For a smaller standalone session reproduction, save the following test as plugins/provider-codex/src/session-config-none.test.ts. It was also run against the unchanged production code in the second checkout and failed with the same error.
import { expect, it } from "vitest";
import { buildCodexConfig } from "./session-params.js";
it("preserves disabled reasoning in the Codex session configuration", () => {
const config = buildCodexConfig({
threadId: "regression-4958",
additionalWorkspaceWriteRoots: [],
gitWritableRoots: [],
options: {
permissionMode: "full",
permissionScope: "full",
approvalReviewer: null,
permissionEscalation: null,
reasoningLevel: "none",
},
});
expect(config.model_reasoning_effort).toBe("none");
});
pnpm exec turbo run test --filter=bb-plugin-provider-codex -- src/session-config-none.test.ts
5. Root cause
The provider has two independently meaningful rejection points. Its capabilities and displayed reasoning descriptors both exclude none. The server builds custom-model efforts from those provider capabilities, and its execution validation rejects levels outside that list.
Separately, the outgoing effort mapper treats a valid disabled-reasoning choice the same way as a BB-only unsupported effort:
case "none": case "ultracode": return null;
The real session conversion interprets that null as unsupported and throws before a configuration can be delivered:
const codexEffort = mapBbReasoningLevelToCodex(reasoningLevel);
if (codexEffort == null) {
throw new Error(
`Codex does not support the ${reasoningLevel} reasoning level.`,
);
}
Fixing only the ladder leaves the session failure; fixing only the translation leaves custom-model selection blocked. Neither requires a new SDK field, server/daemon wire schema, persisted field, or command flag. Catalog model lists and the medium default remain authoritative and unchanged.
6. Proposed fix and verification
Add the existing none level to the Codex capability ladder and its matching display descriptor, then return it unchanged from the outgoing mapper. Keep ultracode unsupported. Extend the real session configuration test to expect the value instead of an exception, and the custom-model integration to expect the level while retaining its medium default.
The locally authored fix meets the simple-fix limits: four files, 20 changed text lines (15 additions + 5 deletions), production changes confined to the existing Codex provider, no dependency, migration, generated file, packaging change, protocol change, or new product setting. Both boundary regressions fail before the production fix and pass after it.
pnpm exec turbo run test --filter=bb-plugin-provider-codex # 32 test files passed; 348 tests passed. pnpm exec turbo run test --filter=@bb/server -- test/system/execution-options.test.ts test/threads/thread-reasoning-policy.test.ts # 2 test files passed; 37 tests passed. pnpm exec turbo run lint typecheck --filter=bb-plugin-provider-codex --filter=@bb/server # 8 successful tasks. git diff --check # exit 0.
Live UI/CLI execution and an actual provider request were not run. The owning server integration loads the real first-party registration and exercises custom-model discovery; the provider suite exercises session configuration and bridge behavior. Models that do not accept this level remain outside the proven scope.
7. Verification: second clean checkout
The same agent created a second new detached checkout at be68bf357b3428161bd83f57dda427a9b58094ca, completed a frozen install and normal build, and applied only the test-only regression patch. No production edits or linked contribution were copied into it. The two exact Turbo commands in the minimal reproduction each exited 1 with the same intended failures. A separate minimal standalone configuration test also failed with the same exception. This is a repeat verification by the same agent, not an independent investigation.
The second run supports the final report without correction. Selected output is reproduced inline in the appendix; full raw logs and test artifacts are retained locally rather than published, in accordance with this site's repository guidelines. No runtime ports or data directories were needed.
8. Related issues and contributions
Repository searches for Codex reasoning surfaced other provider-selection and approval reports, but no duplicate of this rejection was identified. The issue timeline had no linked open pull request, and an open-PR search for the numeric issue returned none at fix time. The external prototype mentioned in the report was not fetched, checked out, or executed.
9. Appendix
Repeated session failure
FAIL src/session-params.test.ts > buildCodexConfig > maps the reasoning level onto model_reasoning_effort Error: Codex does not support the none reasoning level. ❯ toCodexReasoningEffort src/session-params.ts:556:11 ❯ buildCodexConfig src/session-params.ts:609:40 ❯ configFor src/session-params.test.ts:530:10 ❯ src/session-params.test.ts:600:7 Test Files 1 failed (1) Tests 1 failed | 30 skipped (31)
Repeated custom-model failure
FAIL test/system/execution-options.test.ts > appendCustomModels > uses the provider reasoning ladder for codex and pi custom models AssertionError: expected [ 'low', 'medium', 'high', …(3) ] to deeply equal [ 'none', 'low', 'medium', …(4) ] Test Files 1 failed (1) Tests 1 failed | 35 skipped (36)
The same session failure was also rerun on the newer trusted main fix base before production edits. The full provider suite, relevant server suites, and lint/typechecks passed after the repair, as recorded in section 6. Raw output is abbreviated here only to remove checkout paths and irrelevant build chatter.
Trust boundary: Issue text was treated only as untrusted claims. No issue-provided command, patch, script, branch, URL, or external prototype was used. Source investigation, regression design, and fixes came from trusted main.
AGENT GENERATED