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

#35411 [Bug]: AttributeError: LiteLLMCompletionStreamingIterator object has no attribute completed_response on mid-stream provider error (Anthropic via Responses API)

  • State: open
  • Author: @cd-otto
  • Labels: bug, llm translation, SDK

### Check for existing issues

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

### What happened?

# AttributeError: `LiteLLMCompletionStreamingIterator` object has no attribute `completed_response` on mid-stream provider error (Anthropic via Responses API)

## What happened

When the Anthropic provider returns a **mid-stream error** (e.g. HTTP 529 Overloaded / a 5xx) while streaming a **Responses API** completion, litellm's fallback/cleanup path raises:

``` AttributeError: 'LiteLLMCompletionStreamingIterator' object has no attribute 'completed_response' ```

This `AttributeError` **masks the real error** (the underlying `MidStreamFallbackError` / provider overload) and escapes the normal streaming-error contract. Because the surfaced exception is now a bare `AttributeError` rather than a stream/incomplete error, any downstream retry or model-fallback logic keyed on litellm's streaming exceptions never runs, and the call fails hard instead of falling back.

## Root cause (as far as we can tell)

On a mid-stream provider error, litellm raises `MidStreamFallbackError` and then attempts to recover partial token usage by reading `source_iterato…

GitHub resolver

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

Refresh page
vote history (1 events)
#0 of 0 · 31d17h46m11s ago — entered · #import:https:::github.com:berriai:litellm post #3102
The right issue spans dashboard behavior, proxy routing, authentication, and Responses-mode compatibility, requiring cross-layer diagnosis and integration testing. The left issue is a narrowly scoped streaming error-path fix with focused regression coverage, though its fallback semantics add some risk.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search