From 2567d2fdc4f5a3b087f402f1fd51623d8bf17fa8 Mon Sep 17 00:00:00 2001 From: Fouad Matin Date: Thu, 29 May 2025 15:38:11 -0700 Subject: [PATCH 1/3] fix(codex-rs): use codex-mini-latest as default --- codex-rs/README.md | 4 ++-- codex-rs/common/src/config_override.rs | 4 ++-- codex-rs/core/src/flags.rs | 2 +- codex-rs/core/src/protocol.rs | 4 ++-- codex-rs/mcp-server/src/codex_tool_config.rs | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/codex-rs/README.md b/codex-rs/README.md index a0e3f5846e0..a26f5b6d1da 100644 --- a/codex-rs/README.md +++ b/codex-rs/README.md @@ -32,7 +32,7 @@ The `config.toml` file supports the following options: The model that Codex should use. ```toml -model = "o3" # overrides the default of "o4-mini" +model = "o3" # overrides the default of "codex-mini-latest" ``` ### model_provider @@ -155,7 +155,7 @@ Users can specify config values at multiple levels. Order of precedence is as fo 1. custom command-line argument, e.g., `--model o3` 2. as part of a profile, where the `--profile` is specified via a CLI (or in the config file itself) 3. as an entry in `config.toml`, e.g., `model = "o3"` -4. the default value that comes with Codex CLI (i.e., Codex CLI defaults to `o4-mini`) +4. the default value that comes with Codex CLI (i.e., Codex CLI defaults to `codex-mini-latest`) ### sandbox_permissions diff --git a/codex-rs/common/src/config_override.rs b/codex-rs/common/src/config_override.rs index bd2c0369407..a6899291639 100644 --- a/codex-rs/common/src/config_override.rs +++ b/codex-rs/common/src/config_override.rs @@ -23,7 +23,7 @@ pub struct CliConfigOverrides { /// parse as JSON, the raw string is used as a literal. /// /// Examples: - /// - `-c model="o4-mini"` + /// - `-c model="codex-mini-latest"` /// - `-c 'sandbox_permissions=["disk-full-read-access"]'` /// - `-c shell_environment_policy.inherit=all` #[arg( @@ -61,7 +61,7 @@ impl CliConfigOverrides { // Attempt to parse as JSON. If that fails, treat it as a raw // string. This allows convenient usage such as - // `-c model=o4-mini` without the quotes. + // `-c model=codex-mini-latest` without the quotes. let value: Value = match parse_toml_value(value_str) { Ok(v) => v, Err(_) => Value::String(value_str.to_string()), diff --git a/codex-rs/core/src/flags.rs b/codex-rs/core/src/flags.rs index e8cc973c993..c21ef670262 100644 --- a/codex-rs/core/src/flags.rs +++ b/codex-rs/core/src/flags.rs @@ -3,7 +3,7 @@ use std::time::Duration; use env_flags::env_flags; env_flags! { - pub OPENAI_DEFAULT_MODEL: &str = "o4-mini"; + pub OPENAI_DEFAULT_MODEL: &str = "codex-mini-latest"; pub OPENAI_API_BASE: &str = "https://api.openai.com/v1"; /// Fallback when the provider-specific key is not set. diff --git a/codex-rs/core/src/protocol.rs b/codex-rs/core/src/protocol.rs index 1b9871edd89..fc18f1d8212 100644 --- a/codex-rs/core/src/protocol.rs +++ b/codex-rs/core/src/protocol.rs @@ -561,7 +561,7 @@ mod tests { id: "1234".to_string(), msg: EventMsg::SessionConfigured(SessionConfiguredEvent { session_id, - model: "o4-mini".to_string(), + model: "codex-mini-latest".to_string(), history_log_id: 0, history_entry_count: 0, }), @@ -569,7 +569,7 @@ mod tests { let serialized = serde_json::to_string(&event).unwrap(); assert_eq!( serialized, - r#"{"id":"1234","msg":{"type":"session_configured","session_id":"67e55044-10b1-426f-9247-bb680e5fe0c8","model":"o4-mini","history_log_id":0,"history_entry_count":0}}"# + r#"{"id":"1234","msg":{"type":"session_configured","session_id":"67e55044-10b1-426f-9247-bb680e5fe0c8","model":"codex-mini-latest","history_log_id":0,"history_entry_count":0}}"# ); } } diff --git a/codex-rs/mcp-server/src/codex_tool_config.rs b/codex-rs/mcp-server/src/codex_tool_config.rs index 03e72344493..f0b4eb175c3 100644 --- a/codex-rs/mcp-server/src/codex_tool_config.rs +++ b/codex-rs/mcp-server/src/codex_tool_config.rs @@ -19,7 +19,7 @@ pub(crate) struct CodexToolCallParam { /// The *initial user prompt* to start the Codex conversation. pub prompt: String, - /// Optional override for the model name (e.g. "o3", "o4-mini") + /// Optional override for the model name (e.g. "o3", "codex-mini-latest") #[serde(default, skip_serializing_if = "Option::is_none")] pub model: Option, @@ -230,7 +230,7 @@ mod tests { "type": "string" }, "model": { - "description": "Optional override for the model name (e.g. \"o3\", \"o4-mini\")", + "description": "Optional override for the model name (e.g. \"o3\", \"codex-mini-latest\")", "type": "string" }, "profile": { From d9a2d76449155ca936aadd540a57d2077f8e28c0 Mon Sep 17 00:00:00 2001 From: Fouad Matin Date: Thu, 29 May 2025 16:15:22 -0700 Subject: [PATCH 2/3] fix: comments --- codex-rs/common/src/config_override.rs | 4 ++-- codex-rs/mcp-server/src/codex_tool_config.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/codex-rs/common/src/config_override.rs b/codex-rs/common/src/config_override.rs index a6899291639..610195d6d10 100644 --- a/codex-rs/common/src/config_override.rs +++ b/codex-rs/common/src/config_override.rs @@ -23,7 +23,7 @@ pub struct CliConfigOverrides { /// parse as JSON, the raw string is used as a literal. /// /// Examples: - /// - `-c model="codex-mini-latest"` + /// - `-c model="o3"` /// - `-c 'sandbox_permissions=["disk-full-read-access"]'` /// - `-c shell_environment_policy.inherit=all` #[arg( @@ -61,7 +61,7 @@ impl CliConfigOverrides { // Attempt to parse as JSON. If that fails, treat it as a raw // string. This allows convenient usage such as - // `-c model=codex-mini-latest` without the quotes. + // `-c model=o3` without the quotes. let value: Value = match parse_toml_value(value_str) { Ok(v) => v, Err(_) => Value::String(value_str.to_string()), diff --git a/codex-rs/mcp-server/src/codex_tool_config.rs b/codex-rs/mcp-server/src/codex_tool_config.rs index f0b4eb175c3..8e4ec302eac 100644 --- a/codex-rs/mcp-server/src/codex_tool_config.rs +++ b/codex-rs/mcp-server/src/codex_tool_config.rs @@ -19,7 +19,7 @@ pub(crate) struct CodexToolCallParam { /// The *initial user prompt* to start the Codex conversation. pub prompt: String, - /// Optional override for the model name (e.g. "o3", "codex-mini-latest") + /// Optional override for the model name (e.g. "o3", "o4-mini") #[serde(default, skip_serializing_if = "Option::is_none")] pub model: Option, From 7498cf5e5bfc9b96d80e216eb77a475a3e0eda67 Mon Sep 17 00:00:00 2001 From: Fouad Matin Date: Thu, 29 May 2025 16:50:31 -0700 Subject: [PATCH 3/3] fix: test --- codex-rs/mcp-server/src/codex_tool_config.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codex-rs/mcp-server/src/codex_tool_config.rs b/codex-rs/mcp-server/src/codex_tool_config.rs index 8e4ec302eac..03e72344493 100644 --- a/codex-rs/mcp-server/src/codex_tool_config.rs +++ b/codex-rs/mcp-server/src/codex_tool_config.rs @@ -230,7 +230,7 @@ mod tests { "type": "string" }, "model": { - "description": "Optional override for the model name (e.g. \"o3\", \"codex-mini-latest\")", + "description": "Optional override for the model name (e.g. \"o3\", \"o4-mini\")", "type": "string" }, "profile": {