Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

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

sayan-oai66ff8b0f5467
diff --git a/codex-rs/app-server/tests/suite/v2/web_search.rs b/codex-rs/app-server/tests/suite/v2/web_search.rs
index 52c327a93f..58b2ff91a8 100644
--- a/codex-rs/app-server/tests/suite/v2/web_search.rs
+++ b/codex-rs/app-server/tests/suite/v2/web_search.rs
@@ -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()
diff --git a/codex-rs/ext/web-search/src/extension.rs b/codex-rs/ext/web-search/src/extension.rs
index 228d77897b..b7b6c83951 100644
--- a/codex-rs/ext/web-search/src/extension.rs
+++ b/codex-rs/ext/web-search/src/extension.rs
@@ -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,