KamoCRM

Streamed replies were dropped, persisting blank assistant messages

FixAIService
Shipped
18 ஜூலை, 2026 அன்று 9:41 PM UTC
Author
Kamo
Commit
8a9a63b

Every successful chat completion came back as an EMPTY assistant bubble. The assistant rows were being saved with content_len=0 and is_error=false, so there was nothing to debug from — the clients were faithfully rendering nothing. Cause: the streaming adapters filtered on a literal "data: " prefix (`filter(line -> line.startsWith("data: "))`). WebClient decodes text/event-stream itself, so chunks arrive with that prefix ALREADY stripped — every token was filtered out, the Flux completed empty, and doOnComplete persisted "". It only showed up on a SUCCESSFUL response, which is why the HuggingFace org (which always failed with model_not_supported and surfaced its error) looked different from the - OpenAiCompatibleAdapter / HuggingFaceAdapter: accept SSE chunks with OR without the "data: " prefix instead of requiring it. - ChatOrchestrationService: a stream completing with zero tokens is a failure, not an answer — log the provider/model and persist an explicit error (is_error=true) so it is visible instead of a silent blank bubble.

All changes

Like what you see shipping?

All of it arrives in your workspace on its own. Start on the free plan and read this page again in a month.

Start Free ForeverView Pricing