9router/open-sse/translator/request
Владимир Акимов 7076108550
fix(translator): filter nameless hosted tools when converting Responses API to Chat format (#222)
Codex CLI sends "hosted" tools (e.g. `request_user_input`) via the OpenAI
Responses API. These tools have no explicit `name` field. The previous
`body.tools.map()` pass propagated `name: undefined` into the resulting
Chat Completions function declarations, which then became anonymous
`functionDeclarations` after the OpenAI→Gemini translation step.

Gemini strictly requires every function declaration to have a valid name
and rejects the entire request with:

  GenerateContentRequest.tools[0].function_declarations[4].name:
  Invalid function name. Must start with a letter or an underscore.

Fix: filter out any Responses API tool that lacks a non-empty `name`
string before converting to `{ type: "function", function: { name, ... } }`.
Named function tools are unaffected; only unnamed hosted tools are skipped.

Fixes: Gemini 400 error when Codex CLI is routed through 9router.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
2026-03-01 08:48:43 +00:00
..
antigravity-to-openai.js feat(antigravity): integrate Antigravity tool with MITM support and update CLI tools 2026-02-08 16:28:13 +07:00
claude-to-openai.js Fix cloud 2026-01-29 18:07:28 +07:00
gemini-to-openai.js Fix cloud 2026-01-29 18:07:28 +07:00
openai-responses.js fix(translator): filter nameless hosted tools when converting Responses API to Chat format (#222) 2026-03-01 08:48:43 +00:00
openai-to-claude.js Remove Docker publish workflow and update error handling in various modules 2026-02-10 19:18:40 +07:00
openai-to-cursor.js Fix MITM 2026-02-23 21:56:40 +07:00
openai-to-gemini.js refactor: update Antigravity model configurations and pricing 2026-02-20 17:52:15 +07:00
openai-to-kiro.js Fix MITM on window 2026-02-28 10:04:57 +07:00
openai-to-kiro.old.js ok 2026-01-27 10:49:16 +07:00