From 29ca89c414b9a2c1ca54b6ca7b972d60fa9a9986 Mon Sep 17 00:00:00 2001 From: Dylan Hurd Date: Tue, 18 Nov 2025 12:46:02 -0800 Subject: [PATCH] chore(config) enable shell_command (#6843) ## Summary Enables shell_command as default for `gpt-5*` and `codex-*` models. ## Testing - [x] Updated unit tests --- codex-rs/core/src/model_family.rs | 7 +++++-- codex-rs/core/src/tools/spec.rs | 20 ++++---------------- codex-rs/core/tests/suite/model_tools.rs | 16 +++------------- codex-rs/core/tests/suite/prompt_caching.rs | 8 ++++---- 4 files changed, 16 insertions(+), 35 deletions(-) diff --git a/codex-rs/core/src/model_family.rs b/codex-rs/core/src/model_family.rs index 0758d2031..ee827ff10 100644 --- a/codex-rs/core/src/model_family.rs +++ b/codex-rs/core/src/model_family.rs @@ -149,6 +149,7 @@ pub fn find_family_for_model(slug: &str) -> Option { "test_sync_tool".to_string(), ], supports_parallel_tool_calls: true, + shell_type: ConfigShellToolType::ShellCommand, support_verbosity: true, truncation_policy: TruncationPolicy::Tokens(10_000), ) @@ -166,7 +167,7 @@ pub fn find_family_for_model(slug: &str) -> Option { "list_dir".to_string(), "read_file".to_string(), ], - shell_type: if cfg!(windows) { ConfigShellToolType::ShellCommand } else { ConfigShellToolType::Default }, + shell_type: ConfigShellToolType::ShellCommand, supports_parallel_tool_calls: true, support_verbosity: true, truncation_policy: TruncationPolicy::Tokens(10_000), @@ -183,7 +184,7 @@ pub fn find_family_for_model(slug: &str) -> Option { reasoning_summary_format: ReasoningSummaryFormat::Experimental, base_instructions: GPT_5_CODEX_INSTRUCTIONS.to_string(), apply_patch_tool_type: Some(ApplyPatchToolType::Freeform), - shell_type: if cfg!(windows) { ConfigShellToolType::ShellCommand } else { ConfigShellToolType::Default }, + shell_type: ConfigShellToolType::ShellCommand, supports_parallel_tool_calls: true, support_verbosity: false, truncation_policy: TruncationPolicy::Tokens(10_000), @@ -198,6 +199,7 @@ pub fn find_family_for_model(slug: &str) -> Option { base_instructions: GPT_5_1_INSTRUCTIONS.to_string(), default_reasoning_effort: Some(ReasoningEffort::Medium), truncation_policy: TruncationPolicy::Bytes(10_000), + shell_type: ConfigShellToolType::ShellCommand, supports_parallel_tool_calls: true, ) } else if slug.starts_with("gpt-5") { @@ -205,6 +207,7 @@ pub fn find_family_for_model(slug: &str) -> Option { slug, "gpt-5", supports_reasoning_summaries: true, needs_special_apply_patch_instructions: true, + shell_type: ConfigShellToolType::ShellCommand, support_verbosity: true, truncation_policy: TruncationPolicy::Bytes(10_000), ) diff --git a/codex-rs/core/src/tools/spec.rs b/codex-rs/core/src/tools/spec.rs index 88ddbf551..32bcd6a24 100644 --- a/codex-rs/core/src/tools/spec.rs +++ b/codex-rs/core/src/tools/spec.rs @@ -1292,11 +1292,7 @@ mod tests { "gpt-5-codex", &Features::with_defaults(), &[ - if cfg!(windows) { - "shell_command" - } else { - "shell" - }, + "shell_command", "list_mcp_resources", "list_mcp_resource_templates", "read_mcp_resource", @@ -1313,11 +1309,7 @@ mod tests { "gpt-5.1-codex", &Features::with_defaults(), &[ - if cfg!(windows) { - "shell_command" - } else { - "shell" - }, + "shell_command", "list_mcp_resources", "list_mcp_resource_templates", "read_mcp_resource", @@ -1392,11 +1384,7 @@ mod tests { "gpt-5.1-codex-mini", &Features::with_defaults(), &[ - if cfg!(windows) { - "shell_command" - } else { - "shell" - }, + "shell_command", "list_mcp_resources", "list_mcp_resource_templates", "read_mcp_resource", @@ -1413,7 +1401,7 @@ mod tests { "gpt-5.1", &Features::with_defaults(), &[ - "shell", + "shell_command", "list_mcp_resources", "list_mcp_resource_templates", "read_mcp_resource", diff --git a/codex-rs/core/tests/suite/model_tools.rs b/codex-rs/core/tests/suite/model_tools.rs index 28593a55b..3f5845b86 100644 --- a/codex-rs/core/tests/suite/model_tools.rs +++ b/codex-rs/core/tests/suite/model_tools.rs @@ -119,12 +119,7 @@ async fn model_selects_expected_tools() { assert_eq!( gpt5_codex_tools, vec![ - if cfg!(windows) { - "shell_command" - } else { - "shell" - } - .to_string(), + "shell_command".to_string(), "list_mcp_resources".to_string(), "list_mcp_resource_templates".to_string(), "read_mcp_resource".to_string(), @@ -138,12 +133,7 @@ async fn model_selects_expected_tools() { assert_eq!( gpt51_codex_tools, vec![ - if cfg!(windows) { - "shell_command" - } else { - "shell" - } - .to_string(), + "shell_command".to_string(), "list_mcp_resources".to_string(), "list_mcp_resource_templates".to_string(), "read_mcp_resource".to_string(), @@ -157,7 +147,7 @@ async fn model_selects_expected_tools() { assert_eq!( gpt51_tools, vec![ - "shell".to_string(), + "shell_command".to_string(), "list_mcp_resources".to_string(), "list_mcp_resource_templates".to_string(), "read_mcp_resource".to_string(), diff --git a/codex-rs/core/tests/suite/prompt_caching.rs b/codex-rs/core/tests/suite/prompt_caching.rs index c858ea20f..d93c2bd79 100644 --- a/codex-rs/core/tests/suite/prompt_caching.rs +++ b/codex-rs/core/tests/suite/prompt_caching.rs @@ -162,7 +162,7 @@ async fn prompt_tools_are_consistent_across_requests() -> anyhow::Result<()> { ( "gpt-5.1", vec![ - "shell", + "shell_command", "list_mcp_resources", "list_mcp_resource_templates", "read_mcp_resource", @@ -173,7 +173,7 @@ async fn prompt_tools_are_consistent_across_requests() -> anyhow::Result<()> { ( "gpt-5.1", vec![ - "shell", + "shell_command", "list_mcp_resources", "list_mcp_resource_templates", "read_mcp_resource", @@ -185,7 +185,7 @@ async fn prompt_tools_are_consistent_across_requests() -> anyhow::Result<()> { ( "gpt-5.1-codex", vec![ - "shell", + "shell_command", "list_mcp_resources", "list_mcp_resource_templates", "read_mcp_resource", @@ -197,7 +197,7 @@ async fn prompt_tools_are_consistent_across_requests() -> anyhow::Result<()> { ( "gpt-5.1-codex", vec![ - "shell", + "shell_command", "list_mcp_resources", "list_mcp_resource_templates", "read_mcp_resource",