Uploaded image for project: 'LLM AI Integration'
  1. LLM AI Integration
  2. LLMAI-135

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 0.9
    • 0.8
    • None
    • Unknown

    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:

        // 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());
        

      The chat application's non-streaming parser uses the regex

       

      /Sources:([\s\S]*?)(?=\n\n|$)/
      

       to extract the sources block. Without the \n\n boundary, the regex consumes into the main content and the
      remainder is dropped.

      Steps to Reproduce

      1. Enable streaming mode in the AI-LLM main chat application window
      2. Ask a question that triggers RAG (collection search)
      3. Observe that the response content is truncated or empty

      Expected Behavior

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

      Actual Behavior

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

      Attachments

        Activity

          People

            ppantiru Paul Pantiru
            ppantiru Paul Pantiru
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: