From 9b52b5246f487843571bc16195a198667f749e21 Mon Sep 17 00:00:00 2001 From: Winston Howes Date: Mon, 6 Jul 2026 13:09:09 -0700 Subject: [PATCH] core: use canonical indexed web access field --- codex-rs/core/src/tools/hosted_spec.rs | 4 ++-- codex-rs/core/src/tools/hosted_spec_tests.rs | 2 +- codex-rs/core/src/tools/spec_plan_tests.rs | 2 +- codex-rs/core/tests/suite/web_search.rs | 4 ++-- codex-rs/tools/src/tool_spec.rs | 6 +++--- codex-rs/tools/src/tool_spec_tests.rs | 5 +++-- 6 files changed, 12 insertions(+), 11 deletions(-) diff --git a/codex-rs/core/src/tools/hosted_spec.rs b/codex-rs/core/src/tools/hosted_spec.rs index 24a7905fa6eb..83996afccaf1 100644 --- a/codex-rs/core/src/tools/hosted_spec.rs +++ b/codex-rs/core/src/tools/hosted_spec.rs @@ -18,7 +18,7 @@ pub fn create_image_generation_tool(output_format: &str) -> ToolSpec { } pub fn create_web_search_tool(options: WebSearchToolOptions<'_>) -> Option { - let (external_web_access, index_gated_web_access) = match options.web_search_mode { + let (external_web_access, indexed_web_access) = match options.web_search_mode { Some(WebSearchMode::Cached) => (false, None), Some(WebSearchMode::Indexed) => (true, Some(true)), Some(WebSearchMode::Live) => (true, None), @@ -37,7 +37,7 @@ pub fn create_web_search_tool(options: WebSearchToolOptions<'_>) -> Option, #[serde(skip_serializing_if = "Option::is_none")] - index_gated_web_access: Option, + indexed_web_access: Option, #[serde(skip_serializing_if = "Option::is_none")] filters: Option, #[serde(skip_serializing_if = "Option::is_none")] diff --git a/codex-rs/tools/src/tool_spec_tests.rs b/codex-rs/tools/src/tool_spec_tests.rs index b6f599d5d5f9..406f92c52e8d 100644 --- a/codex-rs/tools/src/tool_spec_tests.rs +++ b/codex-rs/tools/src/tool_spec_tests.rs @@ -67,7 +67,7 @@ fn tool_spec_name_covers_all_variants() { assert_eq!( ToolSpec::WebSearch { external_web_access: Some(true), - index_gated_web_access: None, + indexed_web_access: None, filters: None, user_location: None, search_context_size: None, @@ -200,7 +200,7 @@ fn web_search_tool_spec_serializes_expected_wire_shape() { assert_eq!( serde_json::to_value(ToolSpec::WebSearch { external_web_access: Some(true), - index_gated_web_access: None, + indexed_web_access: Some(true), filters: Some(ResponsesApiWebSearchFilters { allowed_domains: Some(vec!["example.com".to_string()]), }), @@ -218,6 +218,7 @@ fn web_search_tool_spec_serializes_expected_wire_shape() { json!({ "type": "web_search", "external_web_access": true, + "indexed_web_access": true, "filters": { "allowed_domains": ["example.com"], },