From e2206b983c53df7497aae1a1d9c3ee9cf3df41b9 Mon Sep 17 00:00:00 2001 From: hamidzargar Date: Fri, 17 Jul 2026 22:39:32 -0400 Subject: [PATCH] fix(responses): make WebSearchActionFind.url optional The Responses API omits `url` on `find` / `find_in_page` web-search actions that continue within a page already opened by a prior `open_page` action. Because `WebSearchActionFind.url` is a required `String`, deserializing such a response fails with `missing field `url``, which aborts parsing of the entire response for any web search that uses find-in-page continuation. Make `url` an `Option`, mirroring the already-optional `WebSearchActionOpenPage::url`. No other code constructs the struct and `cargo check` passes. Cut on top of async-openai-v0.36.1 to match the sec workspace pin (`async-openai = "0.36.1"`); a patch built on a newer minor would not satisfy the `^0.36.1` requirement and cargo would silently drop it. Co-Authored-By: Claude Opus 4.8 (1M context) --- async-openai/src/types/responses/response.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/async-openai/src/types/responses/response.rs b/async-openai/src/types/responses/response.rs index 959d952d..8012ebbe 100644 --- a/async-openai/src/types/responses/response.rs +++ b/async-openai/src/types/responses/response.rs @@ -2001,8 +2001,11 @@ pub struct WebSearchActionOpenPage { #[derive(Debug, Serialize, Deserialize, Clone, PartialEq)] pub struct WebSearchActionFind { - /// The URL of the page searched for the pattern. - pub url: String, + /// The URL of the page searched for the pattern. Optional: the API omits it + /// for `find` / `find_in_page` actions that continue within a page already + /// opened by a prior `open_page` action. Mirrors the already-optional + /// `WebSearchActionOpenPage::url`. + pub url: Option, /// The pattern or text to search for within the page. pub pattern: String, }