Skip to content

fix(proxy_server): pass search_tools to Router during DB-triggered in…#19388

Merged
krrishdholakia merged 1 commit intoBerriAI:litellm_staging_01_20_2026from
Harshit28j:fix/router.search_tools
Jan 20, 2026
Merged

fix(proxy_server): pass search_tools to Router during DB-triggered in…#19388
krrishdholakia merged 1 commit intoBerriAI:litellm_staging_01_20_2026from
Harshit28j:fix/router.search_tools

Conversation

@Harshit28j
Copy link
Collaborator

@Harshit28j Harshit28j commented Jan 20, 2026

…itialization

Relevant issues

Fixes #16634 where search_tools were ignored when the Router was initialized via the database persistence path (e.g., no strict local config file).

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have Added testing in the tests/litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible, it only solves 1 specific problem

CI (LiteLLM team)

CI status guideline:

  • 50-55 passing tests: main is stable with minor issues.
  • 45-49 passing tests: acceptable but needs attention
  • <= 40 passing tests: unstable; be careful with your merges and assess the risk.
  • Branch creation CI run
    Link:
  • CI run for the last commit
    Link:
  • Merge / cherry-pick CI run
    Links:

Type

🐛 Bug Fix

Changes

  • Refactored _update_llm_router: Moved search_tools parsing to the beginning of the function.
  • Fixed Initialization: Passed the parsed search_tools to the litellm.Router constructor when creating a new router instance. This ensures search tools are available even when the router is initialized lazily from the database (e.g., llm_router is None).
  • Cleanup: Removed the redundant update_router_search_tools call at the end of the function to prevent duplicate processing and log spam.
  • Verification: Verified locally confirming that google-search is correctly found and executed by the Router.
image

@vercel
Copy link

vercel bot commented Jan 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
litellm Error Error Jan 20, 2026 3:26am

Request Review

@krrishdholakia krrishdholakia changed the base branch from main to litellm_staging_01_20_2026 January 20, 2026 17:54
@krrishdholakia krrishdholakia merged commit 1c8bf19 into BerriAI:litellm_staging_01_20_2026 Jan 20, 2026
3 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Search tool 'test-search' not found in router.search_tools

2 participants