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

#24819 [Bug]: OCI sync streaming missing split_chunks causes JSONDecodeError

  • State: open
  • Author: @djvolz
  • Labels: llm translation

## What happened?

The **sync** streaming path in `OCIChatConfig.get_sync_custom_stream_wrapper` is missing the `split_chunks` logic that the **async** path (`get_async_custom_stream_wrapper`) already has. When the OCI endpoint batches multiple SSE events into a single HTTP chunk, `chunk_creator` receives a multi-line string and `json.loads()` fails with `JSONDecodeError: Extra data`.

**Expected:** Streaming works the same in sync and async paths.

## Steps to Reproduce

1. Configure litellm to use an OCI model (e.g., `oci/openai.gpt-5.4`) 2. Make a **sync** streaming chat completion call 3. Observe `JSONDecodeError: Extra data` when the endpoint batches multiple SSE events into one chunk

## Relevant log output

``` litellm.APIConnectionError: Extra data: line 3 column 1 (char 123)

File "litellm/litellm_core_utils/streaming_handler.py", line 1611, in __next__ response: Optional[ModelResponseStream] = self.chunk_creator(chunk=chunk)

File "litellm/llms/oci/chat/transformation.py", line 1082, in chunk_creator dict_chunk = json.loads(chunk[5:]) ^^^^^^^^^^^^^^^^^^^^^ json.decoder.JSONDecodeError: Extra data: line 3 column 1 (char 123) ```

## Root Cause

In …

GitHub resolver

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

Refresh page
vote history (3 events)
#0 of 0 · 31d18h24m34s ago — entered · #import:https:::github.com:berriai:litellm post #2440
The right-hand issue is harder because it requires careful error-shape handling, exception classification, and regression coverage across streaming behavior, while the left-hand issue is a relatively localized parity fix reusing established chunk-splitting logic.
The left issue is substantially harder because it requires a cross-cutting, security-sensitive credential-provider architecture, including lifecycle, isolation, configuration, secret handling, and integration across proxy and MCP request flows. The right issue is a narrowly scoped synchronization fix with focused testing.
#0 of 0 · 31d18h1m59s ago — current · #import:https:::github.com:berriai:litellm post #2822
The right issue requires coordinated changes in a provider-specific streaming parser, careful handling of fragmented protocol data, regression coverage for sync/async parity, and validation against varied chunk boundaries. The left issue is comparatively localized to HTTP route compatibility and a focused test or configuration adjustment.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search