[openai] Route inference-provider-native web search to Responses native web_search tool#26212
Conversation
…ve web_search tool
There was a problem hiding this comment.
🚩 No response-side handling for native web search output items
When web_search_preview is used as a native hosted tool, OpenAI's Responses API may return output items of type web_search_call in the stream (via response.output_item.added). The current stream handler at responses-provider.ts:209-222 only processes items where item?.type === 'function_call', so any web_search_call items would be silently ignored. This is likely fine because the native web search results are incorporated into the text output deltas automatically by OpenAI's server, so the final text content is still captured. However, if there's a need to surface web search metadata (URLs, sources) to the caller — similar to how Anthropic's provider emits server_tool_start/server_tool_complete events — this would need additional handling in a follow-up.
(Refers to lines 209-222)
Was this helpful? React with 👍 or 👎 to provide feedback.
6cd9b54
into
noanflaherty/managed-openai-native-web-search
* [managed] Enable OpenAI managed-proxy fallback routing in provider bootstrap (#26211) * [openai] Route inference-provider-native web search to Responses native web_search tool (#26212) * [macOS] Allow managed inference provider selection beyond Anthropic (#26218) * [macOS] Allow managed inference provider selection beyond Anthropic * fix: capture draftProvider before async Task to prevent race condition Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * [macOS] Allow provider-native web search when managed inference provider supports it (#26230) * [macOS] Allow provider-native web search when managed inference provider supports it * fix: gate mode-specific web search invalidation on modeChanging to prevent false-positive alerts Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: generalize alert message to cover both mode and provider changes * fix: scope provider-native invalidation to your-own web search mode --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: emit server_tool_start/complete events for OpenAI native web search (#26240) * fix: render web_search_call output items in LLM context diagnostics (#26243) * fix: add server_tool_use content blocks and tests for OpenAI native web search (#26246) * fix: diagnostics polish — web_search_call tests, tool count fix, loop consistency (#26250) * fix: emit paired web_search_tool_result blocks to prevent repairHistory corruption The OpenAI Responses provider emitted server_tool_use content blocks for web_search_call items but did not emit matching web_search_tool_result blocks. repairHistory() treats any unpaired server_tool_use as an interrupted search and injects a synthetic web_search_tool_result_error, which corrupts conversation history by making successful searches appear as failures. After each server_tool_use block, also emit a paired web_search_tool_result with empty content (since OpenAI weaves search results into the text output). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
Part of plan: managed-openai-native-web-search.md (PR 2 of 4)