Render Codex web searches as common tools

This commit is contained in:
iris committed 2026-09-11 02:31:21 -04:00
1 parent 6226a1cb43
commit 57e1cec09c
2 files changed
+18 -1

No files matched your search

+15 -1
View File
@@ -268,7 +268,7 @@ fn tool(item: &Value) -> Option<(String, String, Value)> {
json!({"path": item.get("path").cloned().unwrap_or(Value::Null)}),
),
"web_search" | "webSearch" => (
"web_search".to_string(),
"WebSearch".to_string(),
json!({"query": item.get("query").cloned().unwrap_or(Value::Null)}),
),
"todo_list" | "todoList" | "plan" => ("update_plan".to_string(), item.clone()),
@@ -611,6 +611,20 @@ mod tests {
);
}
#[test]
fn web_search_uses_the_common_tool_shape() {
assert_eq!(
tool(&line(
r#"{"id":"search-1","type":"webSearch","query":"Codex app-server protocol"}"#,
)),
Some((
"search-1".to_string(),
"WebSearch".to_string(),
json!({"query": "Codex app-server protocol"})
))
);
}
#[test]
fn a_file_change_becomes_the_common_patch_shape() {
let mut translator = Translator::default();