16 views
-/https://github.com/berriai/litellm/issues/25214
GitHub · issue

#25214 [Bug]: /v1/messages streaming drops first chunk on content-block transitions (Bedrock reasoning models)

  • State: open
  • Author: @dkssudgo112

### What happened?

When using the `/v1/messages` endpoint with a **streaming** request against a Bedrock Converse model that emits reasoning/thinking content (e.g. `minimax.minimax-m2.5`, `moonshotai.kimi-k2.5`, Claude extended thinking models), **the first chunk of content emitted after each content-block transition is silently dropped**.

Concrete symptoms: - The leading characters of text responses are missing (users see responses starting mid-sentence). - In some cases the text block is emitted with **zero** `content_block_delta` events even though the model actually produced text — so clients like Claude Code see an empty response. - Non-streaming (`stream=false`) is unaffected and returns full content correctly.

### Root cause

In `litellm/llms/anthropic/experimental_pass_through/adapters/streaming_iterator.py`, both the sync (`__next__`, ~line 130) and async (`__anext__`, ~line 306) paths handle content-block transitions like this:

```python if should_start_new_block and not self.sent_content_block_finish: # Queue the sequence: content_block_stop -> content_block_start # The trigger chunk itself is not emitted as a delta since the # content_block_start already…

GitHub resolver

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

Refresh page
vote history (1 events)
#0 of 0 · 31d18h4m41s ago — entered · #import:https:::github.com:berriai:litellm post #2883
The left task requires coordinated changes across synchronous and asynchronous streaming state machines, careful event-order preservation, and regression coverage for boundary conditions. The right task is comparatively localized, with straightforward exception-propagation and focused tests.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search