@devries-cameron20 / t3code-1 / commits / ff9f41b65f
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix(server): Codex turns without a saved effort run at the model's default (#20991)

Co-authored-by: Julius Marminge <julius0216@outlook.com>

Craig Davison committed Oct 19, 2026 at 23:42 UTC ff9f41b65f7d0220153ab2d7f51f3c6eec0dc0d6
6 files changed +140 -51
apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.test.ts
+125 -41
@@ -67,6 +67,7 @@ import * as ProviderReplayHarness from "../testkit/ProviderReplayHarness.ts";
67 import * as ProviderAdapter from "@t3tools/provider-core/server/ProviderAdapter";
68 import type * as ProviderContinuationRequests from "@t3tools/provider-core/server/ProviderContinuationRequests";
69 import * as CodexAdapterV2 from "./CodexAdapterV2.ts";
70 +import { mapCodexModelCapabilities } from "../../provider/CodexProvider.ts";
71 import { makeReplayServerConfig, withCodexReplayChildMetadata } from "./CodexAdapterV2.testkit.ts";
72 import * as CodexAdapterV2Testkit from "./CodexAdapterV2.testkit.ts";
73
@@ -587,55 +588,138 @@ describe("CodexAdapterV2 runtime policy", () => {
588
589 assert.equal(params.collaborationMode?.mode, "plan");
590 assert.notProperty(params.collaborationMode?.settings, "developer_instructions");
591 + assert.notProperty(params.collaborationMode?.settings, "reasoning_effort");
592 + assert.isUndefined(params.effort);
593 }),
594 );
595
593 - it.effect("compiles per-turn Codex model options and cwd from their owning inputs", () =>
594 - Effect.gen(function* () {
595 - const params = yield* CodexAdapterV2.buildCodexTurnStartParams({
596 - nativeThreadId: "native-model-options",
597 - codexInput: [{ type: "text", text: "test" }],
598 - runtimePolicy: {
599 - runtimeMode: "full-access",
600 - interactionMode: "plan",
601 - cwd: "/workspace/model-options",
602 - reasoningEffort: "low",
603 - },
604 - modelSelection: {
605 - instanceId: ProviderInstanceId.make("codex"),
606 - model: "gpt-5.4",
607 - options: [
608 - { id: "reasoningEffort", value: "xhigh" },
609 - { id: "serviceTier", value: "priority" },
610 - ],
611 - },
612 - });
596 + it.effect.each(["default", "plan"] as const)(
597 + "compiles per-turn Codex model options and cwd from their owning inputs in %s mode",
598 + (interactionMode) =>
599 + Effect.gen(function* () {
600 + const params = yield* CodexAdapterV2.buildCodexTurnStartParams({
601 + nativeThreadId: "native-model-options",
602 + hasT3Mcp: true,
603 + codexInput: [{ type: "text", text: "test" }],
604 + runtimePolicy: {
605 + runtimeMode: "full-access",
606 + interactionMode,
607 + cwd: "/workspace/model-options",
608 + reasoningEffort: "low",
609 + },
610 + modelSelection: {
611 + instanceId: ProviderInstanceId.make("codex"),
612 + model: "gpt-5.4",
613 + options: [
614 + { id: "reasoningEffort", value: "xhigh" },
615 + { id: "serviceTier", value: "priority" },
616 + ],
617 + },
618 + });
619
614 - assert.equal(params.model, "gpt-5.4");
615 - assert.equal(params.effort, "xhigh");
616 - assert.equal(params.serviceTier, "priority");
617 - assert.equal(params.cwd, "/workspace/model-options");
618 - assert.equal(params.collaborationMode?.settings.model, "gpt-5.4");
619 - assert.equal(params.collaborationMode?.settings.reasoning_effort, "xhigh");
620 + assert.equal(params.model, "gpt-5.4");
621 + assert.equal(params.effort, "xhigh");
622 + assert.equal(params.serviceTier, "priority");
623 + assert.equal(params.cwd, "/workspace/model-options");
624 + assert.equal(params.collaborationMode?.settings.model, "gpt-5.4");
625 + assert.equal(params.collaborationMode?.mode, interactionMode);
626 + assert.equal(params.collaborationMode?.settings.reasoning_effort, "xhigh");
627 + assert.include(
628 + params.additionalContext?.t3_code_runtime?.value ?? "",
629 + "as gpt-5.4 with xhigh reasoning effort",
630 + );
631
621 - const managed = yield* CodexAdapterV2.buildCodexTurnStartParams({
622 - nativeThreadId: "native-model-options",
623 - codexInput: [{ type: "text", text: "test" }],
624 - runtimePolicy: {
625 - runtimeMode: "full-access",
626 - interactionMode: "default",
627 - cwd: "/workspace/model-options",
628 - },
629 - modelSelection: {
630 - instanceId: ProviderInstanceId.make("codex"),
631 - model: "gpt-5.4",
632 - options: [{ id: "serviceTier", value: "priority" }],
633 - },
634 - omitServiceTier: true,
632 + const managed = yield* CodexAdapterV2.buildCodexTurnStartParams({
633 + nativeThreadId: "native-model-options",
634 + codexInput: [{ type: "text", text: "test" }],
635 + runtimePolicy: {
636 + runtimeMode: "full-access",
637 + interactionMode: "default",
638 + cwd: "/workspace/model-options",
639 + },
640 + modelSelection: {
641 + instanceId: ProviderInstanceId.make("codex"),
642 + model: "gpt-5.4",
643 + options: [{ id: "serviceTier", value: "priority" }],
644 + },
645 + omitServiceTier: true,
646 + });
647 + assert.equal(managed.serviceTier, undefined);
648 + }),
649 + );
650 +
651 + it.effect("uses Astra's advertised effort default while preserving explicit selections", () =>
652 + Effect.gen(function* () {
653 + const model = "gpt-6-astra";
654 + const capabilities = mapCodexModelCapabilities({
655 + id: model,
656 + model,
657 + displayName: model,
658 + description: "Test model",
659 + hidden: false,
660 + isDefault: true,
661 + defaultReasoningEffort: "low",
662 + supportedReasoningEfforts: ["low", "medium", "high"].map((reasoningEffort) => ({
663 + reasoningEffort,
664 + description: reasoningEffort,
665 + })),
666 + additionalSpeedTiers: [],
667 });
636 - assert.equal(managed.serviceTier, undefined);
668 + const advertised = capabilities.optionDescriptors?.find(
669 + (option) => option.id === "reasoningEffort",
670 + )?.currentValue;
671 + assert.equal(advertised, "medium");
672 + for (const selected of [undefined, "high"] as const) {
673 + const params = yield* CodexAdapterV2.buildCodexTurnStartParams({
674 + nativeThreadId: "native-astra-effort",
675 + codexInput: [{ type: "text", text: "test" }],
676 + runtimePolicy: { runtimeMode: "full-access", interactionMode: "default", cwd: null },
677 + modelSelection: {
678 + instanceId: ProviderInstanceId.make("codex"),
679 + model,
680 + ...(selected ? { options: [{ id: "reasoningEffort", value: selected }] } : {}),
681 + },
682 + hasT3Mcp: true,
683 + });
684 + const expected = selected ?? advertised;
685 + assert.equal(params.effort, expected);
686 + assert.equal(params.collaborationMode?.settings.reasoning_effort, expected);
687 + assert.include(
688 + params.additionalContext?.t3_code_runtime?.value ?? "",
689 + `${expected} reasoning effort`,
690 + );
691 + }
692 }),
693 );
694 +
695 + it.effect.each(["default", "plan"] as const)(
696 + "omits unset effort from T3 %s collaboration settings and runtime context",
697 + (interactionMode) =>
698 + Effect.gen(function* () {
699 + const params = yield* CodexAdapterV2.buildCodexTurnStartParams({
700 + nativeThreadId: "native-unset-effort",
701 + codexInput: [{ type: "text", text: "test" }],
702 + runtimePolicy: {
703 + runtimeMode: "full-access",
704 + interactionMode,
705 + cwd: null,
706 + },
707 + modelSelection: {
708 + instanceId: ProviderInstanceId.make("codex"),
709 + model: "gpt-5.4",
710 + },
711 + hasT3Mcp: true,
712 + });
713 +
714 + assert.isUndefined(params.effort);
715 + assert.equal(params.collaborationMode?.mode, interactionMode);
716 + assert.equal(params.collaborationMode?.settings.model, "gpt-5.4");
717 + assert.notProperty(params.collaborationMode?.settings, "reasoning_effort");
718 + const runtimeContext = params.additionalContext?.t3_code_runtime?.value ?? "";
719 + assert.include(runtimeContext, "as gpt-5.4");
720 + assert.notInclude(runtimeContext, "reasoning effort");
721 + }),
722 + );
723 });
724
725 describe("CodexAdapterV2 process spawning", () => {
apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.ts
+7 -6
@@ -17,6 +17,7 @@ import type { CodexEffectiveRuntime } from "../../provider/CodexManagedRuntime.t
17 import {
18 buildCodexInitializeParams,
19 codexAppServerEnvironment,
20 + codexDefaultReasoningEffortOverride,
21 } from "../../provider/CodexProvider.ts";
22 import {
23 codexRateLimitsToUpdate,
@@ -738,10 +739,9 @@ export function buildCodexTurnStartParams(input: {
739 input.runtimePolicy.sandboxPolicy === undefined
740 ? runtimeModeDefaults.sandboxPolicy
741 : yield* decodeTurnSandboxPolicy(input.runtimePolicy.sandboxPolicy);
741 - const selectedEffort = getModelSelectionStringOptionValue(
742 - input.modelSelection,
743 - "reasoningEffort",
744 - );
742 + const selectedEffort =
743 + getModelSelectionStringOptionValue(input.modelSelection, "reasoningEffort") ??
744 + codexDefaultReasoningEffortOverride(input.modelSelection.model);
745 const effort =
746 selectedEffort === undefined ? undefined : yield* decodeTurnReasoningEffort(selectedEffort);
747 const serviceTier =
@@ -764,7 +764,7 @@ export function buildCodexTurnStartParams(input: {
764 const t3Context =
765 input.hasT3Mcp === true
766 ? buildCodexAdditionalContext(
767 - { model: input.modelSelection.model, reasoningEffort: effort ?? "medium" },
767 + { model: input.modelSelection.model, reasoningEffort: effort ?? undefined },
768 {
769 browser: input.browserToolsAvailable ?? true,
770 device: input.deviceToolsAvailable ?? false,
@@ -782,7 +782,8 @@ export function buildCodexTurnStartParams(input: {
782 mode: input.runtimePolicy.interactionMode === "plan" ? "plan" : "default",
783 settings: {
784 model: input.modelSelection.model,
785 - reasoning_effort: effort ?? "medium",
785 + // Codex falls back to the model's default effort when this is left out.
786 + ...(effort === undefined ? {} : { reasoning_effort: effort }),
787 ...(developerInstructions === undefined
788 ? {}
789 : { developer_instructions: developerInstructions }),
apps/server/src/orchestration-v2/testkit/fixtures/plan_questions/codex_transcript.ndjson
+1 -1
@@ -6,7 +6,7 @@
6 {"type":"emit_inbound","label":"configWarning","frame":{"method":"configWarning","params":{"summary":"Codex could not find bubblewrap on PATH. Install bubblewrap with your OS package manager. See the sandbox prerequisites: https://developers.openai.com/codex/concepts/sandboxing#prerequisites. Codex will use the bundled bubblewrap in the meantime.","details":null},"emittedAtMs":1790295620180}}
7 {"type":"emit_inbound","label":"remoteControl/status/changed","frame":{"method":"remoteControl/status/changed","params":{"status":"disabled","serverName":"replay-host","installationId":"00000000-0000-4000-8000-000000000000","environmentId":null},"emittedAtMs":1790295620180}}
8 {"type":"emit_inbound","label":"thread/start","frame":{"id":2,"result":{"thread":{"id":"01a0d5ef-3a6a-75d0-9942-61b29ab82328","environments":[{"environmentId":"local","cwd":"/home/replay-user/t3code/packages/effect-codex-app-server","runtimeWorkspaceRoots":["/home/replay-user/t3code/packages/effect-codex-app-server"]}],"extra":null,"sessionId":"01a0d5ef-3a6a-75d0-9942-61b29ab82328","forkedFromId":null,"parentThreadId":null,"preview":"","ephemeral":false,"section":null,"sectionEnteredAt":null,"projectId":null,"historyMode":"paginated","modelProvider":"openai","model":"gpt-6-luna","reasoningEffort":null,"createdAt":1790295620,"updatedAt":1790295620,"recencyAt":1790295620,"status":{"type":"idle"},"path":"/home/replay-user/.codex/sessions/2026/09/24/rollout-2026-09-24T17-20-20-01a0d5ef-3a6a-75d0-9942-61b29ab82328.jsonl","cwd":"/home/replay-user/t3code/packages/effect-codex-app-server","cliVersion":"0.156.1","originator":"t3code_desktop","source":"vscode","canAcceptDirectInput":true,"threadSource":null,"agentNickname":null,"agentRole":null,"gitInfo":null,"name":null,"daybreakEnabled":null,"turns":[]},"model":"gpt-6-luna","modelProvider":"openai","serviceTier":null,"disabledPluginIds":[],"cwd":"/home/replay-user/t3code/packages/effect-codex-app-server","runtimeWorkspaceRoots":["/home/replay-user/t3code/packages/effect-codex-app-server"],"instructionSources":["/home/replay-user/.codex/AGENTS.md","/home/replay-user/t3code/AGENTS.md"],"approvalPolicy":"on-request","approvalsReviewer":"user","sandbox":{"type":"workspaceWrite","writableRoots":[],"networkAccess":false,"excludeTmpdirEnvVar":false,"excludeSlashTmp":false},"activePermissionProfile":{"id":":workspace","extends":null},"reasoningEffort":null,"multiAgentMode":"explicitRequestOnly"}}}
9 -{"type":"expect_outbound","label":"turn/start","frame":{"id":3,"method":"turn/start","params":{"approvalPolicy":"never","approvalsReviewer":"user","cwd":"<workspace>","input":[{"text":"Use request_user_input to ask one multiple-choice clarifying question about whether this fixture should prefer strict schemas or UI flexibility. After receiving the answer, respond exactly: plan questions fixture complete","type":"text"}],"model":"gpt-6-luna","sandboxPolicy":{"networkAccess":false,"type":"readOnly"},"summary":"detailed","threadId":"01a0d5ef-3a6a-75d0-9942-61b29ab82328","collaborationMode":{"mode":"plan","settings":{"developer_instructions":"You are in Plan mode. Prefer request_user_input for clarifying questions. When presenting a complete plan, wrap it in <proposed_plan> and </proposed_plan>.","model":"gpt-6-luna","reasoning_effort":"medium"}}}}}
9 +{"type":"expect_outbound","label":"turn/start","frame":{"id":3,"method":"turn/start","params":{"approvalPolicy":"never","approvalsReviewer":"user","cwd":"<workspace>","input":[{"text":"Use request_user_input to ask one multiple-choice clarifying question about whether this fixture should prefer strict schemas or UI flexibility. After receiving the answer, respond exactly: plan questions fixture complete","type":"text"}],"model":"gpt-6-luna","sandboxPolicy":{"networkAccess":false,"type":"readOnly"},"summary":"detailed","threadId":"01a0d5ef-3a6a-75d0-9942-61b29ab82328","collaborationMode":{"mode":"plan","settings":{"developer_instructions":"You are in Plan mode. Prefer request_user_input for clarifying questions. When presenting a complete plan, wrap it in <proposed_plan> and </proposed_plan>.","model":"gpt-6-luna"}}}}}
10 {"type":"emit_inbound","label":"mcpServer/startupStatus/updated","frame":{"method":"mcpServer/startupStatus/updated","params":{"threadId":"01a0d5ef-3a6a-75d0-9942-61b29ab82328","name":"codex_apps","status":"starting","error":null,"failureReason":null},"emittedAtMs":1790295620428}}
11 {"type":"emit_inbound","label":"thread/started","frame":{"method":"thread/started","params":{"thread":{"id":"01a0d5ef-3a6a-75d0-9942-61b29ab82328","environments":[{"environmentId":"local","cwd":"/home/replay-user/t3code/packages/effect-codex-app-server","runtimeWorkspaceRoots":["/home/replay-user/t3code/packages/effect-codex-app-server"]}],"extra":null,"sessionId":"01a0d5ef-3a6a-75d0-9942-61b29ab82328","forkedFromId":null,"parentThreadId":null,"preview":"","ephemeral":false,"section":null,"sectionEnteredAt":null,"projectId":null,"historyMode":"paginated","modelProvider":"openai","model":"gpt-6-luna","reasoningEffort":null,"createdAt":1790295620,"updatedAt":1790295620,"recencyAt":1790295620,"status":{"type":"idle"},"path":"/home/replay-user/.codex/sessions/2026/09/24/rollout-2026-09-24T17-20-20-01a0d5ef-3a6a-75d0-9942-61b29ab82328.jsonl","cwd":"/home/replay-user/t3code/packages/effect-codex-app-server","cliVersion":"0.156.1","originator":"t3code_desktop","source":"vscode","canAcceptDirectInput":true,"threadSource":null,"agentNickname":null,"agentRole":null,"gitInfo":null,"name":null,"daybreakEnabled":null,"turns":[]}},"emittedAtMs":1790295620428}}
12 {"type":"emit_inbound","label":"thread/settings/updated","frame":{"method":"thread/settings/updated","params":{"threadId":"01a0d5ef-3a6a-75d0-9942-61b29ab82328","threadSettings":{"disabledPluginIds":[],"cwd":"/home/replay-user/t3code/packages/effect-codex-app-server","approvalPolicy":"never","approvalsReviewer":"user","sandboxPolicy":{"type":"readOnly","networkAccess":false},"activePermissionProfile":null,"model":"gpt-6-luna","modelProvider":"openai","serviceTier":null,"effort":"medium","summary":"detailed","collaborationMode":{"mode":"plan","settings":{"model":"gpt-6-luna","reasoning_effort":"medium","developer_instructions":"You are in Plan mode. Prefer request_user_input for clarifying questions. When presenting a complete plan, wrap it in <proposed_plan> and </proposed_plan>."}},"multiAgentMode":"explicitRequestOnly","personality":null}},"emittedAtMs":1790295620457}}
apps/server/src/orchestration-v2/testkit/fixtures/proposed_plan/codex_transcript.ndjson
+1 -1
@@ -6,7 +6,7 @@
6 {"type":"emit_inbound","label":"configWarning","frame":{"method":"configWarning","params":{"summary":"Codex could not find bubblewrap on PATH. Install bubblewrap with your OS package manager. See the sandbox prerequisites: https://developers.openai.com/codex/concepts/sandboxing#prerequisites. Codex will use the bundled bubblewrap in the meantime.","details":null},"emittedAtMs":1790295608195}}
7 {"type":"emit_inbound","label":"remoteControl/status/changed","frame":{"method":"remoteControl/status/changed","params":{"status":"disabled","serverName":"replay-host","installationId":"00000000-0000-4000-8000-000000000000","environmentId":null},"emittedAtMs":1790295608195}}
8 {"type":"emit_inbound","label":"thread/start","frame":{"id":2,"result":{"thread":{"id":"01a0d5ef-0ba3-7552-b090-7cfbb328e278","environments":[{"environmentId":"local","cwd":"/home/replay-user/t3code/packages/effect-codex-app-server","runtimeWorkspaceRoots":["/home/replay-user/t3code/packages/effect-codex-app-server"]}],"extra":null,"sessionId":"01a0d5ef-0ba3-7552-b090-7cfbb328e278","forkedFromId":null,"parentThreadId":null,"preview":"","ephemeral":false,"section":null,"sectionEnteredAt":null,"projectId":null,"historyMode":"paginated","modelProvider":"openai","model":"gpt-6-luna","reasoningEffort":null,"createdAt":1790295608,"updatedAt":1790295608,"recencyAt":1790295608,"status":{"type":"idle"},"path":"/home/replay-user/.codex/sessions/2026/09/24/rollout-2026-09-24T17-20-08-01a0d5ef-0ba3-7552-b090-7cfbb328e278.jsonl","cwd":"/home/replay-user/t3code/packages/effect-codex-app-server","cliVersion":"0.156.1","originator":"t3code_desktop","source":"vscode","canAcceptDirectInput":true,"threadSource":null,"agentNickname":null,"agentRole":null,"gitInfo":null,"name":null,"daybreakEnabled":null,"turns":[]},"model":"gpt-6-luna","modelProvider":"openai","serviceTier":null,"disabledPluginIds":[],"cwd":"/home/replay-user/t3code/packages/effect-codex-app-server","runtimeWorkspaceRoots":["/home/replay-user/t3code/packages/effect-codex-app-server"],"instructionSources":["/home/replay-user/.codex/AGENTS.md","/home/replay-user/t3code/AGENTS.md"],"approvalPolicy":"on-request","approvalsReviewer":"user","sandbox":{"type":"workspaceWrite","writableRoots":[],"networkAccess":false,"excludeTmpdirEnvVar":false,"excludeSlashTmp":false},"activePermissionProfile":{"id":":workspace","extends":null},"reasoningEffort":null,"multiAgentMode":"explicitRequestOnly"}}}
9 -{"type":"expect_outbound","label":"turn/start","frame":{"id":3,"method":"turn/start","params":{"approvalPolicy":"never","approvalsReviewer":"user","cwd":"<workspace>","input":[{"text":"Create a short implementation plan for adding deterministic replay fixtures. Do not ask questions. Present the final plan in a proposed plan block.","type":"text"}],"model":"gpt-6-luna","sandboxPolicy":{"networkAccess":false,"type":"readOnly"},"summary":"detailed","threadId":"01a0d5ef-0ba3-7552-b090-7cfbb328e278","collaborationMode":{"mode":"plan","settings":{"developer_instructions":"You are in Plan mode. Prefer request_user_input for clarifying questions. When presenting a complete plan, wrap it in <proposed_plan> and </proposed_plan>.","model":"gpt-6-luna","reasoning_effort":"medium"}}}}}
9 +{"type":"expect_outbound","label":"turn/start","frame":{"id":3,"method":"turn/start","params":{"approvalPolicy":"never","approvalsReviewer":"user","cwd":"<workspace>","input":[{"text":"Create a short implementation plan for adding deterministic replay fixtures. Do not ask questions. Present the final plan in a proposed plan block.","type":"text"}],"model":"gpt-6-luna","sandboxPolicy":{"networkAccess":false,"type":"readOnly"},"summary":"detailed","threadId":"01a0d5ef-0ba3-7552-b090-7cfbb328e278","collaborationMode":{"mode":"plan","settings":{"developer_instructions":"You are in Plan mode. Prefer request_user_input for clarifying questions. When presenting a complete plan, wrap it in <proposed_plan> and </proposed_plan>.","model":"gpt-6-luna"}}}}}
10 {"type":"emit_inbound","label":"mcpServer/startupStatus/updated","frame":{"method":"mcpServer/startupStatus/updated","params":{"threadId":"01a0d5ef-0ba3-7552-b090-7cfbb328e278","name":"codex_apps","status":"starting","error":null,"failureReason":null},"emittedAtMs":1790295608443}}
11 {"type":"emit_inbound","label":"thread/started","frame":{"method":"thread/started","params":{"thread":{"id":"01a0d5ef-0ba3-7552-b090-7cfbb328e278","environments":[{"environmentId":"local","cwd":"/home/replay-user/t3code/packages/effect-codex-app-server","runtimeWorkspaceRoots":["/home/replay-user/t3code/packages/effect-codex-app-server"]}],"extra":null,"sessionId":"01a0d5ef-0ba3-7552-b090-7cfbb328e278","forkedFromId":null,"parentThreadId":null,"preview":"","ephemeral":false,"section":null,"sectionEnteredAt":null,"projectId":null,"historyMode":"paginated","modelProvider":"openai","model":"gpt-6-luna","reasoningEffort":null,"createdAt":1790295608,"updatedAt":1790295608,"recencyAt":1790295608,"status":{"type":"idle"},"path":"/home/replay-user/.codex/sessions/2026/09/24/rollout-2026-09-24T17-20-08-01a0d5ef-0ba3-7552-b090-7cfbb328e278.jsonl","cwd":"/home/replay-user/t3code/packages/effect-codex-app-server","cliVersion":"0.156.1","originator":"t3code_desktop","source":"vscode","canAcceptDirectInput":true,"threadSource":null,"agentNickname":null,"agentRole":null,"gitInfo":null,"name":null,"daybreakEnabled":null,"turns":[]}},"emittedAtMs":1790295608443}}
12 {"type":"emit_inbound","label":"thread/settings/updated","frame":{"method":"thread/settings/updated","params":{"threadId":"01a0d5ef-0ba3-7552-b090-7cfbb328e278","threadSettings":{"disabledPluginIds":[],"cwd":"/home/replay-user/t3code/packages/effect-codex-app-server","approvalPolicy":"never","approvalsReviewer":"user","sandboxPolicy":{"type":"readOnly","networkAccess":false},"activePermissionProfile":null,"model":"gpt-6-luna","modelProvider":"openai","serviceTier":null,"effort":"medium","summary":"detailed","collaborationMode":{"mode":"plan","settings":{"model":"gpt-6-luna","reasoning_effort":"medium","developer_instructions":"You are in Plan mode. Prefer request_user_input for clarifying questions. When presenting a complete plan, wrap it in <proposed_plan> and </proposed_plan>."}},"multiAgentMode":"explicitRequestOnly","personality":null}},"emittedAtMs":1790295608464}}
apps/server/src/provider/CodexDeveloperInstructions.ts
+1 -1
@@ -190,7 +190,7 @@ In Default mode, strongly prefer making reasonable assumptions and executing the
190 export interface CodexRuntimeInfo {
191 readonly model: string;
192 readonly modelName?: string | undefined;
193 - readonly reasoningEffort: string;
193 + readonly reasoningEffort?: string | undefined;
194 }
195
196 export function buildCodexDeveloperInstructions(interactionMode: ProviderInteractionMode): string {
apps/server/src/provider/CodexProvider.ts
+5 -1
@@ -160,12 +160,16 @@ function codexAccountEmail(account: CodexSchema.V2GetAccountResponse["account"])
160 return account.email;
161 }
162
163 +export function codexDefaultReasoningEffortOverride(model: string): "medium" | undefined {
164 + return codexModelFamily(model) === "gpt-6-astra" ? "medium" : undefined;
165 +}
166 +
167 export function mapCodexModelCapabilities(
168 model: CodexSchema.V2ModelListResponse__Model,
169 ): ModelCapabilities {
170 const reasoningOptions = model.supportedReasoningEfforts.map(({ reasoningEffort }) =>
171 reasoningEffort ===
168 - (codexModelFamily(model.model) === "gpt-6-astra" ? "medium" : model.defaultReasoningEffort)
172 + (codexDefaultReasoningEffortOverride(model.model) ?? model.defaultReasoningEffort)
173 ? {
174 id: reasoningEffort,
175 label: reasoningEffortLabel(reasoningEffort),