There is 1 update.
 
 
LLM AI Integration / cid:jira-generated-image-avatar-2c3125fe-baba-4229-85b8-179dfeae1c53 LLMAI-181 Open

Chat UI fails with "Unterminated string in JSON" when streaming long responses

 
View issue   ยท   Add comment
 

1 update

 
cid:jira-generated-image-avatar-f7770de5-d9b2-4fb3-8eaf-3b5c491688f8 Changes by Rene van t Hof on 24/Sep/26 09:09
 
Description: Environment:

Update: Fixed in version 0.10

 
- XWiki on Debian 13 / Tomcat 11
- LLM Application (BETA) 0.9 + Index for the LLM Application 0.9
- Backend: Ollama 0.34.0 (OpenAI-compatible /v1 API) behind a Caddy
  reverse proxy with flush_interval -1 (no buffering)
- Model: gemma3:12b, RAG context enabled (8 chunks, ~2000 chars each)
- "Can Stream" enabled on the server configuration

Steps to reproduce:
1. Ask a question that produces a long streamed response (RAG context
   included, total response body roughly 12-17 KB)
2. Intermittently, the chat shows:
   "An error occurred: Unterminated string in JSON at position 13303
   (line 1 column 13304)"

Observed on multiple occasions at different positions (12363, 13303,
17438), always mid-string, always on longer responses. Short responses
stream fine.

Workaround: unchecking "Can Stream" on the server configuration makes
the problem disappear entirely, so the response content itself is valid.
This suggests the client-side parser fails when a JSON string is split
across SSE chunk boundaries.