9 views
-/https://github.com/berriai/litellm/issues/34978
GitHub · issue

#34978 [Bug]: Chat-to-Responses bridge always wraps tool output in a list, breaking strict Responses API backends for plain-string tool results

  • State: open
  • Author: @jwhandy3
  • Labels: bug, proxy, llm translation

### Check for existing issues

- [x] I have searched the existing issues and checked that my issue is not a duplicate.

### What happened?

When a chat-completions request targets a Responses-API-backed model (e.g. openai/responses/<model>), litellm's convert_chat_completion_messages_to_responses_api() in litellm/completion_extras/litellm_responses_transformation/transformation.py unconditionally wraps every tool message's content into a list of input_text items — even when the content is a plain string with no multimodal parts: ``` elif role == "tool": ... elif isinstance(content, str): # Convert string to list with input_text tool_output = [{"type": "input_text", "text": content}] ... input_items.append( { "type": "function_call_output", "call_id": tool_call_id, "output": tool_output, } ) ``` Per the OpenAI Responses API spec, function_call_output.output is documented as a plain string. Some backends (we hit this against an enterprise OpenAI-compatible gateway) strictly validate this and reject the list form for simple text output.

This behavior was introduced fixing #17507 (list-form tool co…

GitHub resolver

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

Refresh page
vote history (3 events)
#0 of 0 · 31d18h41m20s ago — entered · #import:https:::github.com:berriai:litellm post #2175
The right issue requires cross-provider routing behavior, state management, failure policy, and broad integration testing; the left is a localized transformation fix with narrower compatibility risk.
The S3 change spans configuration, both upload paths, request signing, header handling, and provider-compatible tests, creating broader integration and regression risk. The Responses bridge fix is more localized to transformation logic, with its main complexity limited to preserving existing multimodal behavior.
#0 of 0 · 31d18h37m46s ago — current · #import:https:::github.com:berriai:litellm post #2232
The left issue is harder because it spans shared Pydantic model composition, provider-specific configuration semantics, initialization flow, and compatibility testing. The right issue is comparatively localized to a transformation branch with focused regression coverage, though it still carries some API-compatibility risk.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search