mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-09-19 13:23:50 +03:00
Built-in providers that speak the OpenAI Chat wire format skipped normalizeOpenAICompatibleTools(), which only ran for custom openai-compatible-* connections. A client tool whose type is not "function" (a named Claude server tool, a nameless hosted tool) was forwarded verbatim, and agentrouter's GLM backend rejected the whole request with 400 tools[0].type:type is illegal. Extract the gate into shouldNormalizeFunctionToolsOnly(): custom openai-compatible-* providers keep normalizing on every target, and a conservative allowlist of built-in providers (agentrouter first) normalizes on the OpenAI Chat target only. OpenAI itself stays off the list, so its custom tools pass through untouched. Closes #13789