There is 1 update.
 
 
LLM AI Integration / cid:jira-generated-image-avatar-35dff3fa-9176-4329-b704-35d092f8eefa LLMAI-135 Open

Streaming mode truncates response in main chat window due to missing delimiter after sources

 
View issue   ·   Add comment
 

1 update

 
cid:jira-generated-image-avatar-442cdc5c-7268-4517-8111-60dc8039c325 Changes by Paul Pantiru on 13/May/26 10:08
 
Description: When streaming mode is enabled, the chat widget drops a portion of the assistant's response. In non-streaming mode, full responses are returned correctly.

*Root cause:*

{{RAGChatRequestFilter.processStreaming()}} builds the sources ChatMessage without appending a trailing {{{}\n\n{}}}:
{code:java}
  // Streaming path — missing delimiter
  new ChatMessage("assistant", SOURCES_STRING2 + sources, searchResults);

  // Non-streaming path — delimiter present
  message.setContent(SOURCES_STRING2 + extractURLsAndformat(searchResults) + NL2 + message.getContent());
  {code}
The chat application's non-streaming parser uses the regex

 
{code:java}
/Sources:([\s\S]*?)(?=\n\n|$)/
{code}
 to extract the sources block. Without the {{\n\n}} boundary, the regex consumes into the main content and the
remainder is dropped.
h3. Steps to Reproduce
# Enable streaming mode in the AI-LLM main chat application window
# Ask a question that triggers RAG (collection search)
# Observe that the response content is truncated or empty

h3. Expected Behavior

Full response is rendered, identical to non-streaming mode.
h3. Actual Behavior

Response content is partially or fully missing when sources are returned.