Skip to content

ActionFind.url is required but live find_in_page web_search_call items omit url #3788

Closed as duplicate

Description

@SvenDH

Confirm this is an issue with the Python library and not an underlying OpenAI API

  • This is an issue with the Python library

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

  1. 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.
  2. Serialize the run (RunState.to_json() / model_dump(exclude_unset=True)).
  3. Restore with RunState.from_json() or ResponseFunctionWebSearch.model_validate(...).
  4. 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)

Activity

  1. changed the title [-] is required but live web_search_call items omit [/-] [+]ActionFind.url is required but live find_in_page web_search_call items omit url[/+] on Sep 3, 2026
  2. aktaseren commented on Sep 5, 2026

    @aktaseren

    Confirmed, this looks like an SDK typing issue rather than an issue with the underlying Responses API. The API can return find_in_page without a url, so ActionFind.url should be optional, consistent with ActionOpenPage.url. PRs #3792 and #3797 look to address this.

  3. marcuswood-oai commented on Sep 15, 2026

    @marcuswood-oai
    Contributor

    Thanks for the detailed reproduction and for explaining how this interrupts restoring an Agents run. Validation rejects the saved item because the generated find_in_page type requires url. Your example captures that failure; the remaining question is whether the URL is absent in the original response or lost while saving the state.

    We’re closing this report to keep the investigation together in openai/openai-openapi#571, which preserves your reproduction. Please follow that issue for progress. If available, a sanitized comparison of the raw response, SDK item, and saved state would help identify the right correction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions