Skip to content
TypeScript

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

Craig Davisonff9f41b65f7d
diff --git a/apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.test.ts b/apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.test.ts
index c0dbc441fdc..a0d76a419b9 100644
--- a/apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.test.ts
+++ b/apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.test.ts
@@ -67,6 +67,7 @@ import * as ProviderReplayHarness from "../testkit/ProviderReplayHarness.ts";
import * as ProviderAdapter from "@t3tools/provider-core/server/ProviderAdapter";
import type * as ProviderContinuationRequests from "@t3tools/provider-core/server/ProviderContinuationRequests";
import * as CodexAdapterV2 from "./CodexAdapterV2.ts";
+import { mapCodexModelCapabilities } from "../../provider/CodexProvider.ts";
import { makeReplayServerConfig, withCodexReplayChildMetadata } from "./CodexAdapterV2.testkit.ts";
import * as CodexAdapterV2Testkit from "./CodexAdapterV2.testkit.ts";
@@ -587,55 +588,138 @@ describe("CodexAdapterV2 runtime policy", () => {
assert.equal(params.collaborationMode?.mode, "plan");
assert.notProperty(params.collaborationMode?.settings, "developer_instructions");
+ assert.notProperty(params.collaborationMode?.settings, "reasoning_effort");
+ assert.isUndefined(params.effort);
}),
);
- it.effect("compiles per-turn Codex model options and cwd from their owning inputs", () =>
- Effect.gen(function* () {
- const params = yield* CodexAdapterV2.buildCodexTurnStartParams({
- nativeThreadId: "native-model-options",
- codexInput: [{ type: "text", text: "test" }],
- runtimePolicy: {
- runtimeMode: "full-access",
- interactionMode: "plan",
- cwd: "/workspace/model-options",
- reasoningEffort: "low",
- },
- modelSelection: {
- instanceId: ProviderInstanceId.make("codex"),
- model: "gpt-5.4",
- options: [
- { id: "reasoningEffort", value: "xhigh" },
- { id: "serviceTier", value: "priority" },
- ],
- },
- });
+ it.effect.each(["default", "plan"] as const)(
+ "compiles per-turn Codex model options and cwd from their owning inputs in %s mode",
+ (interactionMode) =>
+ Effect.gen(function* () {
+ const params = yield* CodexAdapterV2.buildCodexTurnStartParams({
+ nativeThreadId: "native-model-options",
+ hasT3Mcp: true,
+ codexInput: [{ type: "text", text: "test" }],
+ runtimePolicy: {
+ runtimeMode: "full-access",
+ interactionMode,
+ cwd: "/workspace/model-options",
+ reasoningEffort: "low",
+ },
+ modelSelection: {
+ instanceId: ProviderInstanceId.make("codex"),
+ model: "gpt-5.4",
+ options: [
+ { id: "reasoningEffort", value: "xhigh" },
+ { id: "serviceTier", value: "priority" },
+ ],
+ },
+ });
- assert.equal(params.model, "gpt-5.4");
- assert.equal(params.effort, "xhigh");
- assert.equal(params.serviceTier, "priority");
- assert.equal(params.cwd, "/workspace/model-options");
- assert.equal(params.collaborationMode?.settings.model, "gpt-5.4");
- assert.equal(params.collaborationMode?.settings.reasoning_effort, "xhigh");
+ assert.equal(params.model, "gpt-5.4");
+ assert.equal(params.effort, "xhigh");
+ assert.equal(params.serviceTier, "priority");
+ assert.equal(params.cwd, "/workspace/model-options");
+ assert.equal(params.collaborationMode?.settings.model, "gpt-5.4");
+ assert.equal(params.collaborationMode?.mode, interactionMode);
+ assert.equal(params.collaborationMode?.settings.reasoning_effort, "xhigh");
+ assert.include(
+ params.additionalContext?.t3_code_runtime?.value ?? "",
+ "as gpt-5.4 with xhigh reasoning effort",
+ );
- const managed = yield* CodexAdapterV2.buildCodexTurnStartParams({
- nativeThreadId: "native-model-options",
- codexInput: [{ type: "text", text: "test" }],
- runtimePolicy: {
- runtimeMode: "full-access",
- interactionMode: "default",
- cwd: "/workspace/model-options",
- },
- modelSelection: {
- instanceId: ProviderInstanceId.make("codex"),
- model: "gpt-5.4",
- options: [{ id: "serviceTier", value: "priority" }],
- },
- omitServiceTier: true,
+ const managed = yield* CodexAdapterV2.buildCodexTurnStartParams({
+ nativeThreadId: "native-model-options",
+ codexInput: [{ type: "text", text: "test" }],
+ runtimePolicy: {
+ runtimeMode: "full-access",
+ interactionMode: "default",
+ cwd: "/workspace/model-options",
+ },
+ modelSelection: {
+ instanceId: ProviderInstanceId.make("codex"),
+ model: "gpt-5.4",
+ options: [{ id: "serviceTier", value: "priority" }],
+ },
+ omitServiceTier: true,
+ });
+ assert.equal(managed.serviceTier, undefined);
+ }),
+ );
+
+ it.effect("uses Astra's advertised effort default while preserving explicit selections", () =>
+ Effect.gen(function* () {
+ const model = "gpt-6-astra";
+ const capabilities = mapCodexModelCapabilities({
+ id: model,
+ model,
+ displayName: model,
+ description: "Test model",
+ hidden: false,
+ isDefault: true,
+ defaultReasoningEffort: "low",
+ supportedReasoningEfforts: ["low", "medium", "high"].map((reasoningEffort) => ({
+ reasoningEffort,
+ description: reasoningEffort,
+ })),
+ additionalSpeedTiers: [],
});
- assert.equal(managed.serviceTier, undefined);
+ const advertised = capabilities.optionDescriptors?.find(
+ (option) => option.id === "reasoningEffort",
+ )?.currentValue;
+ assert.equal(advertised, "medium");
+ for (const selected of [undefined, "high"] as const) {
+ const params = yield* CodexAdapterV2.buildCodexTurnStartParams({
+ nativeThreadId: "native-astra-effort",
+ codexInput: [{ type: "text", text: "test" }],
+ runtimePolicy: { runtimeMode: "full-access", interactionMode: "default", cwd: null },
+ modelSelection: {
+ instanceId: ProviderInstanceId.make("codex"),
+ model,
+ ...(selected ? { options: [{ id: "reasoningEffort", value: selected }] } : {}),
+ },
+ hasT3Mcp: true,
+ });
+ const expected = selected ?? advertised;
+ assert.equal(params.effort, expected);
+ assert.equal(params.collaborationMode?.settings.reasoning_effort, expected);
+ assert.include(
+ params.additionalContext?.t3_code_runtime?.value ?? "",
+ `${expected} reasoning effort`,
+ );
+ }
}),
);
+
+ it.effect.each(["default", "plan"] as const)(
+ "omits unset effort from T3 %s collaboration settings and runtime context",
+ (interactionMode) =>
+ Effect.gen(function* () {
+ const params = yield* CodexAdapterV2.buildCodexTurnStartParams({
+ nativeThreadId: "native-unset-effort",
+ codexInput: [{ type: "text", text: "test" }],
+ runtimePolicy: {
+ runtimeMode: "full-access",
+ interactionMode,
+ cwd: null,
+ },
+ modelSelection: {
+ instanceId: ProviderInstanceId.make("codex"),
+ model: "gpt-5.4",
+ },
+ hasT3Mcp: true,
+ });
+
+ assert.isUndefined(params.effort);
+ assert.equal(params.collaborationMode?.mode, interactionMode);
+ assert.equal(params.collaborationMode?.settings.model, "gpt-5.4");
+ assert.notProperty(params.collaborationMode?.settings, "reasoning_effort");
+ const runtimeContext = params.additionalContext?.t3_code_runtime?.value ?? "";
+ assert.include(runtimeContext, "as gpt-5.4");
+ assert.notInclude(runtimeContext, "reasoning effort");
+ }),
+ );
});
describe("CodexAdapterV2 process spawning", () => {
diff --git a/apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.ts b/apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.ts
index 994ec334246..c228c038fa8 100644
--- a/apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.ts
+++ b/apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.ts
@@ -17,6 +17,7 @@ import type { CodexEffectiveRuntime } from "../../provider/CodexManagedRuntime.t
import {
buildCodexInitializeParams,
codexAppServerEnvironment,
+ codexDefaultReasoningEffortOverride,
} from "../../provider/CodexProvider.ts";
import {
codexRateLimitsToUpdate,
@@ -738,10 +739,9 @@ export function buildCodexTurnStartParams(input: {
input.runtimePolicy.sandboxPolicy === undefined
? runtimeModeDefaults.sandboxPolicy
: yield* decodeTurnSandboxPolicy(input.runtimePolicy.sandboxPolicy);
- const selectedEffort = getModelSelectionStringOptionValue(
- input.modelSelection,
- "reasoningEffort",
- );
+ const selectedEffort =
+ getModelSelectionStringOptionValue(input.modelSelection, "reasoningEffort") ??
+ codexDefaultReasoningEffortOverride(input.modelSelection.model);
const effort =
selectedEffort === undefined ? undefined : yield* decodeTurnReasoningEffort(selectedEffort);
const serviceTier =
@@ -764,7 +764,7 @@ export function buildCodexTurnStartParams(input: {
const t3Context =
input.hasT3Mcp === true
? buildCodexAdditionalContext(
- { model: input.modelSelection.model, reasoningEffort: effort ?? "medium" },
+ { model: input.modelSelection.model, reasoningEffort: effort ?? undefined },
{
browser: input.browserToolsAvailable ?? true,
device: input.deviceToolsAvailable ?? false,
@@ -782,7 +782,8 @@ export function buildCodexTurnStartParams(input: {
mode: input.runtimePolicy.interactionMode === "plan" ? "plan" : "default",
settings: {
model: input.modelSelection.model,
- reasoning_effort: effort ?? "medium",
+ // Codex falls back to the model's default effort when this is left out.
+ ...(effort === undefined ? {} : { reasoning_effort: effort }),
...(developerInstructions === undefined
? {}
: { developer_instructions: developerInstructions }),
diff --git a/apps/server/src/orchestration-v2/testkit/fixtures/plan_questions/codex_transcript.ndjson b/apps/server/src/orchestration-v2/testkit/fixtures/plan_questions/codex_transcript.ndjson
index 20cd1b3d01e..9a1cf76a2f1 100644
--- a/apps/server/src/orchestration-v2/testkit/fixtures/plan_questions/codex_transcript.ndjson
+++ b/apps/server/src/orchestration-v2/testkit/fixtures/plan_questions/codex_transcript.ndjson
@@ -6,7 +6,7 @@
{"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}}
{"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}}
{"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"}}}
-{"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"}}}}}
+{"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"}}}}}
{"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}}
{"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}}
{"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}}
diff --git a/apps/server/src/orchestration-v2/testkit/fixtures/proposed_plan/codex_transcript.ndjson b/apps/server/src/orchestration-v2/testkit/fixtures/proposed_plan/codex_transcript.ndjson
index 3b735c752e1..d0911eddbe7 100644
--- a/apps/server/src/orchestration-v2/testkit/fixtures/proposed_plan/codex_transcript.ndjson
+++ b/apps/server/src/orchestration-v2/testkit/fixtures/proposed_plan/codex_transcript.ndjson
@@ -6,7 +6,7 @@
{"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}}
{"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}}
{"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"}}}
-{"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"}}}}}
+{"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"}}}}}
{"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}}
{"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}}
{"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}}
diff --git a/apps/server/src/provider/CodexDeveloperInstructions.ts b/apps/server/src/provider/CodexDeveloperInstructions.ts
index 7db4563cb44..5c9f51e5523 100644
--- a/apps/server/src/provider/CodexDeveloperInstructions.ts
+++ b/apps/server/src/provider/CodexDeveloperInstructions.ts
@@ -190,7 +190,7 @@ In Default mode, strongly prefer making reasonable assumptions and executing the
export interface CodexRuntimeInfo {
readonly model: string;
readonly modelName?: string | undefined;
- readonly reasoningEffort: string;
+ readonly reasoningEffort?: string | undefined;
}
export function buildCodexDeveloperInstructions(interactionMode: ProviderInteractionMode): string {
diff --git a/apps/server/src/provider/CodexProvider.ts b/apps/server/src/provider/CodexProvider.ts
index f4f123dc1a2..33a0ce8edad 100644
--- a/apps/server/src/provider/CodexProvider.ts
+++ b/apps/server/src/provider/CodexProvider.ts
@@ -160,12 +160,16 @@ function codexAccountEmail(account: CodexSchema.V2GetAccountResponse["account"])
return account.email;
}
+export function codexDefaultReasoningEffortOverride(model: string): "medium" | undefined {
+ return codexModelFamily(model) === "gpt-6-astra" ? "medium" : undefined;
+}
+
export function mapCodexModelCapabilities(
model: CodexSchema.V2ModelListResponse__Model,
): ModelCapabilities {
const reasoningOptions = model.supportedReasoningEfforts.map(({ reasoningEffort }) =>
reasoningEffort ===
- (codexModelFamily(model.model) === "gpt-6-astra" ? "medium" : model.defaultReasoningEffort)
+ (codexDefaultReasoningEffortOverride(model.model) ?? model.defaultReasoningEffort)
? {
id: reasoningEffort,
label: reasoningEffortLabel(reasoningEffort),