8 views
-/https://github.com/berriai/litellm/issues/31902
GitHub · issue

#31902 [Bug]: websearch_interception short-circuit uses last user message as the search query instead of the model's web_search tool-call query (Claude Code returns "Did 0 searches" / off-topic results with github_copilot)

  • State: open
  • Author: @rkage
  • Labels: bug, proxy, llm translation, claude code

### Check for existing issues

- [x] I have searched the existing issues and checked that my issue is not a duplicate.

### What happened?

When Claude Code's native **WebSearch** is served through `websearch_interception` for a provider without native Anthropic Messages support (e.g. `github_copilot`), the short-circuit path runs the search against the **text of the last user message** instead of the **query the model placed in the `web_search` tool call**.

The result is that SearXNG/Tavily/etc. are queried with the wrong string. The search backend returns valid-but-irrelevant results (e.g. dictionary definitions for a stray word in the prompt), and Claude Code — receiving results that don't correspond to the query it asked for — reports **"Did 0 searches in NNNms"** and discards them.

This is distinct from #29649 (which reports the short-circuit skipping model *synthesis*). This issue is that the **search input itself is wrong**, upstream of synthesis. The two share the short-circuit code path but have different root causes.

## Root cause

In `try_short_circuit_search`, the query is extracted from the last user message:

`handler.py` (main [L151](https://github.com/BerriAI/lit…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (3 events)
#0 of 0 · 31d18h34m38s ago — entered · #import:https:::github.com:berriai:litellm post #2294
The right issue is harder because it introduces a cross-cutting policy layer involving configuration schema, precedence rules, parameter validation, provider transformations, and broad regression coverage. The left issue is comparatively localized to correcting data extraction in an existing interception path.
31902 requires tracing and correcting a cross-provider proxy/tool-call interception path, with compatibility handling and regression coverage; 26774 is comparatively localized to dashboard budget-update behavior and its API interaction.
#0 of 0 · 31d18h8m10s ago — current · #import:https:::github.com:berriai:litellm post #2720
The right issue is harder because it requires tracing and safely correcting an existing proxy interception flow, preserving tool-call semantics across provider translations, and adding regression coverage for multiple request paths. The left issue is comparatively bounded: an OpenAI-compatible provider mainly needs provider registration, configuration, model metadata, and integration tests.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search