Confirm this is an issue with the Python library and not an underlying OpenAI API
The live Responses API can omit url on web_search_call actions of type find_in_page. The generated SDK type still requires it, so strict validation fails even though the API accepted/produced the item.
This is the same class of API/SDK drift as #2620 (open_page.url was required, API returned null) and the leftover gap after #2621 (find_in_page type was added, but url stayed required). Those were closed as fixed in v2.17.0. ActionFind.url is still str (required) on current main / v3.7.0.
Describe the bug
A completed hosted web search item can look like:
{
"id": "ws_0c54d33c372e53...",
"type": "web_search_call",
"status": "completed",
"action": {
"type": "find_in_page",
"pattern": "og:image"
}
}
ResponseFunctionWebSearch / ActionFind rejects this because url is missing.
This is easy to miss on the live streaming path (items can be constructed more loosely, then dumped with exclude_unset=True). It then blows up when the payload is re-validated, in particular openai-agents RunState.from_json() → ModelResponse(...) on resume after a pause.
ActionOpenPage.url was correctly made optional. ActionFind.url was not.
To Reproduce
- Run a Responses API / Agents SDK turn that uses hosted
web_search and performs a find_in_page action. The API may omit action.url.
- Serialize the run (
RunState.to_json() / model_dump(exclude_unset=True)).
- Restore with
RunState.from_json() or ResponseFunctionWebSearch.model_validate(...).
- Validation fails on
action.ActionFind.url with Field required.
Minimal local reproduction below does not need a live API call.
Code snippets
from openai.types.responses.response_function_web_search import ResponseFunctionWebSearch
ResponseFunctionWebSearch.model_validate(
{
"id": "ws_redacted",
"type": "web_search_call",
"status": "completed",
"action": {"type": "find_in_page", "pattern": "og:image"},
}
)
Observed (openai 2.45.0; same required field on current main):
pydantic_core.ValidationError: ... validation errors for ResponseFunctionWebSearch
action.ActionFind.url
Field required [type=missing, input_value={'type': 'find_in_page', 'pattern': 'og:image'}, input_type=dict]
Expected: either the API always includes url, or ActionFind.url is Optional[str] like ActionOpenPage.url.
OS
Linux
Python version
Python 3.13
Library version
openai v2.45.0 (also present on openai v3.7.0 / current main: ActionFind.url: str)
openai-agents v0.19.2 (restore path: RunState.from_json → ModelResponse)
Confirm this is an issue with the Python library and not an underlying OpenAI API
The live Responses API can omit
urlonweb_search_callactions of typefind_in_page. The generated SDK type still requires it, so strict validation fails even though the API accepted/produced the item.This is the same class of API/SDK drift as #2620 (
open_page.urlwas required, API returnednull) and the leftover gap after #2621 (find_in_pagetype was added, buturlstayed required). Those were closed as fixed in v2.17.0.ActionFind.urlis stillstr(required) on currentmain/ v3.7.0.Describe the bug
A completed hosted web search item can look like:
{ "id": "ws_0c54d33c372e53...", "type": "web_search_call", "status": "completed", "action": { "type": "find_in_page", "pattern": "og:image" } }ResponseFunctionWebSearch/ActionFindrejects this becauseurlis missing.This is easy to miss on the live streaming path (items can be constructed more loosely, then dumped with
exclude_unset=True). It then blows up when the payload is re-validated, in particularopenai-agentsRunState.from_json()→ModelResponse(...)on resume after a pause.ActionOpenPage.urlwas correctly made optional.ActionFind.urlwas not.To Reproduce
web_searchand performs afind_in_pageaction. The API may omitaction.url.RunState.to_json()/model_dump(exclude_unset=True)).RunState.from_json()orResponseFunctionWebSearch.model_validate(...).action.ActionFind.urlwithField required.Minimal local reproduction below does not need a live API call.
Code snippets
Observed (openai 2.45.0; same required field on current main):
Expected: either the API always includes
url, orActionFind.urlisOptional[str]likeActionOpenPage.url.OS
Linux
Python version
Python 3.13
Library version
openai v2.45.0 (also present on openai v3.7.0 / current main:
ActionFind.url: str)openai-agents v0.19.2 (restore path:
RunState.from_json→ModelResponse)