Lightweight coding agent that runs in your terminal
Rust
Update ToolSearch to be enabled by default (#17854)
Matthew Zeng77fe33bf72a7
diff --git a/codex-rs/core/tests/suite/search_tool.rs b/codex-rs/core/tests/suite/search_tool.rsindex 74de499d70..624c439150 100644--- a/codex-rs/core/tests/suite/search_tool.rs+++ b/codex-rs/core/tests/suite/search_tool.rs@@ -93,7 +93,7 @@ fn tool_search_output_tools(request: &ResponsesRequest, call_id: &str) -> Vec<Va.unwrap_or_default()}-fn configure_apps_without_tool_search(config: &mut Config, apps_base_url: &str) {+fn configure_search_capable_apps(config: &mut Config, apps_base_url: &str) {config.features.enable(Feature::Apps)@@ -112,14 +112,18 @@ fn configure_apps_without_tool_search(config: &mut Config, apps_base_url: &str)config.model_catalog = Some(model_catalog);}-fn configure_apps(config: &mut Config, apps_base_url: &str) {- configure_apps_without_tool_search(config, apps_base_url);+fn configure_apps_without_tool_search(config: &mut Config, apps_base_url: &str) {+ configure_search_capable_apps(config, apps_base_url);config.features- .enable(Feature::ToolSearch)+ .disable(Feature::ToolSearch).expect("test config should allow feature update");}+fn configure_apps(config: &mut Config, apps_base_url: &str) {+ configure_search_capable_apps(config, apps_base_url);+}+fn configured_builder(apps_base_url: String) -> TestCodexBuilder {test_codex().with_auth(CodexAuth::create_dummy_chatgpt_auth_for_testing())@@ -127,7 +131,7 @@ fn configured_builder(apps_base_url: String) -> TestCodexBuilder {}#[tokio::test(flavor = "multi_thread", worker_threads = 2)]-async fn search_tool_flag_adds_tool_search() -> Result<()> {+async fn search_tool_enabled_by_default_adds_tool_search() -> Result<()> {skip_if_no_network!(Ok(()));let server = start_mock_server().await;@@ -185,7 +189,7 @@ async fn search_tool_flag_adds_tool_search() -> Result<()> {}#[tokio::test(flavor = "multi_thread", worker_threads = 2)]-async fn tool_search_disabled_by_default_exposes_apps_tools_directly() -> Result<()> {+async fn tool_search_disabled_exposes_apps_tools_directly() -> Result<()> {skip_if_no_network!(Ok(()));let server = start_mock_server().await;diff --git a/codex-rs/features/src/lib.rs b/codex-rs/features/src/lib.rsindex ce7a196362..2d1ac89851 100644--- a/codex-rs/features/src/lib.rs+++ b/codex-rs/features/src/lib.rs@@ -788,8 +788,8 @@ pub const FEATURES: &[FeatureSpec] = &[FeatureSpec {id: Feature::ToolSearch,key: "tool_search",- stage: Stage::UnderDevelopment,- default_enabled: false,+ stage: Stage::Stable,+ default_enabled: true,},FeatureSpec {id: Feature::UnavailableDummyTools,diff --git a/codex-rs/features/src/tests.rs b/codex-rs/features/src/tests.rsindex 85cb01be23..56f92d55b7 100644--- a/codex-rs/features/src/tests.rs+++ b/codex-rs/features/src/tests.rs@@ -128,9 +128,9 @@ fn tool_suggest_is_stable_and_enabled_by_default() {}#[test]-fn tool_search_is_under_development_and_disabled_by_default() {- assert_eq!(Feature::ToolSearch.stage(), Stage::UnderDevelopment);- assert_eq!(Feature::ToolSearch.default_enabled(), false);+fn tool_search_is_stable_and_enabled_by_default() {+ assert_eq!(Feature::ToolSearch.stage(), Stage::Stable);+ assert_eq!(Feature::ToolSearch.default_enabled(), true);}#[test]diff --git a/codex-rs/tools/src/tool_registry_plan_tests.rs b/codex-rs/tools/src/tool_registry_plan_tests.rsindex a643543ee7..50b38905ee 100644--- a/codex-rs/tools/src/tool_registry_plan_tests.rs+++ b/codex-rs/tools/src/tool_registry_plan_tests.rs@@ -1334,7 +1334,7 @@ fn search_tool_description_lists_each_mcp_source_once() {}#[test]-fn search_tool_requires_model_capability_and_feature_flag() {+fn search_tool_requires_model_capability_and_enabled_feature() {let model_info = search_capable_model_info();let deferred_mcp_tools = Some(vec![deferred_mcp_tool("_create_event",@@ -1367,10 +1367,12 @@ fn search_tool_requires_model_capability_and_feature_flag() {);assert_lacks_tool_name(&tools, TOOL_SEARCH_TOOL_NAME);+ let mut features_without_tool_search = Features::with_defaults();+ features_without_tool_search.disable(Feature::ToolSearch);let tools_config = ToolsConfig::new(&ToolsConfigParams {model_info: &model_info,available_models: &available_models,- features: &features,+ features: &features_without_tool_search,image_generation_tool_auth_allowed: true,web_search_mode: Some(WebSearchMode::Cached),session_source: SessionSource::Cli,@@ -1385,8 +1387,6 @@ fn search_tool_requires_model_capability_and_feature_flag() {);assert_lacks_tool_name(&tools, TOOL_SEARCH_TOOL_NAME);- let mut features = Features::with_defaults();- features.enable(Feature::ToolSearch);let tools_config = ToolsConfig::new(&ToolsConfigParams {model_info: &model_info,available_models: &available_models,