Skip to content

fix(translator): preserve Anthropic web search tools - #2355

Open
0YHR0 wants to merge 1 commit into
envoyproxy:mainfrom
0YHR0:fix/anthropic-web-search-tool-2124
Open

fix(translator): preserve Anthropic web search tools#2355
0YHR0 wants to merge 1 commit into
envoyproxy:mainfrom
0YHR0:fix/anthropic-web-search-tool-2124

Conversation

@0YHR0

@0YHR0 0YHR0 commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Description
Preserve Anthropic's web_search_20260209 tool when an OpenAI-compatible chat-completions request is routed to an Anthropic backend. The translator now retains the tool name and maps it to Anthropic's built-in web search parameter instead of silently dropping it.

Fixes #2124

Testing

  • go test ./internal/apischema/openai ./internal/translator ./internal/extproc -count=1

@0YHR0
0YHR0 requested a review from a team as a code owner July 13, 2026 06:09
@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jul 13, 2026
@missBerg missBerg added the area/translation Provider/endpoint coverage and schema translation (incl. fidelity bugs) label Jul 13, 2026
Signed-off-by: Yang Haoran <97868579@qq.com>
@0YHR0
0YHR0 force-pushed the fix/anthropic-web-search-tool-2124 branch from c04f6e5 to e3d6323 Compare August 2, 2026 08:02
@0YHR0

0YHR0 commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

@nacx I refreshed this PR onto the current main history and verified go test ./internal/translator ./internal/apischema/openai -count=1. It fixes #2124 by preserving Anthropic web search tools during Anthropic-to-OpenAI request translation. Could you please review it?

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.06%. Comparing base (25afc17) to head (e3d6323).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2355   +/-   ##
=======================================
  Coverage   85.05%   85.06%           
=======================================
  Files         159      159           
  Lines       22645    22653    +8     
=======================================
+ Hits        19261    19269    +8     
  Misses       2217     2217           
  Partials     1167     1167           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/translation Provider/endpoint coverage and schema translation (incl. fidelity bugs) size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Anthropic built-in tools (web_search_20260209) are stripped when routed through OpenAI-compatible /v1/chat/completions endpoint

3 participants