litellm - 💡(How to fix) Fix Reasoning summary delta ‘item_id’ doesn’t match ‘id’ of the output item addition in streaming responses [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
BerriAI/litellm#25336Fetched 2026-04-09 07:52:40
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Author
Participants
Timeline (top)
labeled ×1

Code Example

data: {"type":"response.created",
data: {"type":"response.in_progress",
data: {"type":"response.output_item.added","output_index":0,"item":{"id":"rs_588f5f91-fa97-4042-a822-daa86a581ae5","type":"reasoning",
data: {"type":"response.reasoning_summary_text.delta","item_id":"rs_4645194514285349253","output_index":0,"delta":"**Acknowledge the Greeting**\n\nI've analyzed …

data: {"type":"response.reasoning_summary_text.done","item_id":"rs_588f5f91-fa97-4042-a822-daa86a581ae5","output_index":0,"sequence_number":4,"summary_index":0,"text":"**Acknowledge the Greeting**\n\nI've analyzed …

data: {"type":"response.reasoning_summary_part.done","item_id":"rs_588f5f91-fa97-4042-a822-daa86a581ae5","output_index":0,"sequence_number":5,"summary_index":0,"part":{"type":"summary_text","text":"**Acknowledge the Greeting**\n\nI've analyzed …

data: {"type":"response.output_item.done","output_index":0,"sequence_number":6,"item":{"id":"rs_588f5f91-fa97-4042-a822-daa86a581ae5","type":"reasoning","summary":[{"type":"summary_text","text":"**Acknowledge the Greeting**\n\nI've analyzed …


---

docker run -v ./litellm_config.yaml:/app/config.yaml -p 4000:4000 \
  docker.litellm.ai/berriai/litellm:main-latest --config /app/config.yaml

---

model_list:
  - model_name: litellm-gemini-3.1-pro-preview
    litellm_params:
      model: gemini/gemini-3.1-pro-preview
      api_key: AIz...
      reasoning_effort: high

---

curl -X POST http://localhost:4000/v1/responses \
  -H "Content-Type: application/json" \
  -d '{
    "model": "litellm-gemini-3.1-pro-preview",
    "stream": true,
    "input": [ { "role": "user", "content": "Hello!" } ] }'
RAW_BUFFERClick to expand / collapse

When using Gemini through LiteLLM’s OpenAI Responses API with streaming, the ‘item_id’ of reasoning summary deltas doesn’t match the ‘id’ of the preceding addition of the reasoning output item, like in the following where the ‘item_id’ of the delta is ‘rs_4645194514285349253’ while the ‘id’ of the item is ‘rs_588f5f91-fa97-4042-a822-daa86a581ae5’:

data: {"type":"response.created", …

data: {"type":"response.in_progress", …

data: {"type":"response.output_item.added","output_index":0,"item":{"id":"rs_588f5f91-fa97-4042-a822-daa86a581ae5","type":"reasoning", …

data: {"type":"response.reasoning_summary_text.delta","item_id":"rs_4645194514285349253","output_index":0,"delta":"**Acknowledge the Greeting**\n\nI've analyzed …

data: {"type":"response.reasoning_summary_text.done","item_id":"rs_588f5f91-fa97-4042-a822-daa86a581ae5","output_index":0,"sequence_number":4,"summary_index":0,"text":"**Acknowledge the Greeting**\n\nI've analyzed …

data: {"type":"response.reasoning_summary_part.done","item_id":"rs_588f5f91-fa97-4042-a822-daa86a581ae5","output_index":0,"sequence_number":5,"summary_index":0,"part":{"type":"summary_text","text":"**Acknowledge the Greeting**\n\nI've analyzed …

data: {"type":"response.output_item.done","output_index":0,"sequence_number":6,"item":{"id":"rs_588f5f91-fa97-4042-a822-daa86a581ae5","type":"reasoning","summary":[{"type":"summary_text","text":"**Acknowledge the Greeting**\n\nI've analyzed …

I’m wondering whether that is as expected, shouldn’t the IDs match?

Docker command, configuration file and curl command used for the above:

docker run -v ./litellm_config.yaml:/app/config.yaml -p 4000:4000 \
  docker.litellm.ai/berriai/litellm:main-latest --config /app/config.yaml
model_list:
  - model_name: litellm-gemini-3.1-pro-preview
    litellm_params:
      model: gemini/gemini-3.1-pro-preview
      api_key: AIz...
      reasoning_effort: high
curl -X POST http://localhost:4000/v1/responses \
  -H "Content-Type: application/json" \
  -d '{
    "model": "litellm-gemini-3.1-pro-preview",
    "stream": true,
    "input": [ { "role": "user", "content": "Hello!" } ] }'

extent analysis

TL;DR

The discrepancy in 'item_id' between the reasoning summary delta and the preceding addition of the reasoning output item may be due to an inconsistency in the OpenAI Responses API or the LiteLLM implementation.

Guidance

  • Verify the API documentation for OpenAI Responses and LiteLLM to ensure that the 'item_id' in the delta message is expected to match the 'id' of the item in the addition message.
  • Check the LiteLLM configuration file (litellm_config.yaml) to ensure that the model_name and litellm_params are correctly set up for the Gemini model.
  • Investigate the possibility of a version mismatch between the LiteLLM Docker image and the OpenAI Responses API.
  • Consider reaching out to the LiteLLM or OpenAI support teams for further clarification on the expected behavior of the 'item_id' in the delta message.

Notes

The provided information suggests that the issue may be related to the interaction between LiteLLM and the OpenAI Responses API, but without further documentation or support from the API providers, it is difficult to determine the root cause.

Recommendation

Apply workaround: Monitor the API responses and handle the discrepancy in 'item_id' programmatically, if possible, until further clarification is obtained from the API providers.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING