`ActionOpenPage` mismatched API response
Confirm this is an issue with the Python library and not an underlying OpenAI API
- [x] This is an issue with the Python library
Describe the bug
I got a open_page with "url": null when using official API, so I believe the SDK should count for that. Currently, it was required.
https://github.com/openai/openai-python/blob/847ff0b83841d9262ba0d9c4fdf46f0478004ad0/src/openai/types/responses/response_function_web_search.py#L35
{
"id": "ws_68c2a7a61e888197b3e9ef5afd5492360a7d1f9fc76c2c97",
"type": "web_search_call",
"status": "completed",
"action": {
"type": "open_page",
"url": null
}
}
To Reproduce
I was using o4-mini-deep-research from Batch API, with web_search_preview enabled.
Alternatively, for OpenAI folks with permission, maybe you could check ws_68c2a7a61e888197b3e9ef5afd5492360a7d1f9fc76c2c97.
Code snippets
OS
Windows
Python version
3.13.5
Library version
1.107.1
Describe the bug
I confirm this bug is still in latest pydantic definitions. So far I have encountered:
- Missing
find_in_pageaction ActionSearch.queryisNoneActionOpenPage.urlisNone
The generated Pydantic classes should explicitly allow None and support the find_in_page action.
OS Linux
Python version 3.12
pydantic version 2.12.0
openai library version 2.9.0
To reproduce Query OpenAI and include 'web_search_call.action.sources'
Code snippets
prompt = 'Investigate about this complex subject ...'
resp = OpenAI().responses.create(
model='gpt-5.1'
reasoning={'effort': 'high'}
tool_choice='auto',
tools=[
{
'type': 'web_search',
'search_context_size': 'high',
'user_location': {'type': 'approximate', 'country': 'ca'},
}
],
include=['web_search_call.action.sources'],
input=prompt,
store=False,
)
Thanks for the report and the follow-up details!
This SDK mismatch was addressed in #2833 and released in v2.17.0. ActionOpenPage.url is now typed as optional, so responses containing "type": "open_page" with "url": null are accepted. That update also corrected support for the find_in_page action; the later nullable ActionSearch.query mismatch has since been corrected as well.
I reproduced the original failure with v1.107.1 and verified that the reported payload now parses successfully with the current SDK, including with strict response validation enabled.
Closing this as fixed. Thanks again for helping us catch this!