6 views
-/https://github.com/berriai/litellm/issues/33034
GitHub · issue

#33034 [Bug]: stream_chunk_builder drops thinking_blocks reasoning text when no signature arrives

  • State: open
  • Author: @abhay-codes07
  • Labels: llm translation

### What happened?

When a streamed response is reassembled by `stream_chunk_builder`, `thinking_blocks` reasoning text is silently dropped whenever a thinking block's **signature never arrives**.

`ChunkProcessor.get_combined_thinking_content` in `litellm/litellm_core_utils/streaming_chunk_builder_utils.py` only emits a block when both accumulated text **and** a signature are present:

```python if len(current_thinking_text_parts) > 0 and current_signature: # requires signature ```

The per-block `signature` only arrives in a dedicated delta at the **end** of a thinking block. Any block whose signature never lands — a stream truncated mid-thinking by `max_tokens` or client cancellation, or a provider/gateway that emits thinking text without per-block signatures — has all of its accumulated reasoning text discarded, and `thinking_blocks` comes back as `None`.

### Minimal reproduction (offline, no network/keys)

```python from litellm import stream_chunk_builder from litellm.types.utils import Delta, ModelResponseStream, StreamingChoices

def mk(delta, fr=None): return ModelResponseStream(id="x", created=1, model="claude-x", object="chat.completion.chunk", choices=[St…

GitHub resolver

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

Refresh page
vote history (3 events)
#0 of 0 · 31d18h52m35s ago — entered · #import:https:::github.com:berriai:litellm post #1997
Issue 27949 is substantially harder: it would require designing security boundaries, integrating a new memory-validation layer across agent workflows, handling configuration and compatibility concerns, and building broad testing and operational safeguards. Issue 33034 is a localized streaming assembly bug with a comparatively narrow code path and focused regression tests.
The left issue requires correcting persisted-state semantics across initialization, incremental updates, restart behavior, and multi-worker consistency, with broader regression and compatibility risk. The right issue is a localized streaming assembly condition with comparatively narrow test coverage and implementation scope.
#0 of 0 · 31d17h38m39s ago — current · #import:https:::github.com:berriai:litellm post #3236
30508 requires a new provider-style proxy integration, authentication handling, process or SDK lifecycle management, request/response translation, streaming, configuration, and broader testing. 33034 is a localized stream aggregation fix with focused regression coverage and limited compatibility risk.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search