mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-09-21 06:12:17 +03:00
A plain (non-namespace) tool call's #7936 identity restore in nonStreamingClientTranslate.ts unconditionally applied whatever requestToolIdentityMap.get(item.name) returned as a {namespace, name} object. That map falls back to the _toolNameMap alias table (a plain Map<string, string>, e.g. "shell" -> "shell") published by the openai->gemini/claude pivot whenever no namespace tools are present. Applying that string as an identity object read undefined for both .namespace and .name, blanking item.name to undefined -- a key JSON.stringify then drops entirely, leaving Codex with a function_call it cannot dispatch and causing it to re-narrate its tool intent in a loop instead of executing it. Guard the restore so it only fires when the map entry actually has the {namespace, name} shape. Live VPS check (192.168.0.15, real gemini API key, Codex-shaped payload: tool_choice "auto", one shell function tool, gemini/gemini-3-flash-preview) reproduced the bug 3/3 on stream:false /v1/responses; stream:false /v1/chat/completions and stream:true /v1/responses were both already correct.