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

#28978 Responses API: function_call not converted to tool_calls in mixed content assistant messages

  • State: open
  • Author: @kokaisho1-svg
  • Labels: llm translation

## Description

When a Responses API request contains an assistant message with BOTH text and `function_call` content items, the `function_call` is not properly converted to the Chat Completions `tool_calls` array during the Responses→Chat transformation. This causes a "Missing corresponding tool call for tool response message" error when the corresponding `function_call_output` is processed.

## Root Cause

In the Responses API → Chat Completions request transformation, mixed-content assistant messages (those containing both `text` and `function_call` content items) are not properly handled. The `function_call` content item appears to be stripped without being converted to a `tool_calls` entry, leaving orphan `function_call_output` tool results that fail validation in downstream providers (especially Gemini).

## Error

``` Missing corresponding tool call for tool response message. Received - message={'role': 'tool', 'content': 'result', 'tool_call_id': 'call_good'}, last_message_with_tool_calls={'role': 'assistant', 'content': [{'type': 'text', 'text': 'ok'}]} ```

## Steps to Reproduce

Send a `/v1/responses` request with this `input`:

```json { "model": "gpt-5.3-codex", …

GitHub resolver

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

Refresh page
vote history (2 events)
#0 of 0 · 31d18h23m26s ago — entered · #import:https:::github.com:berriai:litellm post #2456
Issue 31966 is harder because it spans proxy model-discovery logic, access-group resolution, permission semantics, and regression coverage, while issue 28978 is a more localized request-transformation fix with focused tests.
#0 of 0 · 31d17h37m25s ago — current · #import:https:::github.com:berriai:litellm post #3249
The left issue is harder because it spans cross-provider state handling, identifier normalization, and compatibility across multiple Responses request paths, requiring broader regression coverage. The right issue is more localized to a transformation rule for mixed content and corresponding tool-call metadata.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search