fix(antigravity): add web search tool support for Claude/OpenAI format requests#1142
Closed
adrenjc wants to merge 2 commits intorouter-for-me:mainfrom
Closed
fix(antigravity): add web search tool support for Claude/OpenAI format requests#1142adrenjc wants to merge 2 commits intorouter-for-me:mainfrom
adrenjc wants to merge 2 commits intorouter-for-me:mainfrom
Conversation
…st Claude Previously, the geminiToAntigravity function only processed tool parameters schema for Claude models. Gemini models (e.g., gemini-3-flash, gemini-3-pro) were skipped, causing "Invalid tool parameters" errors when using Claude Code with Gemini backend, as the raw schema contained unsupported keywords like anyOf, oneOf, $ref, and complex type arrays. This fix applies CleanJSONSchemaForAntigravity to all models, ensuring Gemini API receives compatible schema format.
scotlander
added a commit
to Dead-Dolls-Museum/CLIProxyAPI
that referenced
this pull request
Jan 21, 2026
…me#1142 - Add "antigravity" provider argument to LookupModelInfo call for correct model info lookup during web_search thinking budget clamping - Enable VALIDATED mode for toolConfig.functionCallingConfig - Remove leftover conflict marker from rebase Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
jc01rho
added a commit
to jc01rho/CLIProxyAPIPlus
that referenced
this pull request
Jan 22, 2026
…router-for-me#1142) - Add web_search tool detection and googleSearch injection in request translators - Add extractWebSearchFromAntigravity() to parse groundingMetadata from responses - Add appendWebSearchBlocks() for streaming web search results - Add server_tool_use and web_search_tool_result blocks for non-streaming - Set model to gemini-2.5-flash and requestType to web_search when detected - Fix quota cooldown check for transient errors (PR router-for-me#1140)
caidaoli
added a commit
to caidaoli/CLIProxyAPI
that referenced
this pull request
Jan 22, 2026
…pport for Claude/OpenAI format requests
Collaborator
|
I'm sorry, but our project only acts as a message carrier/forwarder, and we currently have no plans to implement specific functionality by using a redirection model. |
scotlander
added a commit
to Dead-Dolls-Museum/CLIProxyAPI
that referenced
this pull request
Jan 25, 2026
…me#1142 - Add "antigravity" provider argument to LookupModelInfo call for correct model info lookup during web_search thinking budget clamping - Enable VALIDATED mode for toolConfig.functionCallingConfig - Remove leftover conflict marker from rebase Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
ZqinKing
added a commit
to ZqinKing/CLIProxyAPIPlus
that referenced
this pull request
Jan 26, 2026
- 合并 PR router-for-me#1142:为 Antigravity 渠道引入 web_search 支持 - 核心功能: - 识别 request 中名为 的工具并转换为 googleSearch - 自动切换模型为 并设置 - 限制候选数量 - 支持 Claude/OpenAI/Gemini 全协议入口 - 解析 Antigravity 响应中的 web_search 结果并转换为 Claude 协议格式 - 兼容性处理: - 解决 executor 冲突,保留 main 分支的 schema 清理与 toolConfig 迁移逻辑 - 修复编译错误:OpenAI 转换器中复用 googleSearchNodes 避免未定义变量 - 配置优化: - 支持 thinkingBudget 的范围 clamp 逻辑
ZqinKing
added a commit
to ZqinKing/CLIProxyAPIPlus
that referenced
this pull request
Jan 27, 2026
- 合并 PR router-for-me#1142:为 Antigravity 渠道引入 web_search 支持 - 核心功能: - 识别 request 中名为 的工具并转换为 googleSearch - 自动切换模型为 并设置 - 限制候选数量 - 支持 Claude/OpenAI/Gemini 全协议入口 - 解析 Antigravity 响应中的 web_search 结果并转换为 Claude 协议格式 - 兼容性处理: - 解决 executor 冲突,保留 main 分支的 schema 清理与 toolConfig 迁移逻辑 - 修复编译错误:OpenAI 转换器中复用 googleSearchNodes 避免未定义变量 - 配置优化: - 支持 thinkingBudget 的范围 clamp 逻辑
ZqinKing
added a commit
to ZqinKing/CLIProxyAPIPlus
that referenced
this pull request
Jan 27, 2026
- 合并 PR router-for-me#1142:为 Antigravity 渠道引入 web_search 支持 - 核心功能: - 识别 request 中名为 的工具并转换为 googleSearch - 自动切换模型为 并设置 - 限制候选数量 - 支持 Claude/OpenAI/Gemini 全协议入口 - 解析 Antigravity 响应中的 web_search 结果并转换为 Claude 协议格式 - 兼容性处理: - 解决 executor 冲突,保留 main 分支的 schema 清理与 toolConfig 迁移逻辑 - 修复编译错误:OpenAI 转换器中复用 googleSearchNodes 避免未定义变量 - 配置优化: - 支持 thinkingBudget 的范围 clamp 逻辑
ZqinKing
added a commit
to ZqinKing/CLIProxyAPIPlus
that referenced
this pull request
Jan 27, 2026
- 合并 PR router-for-me#1142:为 Antigravity 渠道引入 web_search 支持 - 核心功能: - 识别 request 中名为 的工具并转换为 googleSearch - 自动切换模型为 并设置 - 限制候选数量 - 支持 Claude/OpenAI/Gemini 全协议入口 - 解析 Antigravity 响应中的 web_search 结果并转换为 Claude 协议格式 - 兼容性处理: - 解决 executor 冲突,保留 main 分支的 schema 清理与 toolConfig 迁移逻辑 - 修复编译错误:OpenAI 转换器中复用 googleSearchNodes 避免未定义变量 - 配置优化: - 支持 thinkingBudget 的范围 clamp 逻辑
ZqinKing
added a commit
to ZqinKing/CLIProxyAPIPlus
that referenced
this pull request
Jan 28, 2026
- 合并 PR router-for-me#1142:为 Antigravity 渠道引入 web_search 支持 - 核心功能: - 识别 request 中名为 的工具并转换为 googleSearch - 自动切换模型为 并设置 - 限制候选数量 - 支持 Claude/OpenAI/Gemini 全协议入口 - 解析 Antigravity 响应中的 web_search 结果并转换为 Claude 协议格式 - 兼容性处理: - 解决 executor 冲突,保留 main 分支的 schema 清理与 toolConfig 迁移逻辑 - 修复编译错误:OpenAI 转换器中复用 googleSearchNodes 避免未定义变量 - 配置优化: - 支持 thinkingBudget 的范围 clamp 逻辑
ZqinKing
added a commit
to ZqinKing/CLIProxyAPIPlus
that referenced
this pull request
Jan 31, 2026
- 合并 PR router-for-me#1142:为 Antigravity 渠道引入 web_search 支持 - 核心功能: - 识别 request 中名为 的工具并转换为 googleSearch - 自动切换模型为 并设置 - 限制候选数量 - 支持 Claude/OpenAI/Gemini 全协议入口 - 解析 Antigravity 响应中的 web_search 结果并转换为 Claude 协议格式 - 兼容性处理: - 解决 executor 冲突,保留 main 分支的 schema 清理与 toolConfig 迁移逻辑 - 修复编译错误:OpenAI 转换器中复用 googleSearchNodes 避免未定义变量 - 配置优化: - 支持 thinkingBudget 的范围 clamp 逻辑
scotlander
added a commit
to Dead-Dolls-Museum/CLIProxyAPI
that referenced
this pull request
Feb 12, 2026
…me#1142 - Add "antigravity" provider argument to LookupModelInfo call for correct model info lookup during web_search thinking budget clamping - Enable VALIDATED mode for toolConfig.functionCallingConfig - Remove leftover conflict marker from rebase Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes a critical user experience bug where
web_searchtool requests via Claude/OpenAI API formats are silently ignored by the Antigravity backend.Problem
This is a severe UX issue that completely breaks web search functionality.
Current behavior:
{"type": "web_search"}tool via Claude API format → tool is silently ignored{"type": "web_search"}tool via OpenAI API format → also ignoredgroundingMetadata) → response data is completely lost, client sees nothingFrom user's perspective: They configure web search tool, but AI never searches and never returns any citations. Users assume the feature is broken or disabled.
Solution
Request Translation
{"type": "web_search"}or{"name": "web_search"}tool declarations{"type": "web_search"}tool declarations{"googleSearch": {}}formatrequestType: "web_search"flaggemini-2.5-flashmodel (currently the only model supporting grounding)Response Translation
groundingMetadata.webSearchQueriesandgroundingMetadata.groundingChunksfrom Gemini responseserver_tool_use+web_search_tool_resultcontent blocksChanged Files
antigravity_executor.gorequestTypedetection, auto-identify web_search requestsantigravity_claude_request.goantigravity_claude_response.goantigravity_gemini_request.goantigravity_openai_request.goantigravity_openai-responses_request.goScreenshots
Before
After
Note: This PR includes commit 9c0e746 from #1126 (pending merge).
Testing
server_tool_useandweb_search_tool_resultevents