Skip to content

Commit 77fe33b

Browse files
authored
Update ToolSearch to be enabled by default (#17854)
## Summary - Promote `Feature::ToolSearch` to `Stable` and enable it in the default feature set - Update feature tests and tool registry coverage to match the new default - Adjust the search-tool integration test to assert the default-on path and explicit disable fallback ## Testing - `just fmt` - `cargo test -p codex-features` - `cargo test -p codex-core --test all search_tool` - `cargo test -p codex-tools`
1 parent bd61737 commit 77fe33b

4 files changed

Lines changed: 19 additions & 15 deletions

File tree

codex-rs/core/tests/suite/search_tool.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ fn tool_search_output_tools(request: &ResponsesRequest, call_id: &str) -> Vec<Va
9393
.unwrap_or_default()
9494
}
9595

96-
fn configure_apps_without_tool_search(config: &mut Config, apps_base_url: &str) {
96+
fn configure_search_capable_apps(config: &mut Config, apps_base_url: &str) {
9797
config
9898
.features
9999
.enable(Feature::Apps)
@@ -112,22 +112,26 @@ fn configure_apps_without_tool_search(config: &mut Config, apps_base_url: &str)
112112
config.model_catalog = Some(model_catalog);
113113
}
114114

115-
fn configure_apps(config: &mut Config, apps_base_url: &str) {
116-
configure_apps_without_tool_search(config, apps_base_url);
115+
fn configure_apps_without_tool_search(config: &mut Config, apps_base_url: &str) {
116+
configure_search_capable_apps(config, apps_base_url);
117117
config
118118
.features
119-
.enable(Feature::ToolSearch)
119+
.disable(Feature::ToolSearch)
120120
.expect("test config should allow feature update");
121121
}
122122

123+
fn configure_apps(config: &mut Config, apps_base_url: &str) {
124+
configure_search_capable_apps(config, apps_base_url);
125+
}
126+
123127
fn configured_builder(apps_base_url: String) -> TestCodexBuilder {
124128
test_codex()
125129
.with_auth(CodexAuth::create_dummy_chatgpt_auth_for_testing())
126130
.with_config(move |config| configure_apps(config, apps_base_url.as_str()))
127131
}
128132

129133
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
130-
async fn search_tool_flag_adds_tool_search() -> Result<()> {
134+
async fn search_tool_enabled_by_default_adds_tool_search() -> Result<()> {
131135
skip_if_no_network!(Ok(()));
132136

133137
let server = start_mock_server().await;
@@ -185,7 +189,7 @@ async fn search_tool_flag_adds_tool_search() -> Result<()> {
185189
}
186190

187191
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
188-
async fn tool_search_disabled_by_default_exposes_apps_tools_directly() -> Result<()> {
192+
async fn tool_search_disabled_exposes_apps_tools_directly() -> Result<()> {
189193
skip_if_no_network!(Ok(()));
190194

191195
let server = start_mock_server().await;

codex-rs/features/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -788,8 +788,8 @@ pub const FEATURES: &[FeatureSpec] = &[
788788
FeatureSpec {
789789
id: Feature::ToolSearch,
790790
key: "tool_search",
791-
stage: Stage::UnderDevelopment,
792-
default_enabled: false,
791+
stage: Stage::Stable,
792+
default_enabled: true,
793793
},
794794
FeatureSpec {
795795
id: Feature::UnavailableDummyTools,

codex-rs/features/src/tests.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,9 @@ fn tool_suggest_is_stable_and_enabled_by_default() {
128128
}
129129

130130
#[test]
131-
fn tool_search_is_under_development_and_disabled_by_default() {
132-
assert_eq!(Feature::ToolSearch.stage(), Stage::UnderDevelopment);
133-
assert_eq!(Feature::ToolSearch.default_enabled(), false);
131+
fn tool_search_is_stable_and_enabled_by_default() {
132+
assert_eq!(Feature::ToolSearch.stage(), Stage::Stable);
133+
assert_eq!(Feature::ToolSearch.default_enabled(), true);
134134
}
135135

136136
#[test]

codex-rs/tools/src/tool_registry_plan_tests.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1334,7 +1334,7 @@ fn search_tool_description_lists_each_mcp_source_once() {
13341334
}
13351335

13361336
#[test]
1337-
fn search_tool_requires_model_capability_and_feature_flag() {
1337+
fn search_tool_requires_model_capability_and_enabled_feature() {
13381338
let model_info = search_capable_model_info();
13391339
let deferred_mcp_tools = Some(vec![deferred_mcp_tool(
13401340
"_create_event",
@@ -1367,10 +1367,12 @@ fn search_tool_requires_model_capability_and_feature_flag() {
13671367
);
13681368
assert_lacks_tool_name(&tools, TOOL_SEARCH_TOOL_NAME);
13691369

1370+
let mut features_without_tool_search = Features::with_defaults();
1371+
features_without_tool_search.disable(Feature::ToolSearch);
13701372
let tools_config = ToolsConfig::new(&ToolsConfigParams {
13711373
model_info: &model_info,
13721374
available_models: &available_models,
1373-
features: &features,
1375+
features: &features_without_tool_search,
13741376
image_generation_tool_auth_allowed: true,
13751377
web_search_mode: Some(WebSearchMode::Cached),
13761378
session_source: SessionSource::Cli,
@@ -1385,8 +1387,6 @@ fn search_tool_requires_model_capability_and_feature_flag() {
13851387
);
13861388
assert_lacks_tool_name(&tools, TOOL_SEARCH_TOOL_NAME);
13871389

1388-
let mut features = Features::with_defaults();
1389-
features.enable(Feature::ToolSearch);
13901390
let tools_config = ToolsConfig::new(&ToolsConfigParams {
13911391
model_info: &model_info,
13921392
available_models: &available_models,

0 commit comments

Comments
 (0)