make direct only allowed caller for standalone websearch (#24646)

only allow `Direct` callers of the standalone websearch tool because its
not supported in codemode
This commit is contained in:
sayan-oai
2026-05-26 14:05:40 -07:00
committed by GitHub
parent 1911021c0e
commit 66ff8b0f54
2 changed files with 6 additions and 0 deletions

View File

@@ -128,6 +128,10 @@ async fn standalone_web_search_round_trips_encrypted_output() -> Result<()> {
"search_query": [{"q": "standalone web search"}],
})
);
assert_eq!(
search_body["settings"]["allowed_callers"],
json!(["direct"])
);
assert_eq!(
search_body["input"]
.as_array()

View File

@@ -1,5 +1,6 @@
use std::sync::Arc;
use codex_api::AllowedCaller;
use codex_api::ApproximateLocation;
use codex_api::LocationType;
use codex_api::SearchContextSize;
@@ -71,6 +72,7 @@ fn search_settings(config: &Config, web_search_mode: WebSearchMode) -> SearchSet
allowed_domains: filters.allowed_domains.clone(),
blocked_domains: None,
}),
allowed_callers: Some(vec![AllowedCaller::Direct]),
external_web_access: Some(match web_search_mode {
WebSearchMode::Live => true,
WebSearchMode::Cached | WebSearchMode::Disabled => false,