7 views
-/https://github.com/berriai/litellm/issues/27276
GitHub · issue

#27276 [Bug]: Responses API → Chat Completions bridge drops tool names and forwards unsupported tool types (custom, shell)

  • State: open
  • Author: @TopherMayor
  • Labels: llm translation

## What happened?

When using `use_chat_completions_api: true` to bridge the Responses API to Chat Completions for providers that don't support `/v1/responses` (e.g., DeepSeek, Z.AI/GLM, MiniMax), two bugs in `transform_responses_api_tools_to_chat_completion_tools` cause failures:

### Bug 1: Unsupported tool types forwarded as-is

When Codex or other clients send tools with `type: "custom"` (a valid Responses API tool type per the OpenAI SDK's `CustomToolParam`), the `else` branch in `transform_responses_api_tools_to_chat_completion_tools` passes them through unchanged:

```python # Current code (line ~1411) else: chat_completion_tools.append( cast(Union[ChatCompletionToolParam, OpenAIMcpServerTool], tool) ) ```

Providers like DeepSeek reject this: `tools[0].type: unknown variant 'custom', expected 'function'`.

### Bug 2: Function tool names lost during transformation

When clients send tools in Chat Completion format nested under the Responses API (which Codex does), the transformation only reads `name` from the top level of the tool dict:

```python # Current code (line ~1394) "name": typed_tool.get("name") or "", # Returns "" when name is nested under "functi…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (2 events)
#0 of 0 · 31d19h2m27s ago — entered · #import:https:::github.com:berriai:litellm post #1924
The right issue is harder because it requires redesigning failure-safe queue and persistence semantics, coordinating retries, locking, recovery, and regression coverage. The left issue is comparatively localized to input normalization and provider-specific translation with focused tests.
#0 of 0 · 31d19h2m24s ago — current · #import:https:::github.com:berriai:litellm post #1925
The right-side task requires coordinated schema normalization across API variants, provider compatibility handling, and broader regression coverage. The left-side task is narrower, mainly involving validation or normalization of outbound metadata values, with comparatively limited behavioral surface area.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search