fix(bedrock_mantle): stop dropping web search tools on /responses - #37375
fix(bedrock_mantle): stop dropping web search tools on /responses#37375devin-ai-integration[bot] wants to merge 1 commit into
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Greptile SummaryThis PR preserves web-search tools in Bedrock Mantle Responses requests and advertises that capability for five Mantle Responses models
Confidence Score: 4/5The PR appears safe to merge, with one non-blocking regression-test gap for web-search tools supplied through additional_tools The production change consistently preserves web-search tools across both filtering entry points, while tests cover the main request path but not the separate hoisting path Files Needing Attention: tests/test_litellm/llms/bedrock_mantle/test_bedrock_mantle_responses_transformation.py
|
| Filename | Overview |
|---|---|
| litellm/llms/bedrock_mantle/responses/transformation.py | Preserves web_search-prefixed tools in both ordinary and hoisted Mantle Responses tool filtering |
| model_prices_and_context_window.json | Advertises web-search support for the five registered Bedrock Mantle Responses models |
| litellm/model_prices_and_context_window_backup.json | Keeps backup model capability metadata synchronized with the canonical model map |
| tests/test_litellm/llms/bedrock_mantle/test_bedrock_mantle_responses_transformation.py | Covers top-level web-search preservation and unsupported-tool removal but omits preservation through additional_tools hoisting |
Reviews (1): Last reviewed commit: "feat(bedrock): support Mantle web search..." | Re-trigger Greptile
| @pytest.mark.parametrize( | ||
| "tool_type", ["file_search", "image_generation", "code_interpreter"] | ||
| ) |
There was a problem hiding this comment.
Cover hoisted web-search preservation
The changed tests cover unsupported hoisted tools, but not web-search preservation, leaving this distinct transformation path without regression protection
Context Used: CLAUDE.md (source)
Knowledge Base Used: LLM Provider Adapters
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
TLDR
Problem this solves:
/responsesacceptsweb_search, LiteLLM silently dropped itHow it solves it:
web_search*tool variant in the requestsupports_web_searchon the 5 Mantle models that accept itUser Flow
Before: a developer asking a Mantle model to search the web gets an answer from model memory, with no sign the tool was ignored
"model": "bedrock_mantle/openai.gpt-5.6-sol"and"tools": [{"type": "web_search"}]web_search_callitem, so the model answered without searchingAfter: the same request runs a real search server side
"tools": [{"type": "web_search"}]web_search_callitems alongside the message, showing the queries the model ranbedrock_mantle/openai.gpt-5.6-solreportssupports_web_search: trueon https://litellm-domain/model/infoRelevant issues
Linear ticket
Pre-Submission checklist
@greptileaito re-request a review after pushing changes)Delays in PR merge?
If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).
Screenshots / Proof of Fix
Live LiteLLM proxy on
localhost:4000against real Bedrock Mantle (https://bedrock-mantle.us-east-1.api.aws, us-east-1), no mocks. Same config and same curl in both runs, only the checked out commit differsProxy config used in both runs (
mantle_web_search_config.yaml):Note on the search backend: our AWS test account's search egress returns 403, so each
web_search_callitem comes back with"status": "failed". The point of the before/after is that the tool now reaches Mantle and gets executed server-side at all, instead of being stripped by LiteLLM before the request leavesBefore (merge base
9c38d6d002cf663c41985be62b51bf3ebc5a9279)git worktree add /home/ubuntu/mantle_before 9c38d6d002cf663c41985be62b51bf3ebc5a9279 cd /home/ubuntu/mantle_before uv run --no-sync litellm --config mantle_web_search_config.yaml --detailed_debug --port 4000/v1/responsesrequest with aweb_searchtoolHTTP 200, and the tool is gone.
outputhas noweb_search_callitem and the echoedtoolsis empty:{ "id": "resp_sNzjXjEvdtXftPDKLPq8fFyVryJGZADM...", "model": "mantle-sol", "status": "completed", "tools": [], "output": [ { "type": "reasoning", "id": "rs_6781c756d1e55ec69e58cc95b233663b" }, { "type": "reasoning", "id": "rs_..." }, { "type": "message", "role": "assistant", "content": [{ "type": "output_text", "text": "I can\u2019t access the live web from this environment, so I can\u2019t reliably identify the newest LiteLLM release.\n\nCheck the current version here:\n\n- PyPI: https://pypi.org/project/litellm/\n- GitHub releases: https://github.com/BerriAI/litellm/releases" }] } ] }output item types:
['reasoning', 'reasoning', 'message']After (branch tip
4859f53bb0be6f30c96b051d1c2031c108320afe)HTTP 200, and Mantle now runs the search server-side:
web_search_callitems are present, with realactionpayloads, and the tool is echoed back intools:{ "id": "resp_Gbx1Dc44LL0iHdJ5oLyJzjHc4tc...", "model": "mantle-sol", "status": "completed", "tools": [{ "type": "web_search", "filters": null, "search_context_size": null, "user_location": null }], "output": [ { "type": "web_search_call", "id": "ws_19d7fe0b31be53d8871f475bb627ab8e", "status": "failed", "action": { "type": "search", "query": "site:github.com/BerriAI/litellm releases latest LiteLLM", "queries": ["site:github.com/BerriAI/litellm releases latest LiteLLM", "PyPI LiteLLM latest version"] } }, { "type": "reasoning", "id": "rs_..." }, { "type": "web_search_call", "id": "ws_6543216809535dc0bc1fae6cfb9b9e74", "status": "failed", "action": { "type": "open_page", "url": "https://api.github.com/repos/BerriAI/litellm/releases/latest" } }, { "type": "reasoning", "id": "rs_..." }, { "type": "message", "role": "assistant", "content": [{ "type": "output_text", "text": "I couldn\u2019t verify the newest LiteLLM release because web access returned a 403 error.\n\nYou can check the current version with:\n\n```bash\npip index versions litellm\n```" }] } ] }output item types:
['web_search_call', 'reasoning', 'web_search_call', 'reasoning', 'message'], and the proxy log has zerodropping unsupported tool type(s)lines for these requests. The"status": "failed"on each call is our account's search egress returning 403, not LiteLLM: the model itself says "web access returned a 403 error". An earlier identical run on the same tip produced threeweb_search_callitems (search, then twoopen_pagefetches of the GitHub releases URLs), same shapeimage_generationstill gets dropped, request still succeedsHTTP 200,
tools: [], output item types['reasoning', 'message']with textHi there, friend!, and the log line:file_searchalso still returns HTTP 200 ({"type":"file_search","vector_store_ids":["vs_fake"]}->status: completed, output item types['file_search_call', 'message']), served by LiteLLM's emulated file-search handler rather than being sent to Mantle, so no Mantle 400curl -s http://localhost:4000/model/info -H 'Authorization: Bearer sk-1234'This needs
LITELLM_LOCAL_MODEL_COST_MAP=True, otherwise the proxy pulls the published cost map from the network and reportssupports_web_search: nulluntil this PR'smodel_prices_and_context_window.jsonis releasedType
🐛 Bug Fix
Caveats (if any)
web_searchthereFinal Attestation
Link to Devin session: https://app.devin.ai/sessions/f751987e5dab49f7b560e50acd9927ee
Requested by: @mateo-berri