Return standalone web search previews to clients#31516
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 93b16cecf3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| while lines | ||
| .peek() | ||
| .is_some_and(|line| search_result_header(line).is_none()) |
There was a problem hiding this comment.
Validate result headers before splitting snippets
When a standalone search snippet contains a line ending in ordinary parentheses, such as ... (Reuters), this delimiter treats it as the next result header before any URL validation. The parser then rejects that bogus header later and continues scanning for the next header, which drops that snippet line and any following non-header lines from the rendered preview. Search snippets are arbitrary source text, so only validated http(s) result headers should terminate snippet collection.
Useful? React with 👍 / 👎.
Summary
Stacked on #31515.
Model-context boundary
The standalone search function output sent back to the model is unchanged. Parsed previews are attached only to WebSearchItem.results for app rendering and persistence; this PR does not change ResponseItem, WebSearchAction, or Responses request construction.
Validation