mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-04 00:17:45 +08:00
canonical_tools_to_gemini promoted any tool whose name normalized to "websearch" / "googlesearch" / "websearchpreview" into Gemini's server-side builtin, dropping it from functionDeclarations. Claude Code declares an ordinary client-side `WebSearch` tool with a full input_schema, so every /v1/messages request routed to a Gemini model lost that declaration and gained `googleSearch` (rewritten to `googleSearchRetrieval` at the Anti Gravity transport boundary) instead. Two consequences, both observed on stabey-124 against gemini-3.8-flash: - the model can never emit a `WebSearch` tool_use, so the client's own web search is dead on that route; - when the model does reach for the injected server-side search, the v1internal backend answers `finishReason: MALFORMED_FUNCTION_CALL` / "Function call is empty - no input to parse." and the turn fails. Promote a tool to a builtin only when it is a bare marker carrying no schema. A declared schema means the caller intends to execute the call itself, which matches CLIProxyAPI: it keys builtins off Claude's `type: web_search_*` or an explicit `google_search` tool key and never off a function name. Co-Authored-By: Claude Opus 5 <[email protected]>