litellm/tests/test_litellm/integrations/websearch_interception
Yuneng Jiang 201f60d19c
revert: restore search tool fallback when no router is configured
This reverts commit 65a46a5f32 (#38113)

That change made two edits that combine into a hard failure for SDK
users. It dropped the null-router guard in
_select_search_tool_from_router, so a missing router now yields an empty
search_tools list instead of returning early, and it turned the no-match
case in _select_search_tool_from_list from a debug-logged fallback into
a raised ValueError. It also added a call site in
async_pre_call_deployment_hook that invokes the selection purely for the
side effect of raising, discarding the return value

Used together, any SDK caller that sets search_tool_name and sends a web
search tool now raises "Configured search tool '<name>' was not found"
on every request. There is no way to satisfy the check off the proxy,
because search_tools is only ever populated from the proxy router, so
the SDK path cannot register one

tests/pass_through_unit_tests/test_websearch_interception_e2e.py caught
this, but #38113 only updated the handler unit tests, so the break
landed on staging

Reverting restores the previous behavior while we work out a fix that
keeps the stricter validation on the proxy path, where a silently
substituted search provider is the real problem worth rejecting, without
turning the SDK path into an unconditional error
2026-09-01 11:16:23 -07:00
..
test_websearch_agentic_loop_cap.py fix: keep accepting a loop ceiling that spells a whole number 2026-08-22 11:24:22 -07:00
test_websearch_chat_completion.py fix(websearch): websearch_interception agentic loop fixes for chat completions and anthropic messages (#31669) 2026-07-01 09:36:40 +08:00
test_websearch_interception_handler.py revert: restore search tool fallback when no router is configured 2026-09-01 11:16:23 -07:00
test_websearch_interception_thinking.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_websearch_native_blocks.py fix(websearch): restore snippet text in native web_search_tool_result blocks (LIT-5315) (#36228) 2026-08-07 17:28:55 -07:00
test_websearch_responses.py fix(websearch): address Responses review findings 2026-07-15 00:52:16 +00:00
test_websearch_short_circuit.py Emit native web_search_tool_result blocks for Anthropic clients (Claude Desktop / Cowork citations) (#27886) 2026-05-14 12:30:47 -07:00
test_websearch_streaming_wrap.py fix(websearch): wrap agentic loop response in fake stream for streaming requests (#31484) 2026-06-26 18:45:53 -07:00
test_websearch_thinking_constraint.py Emit native web_search_tool_result blocks for Anthropic clients (Claude Desktop / Cowork citations) (#27886) 2026-05-14 12:30:47 -07:00