Fix codex mcp default model

This commit is contained in:
Mohamed Boudra
2025-12-24 18:58:49 +07:00
parent 75c2a96068
commit 899dafff35
3 changed files with 13 additions and 4 deletions
@@ -504,7 +504,7 @@ describe("CodexMcpAgentClient (MCP integration)", () => {
provider: "codex-mcp",
cwd,
modeId: "full-access",
model: "gpt-4.1",
model: "gpt-5.1-codex",
} as AgentSessionConfig;
let session: AgentSession | null = null;
@@ -87,6 +87,7 @@ const CODEX_MODES: AgentMode[] = [
];
const DEFAULT_CODEX_MODE_ID = "auto";
const DEFAULT_CODEX_MODEL_ID = "gpt-5.1-codex";
const MODE_PRESETS: Record<
string,
@@ -221,7 +222,7 @@ function buildCodexMcpConfig(
return {
prompt,
cwd: config.cwd,
model: config.model,
model: config.model ?? DEFAULT_CODEX_MODEL_ID,
"approval-policy": approvalPolicy,
sandbox,
config: extra,
@@ -716,7 +717,7 @@ class CodexMcpAgentSession implements AgentSession {
this.updateIdentifiersFromResponse(response);
if (this.modelRejected && !this.runtimeModel) {
this.runtimeModel = "default";
this.runtimeModel = DEFAULT_CODEX_MODEL_ID;
}
if (!turnState.sawAssistant) {