There is 1 update.
 
 
LLM AI Integration / cid:jira-generated-image-avatar-0e6e58ec-f818-403d-8172-03f16b974684 LLMAI-137 Open

LMStudio (and h2c-incompatible inference servers) produce silent pending responses due to HTTP/2 upgrade headers

 
View issue   ยท   Add comment
 

1 update

 
cid:jira-generated-image-avatar-0c0c7e42-1a1e-440a-8ae0-56e8e6473752 Changes by Paul Pantiru on 14/May/26 10:38
 
Description: When the AI LLM application connects to certain local inference servers (confirmed: LMStudio), requests hang indefinitely with no response and no error logged. The browser shows the request as "pending" with an empty body.

{ * } Root Cause { * }{*}{*}

HttpClientFactory creates Java HttpClient instances with HttpClient.Version.HTTP_2. For plain HTTP connections (i.e., local inference servers using
[ http:// ] ), Java's HttpClient sends an h2c upgrade request with the headers:

Connection: Upgrade, HTTP2-Settings
Upgrade: h2c
HTTP2-Settings: ...

Servers that correctly implement the RFC (e.g., Ollama) ignore these headers and respond with a normal HTTP/1.1 200, which Java's HttpClient accepts as a graceful fallback. However, LMStudio's HTTP server does not respond at all when it receives these headers, causing the Java HttpClient to block indefinitely. Since the hang occurs inside the StreamingOutput lambda (after the 200 SSE response headers are already sent to the browser), no exception is surfaced to the caller or logged.

 
{ * } Steps to Reproduce { * }{*}{*}

  1. Configure an AI server pointing to a local LMStudio instance (e.g.,
[ http://localhost:1234/v1/ ] )

  2. Create a model bound to a LMStudio-loaded model (e.g., google/gemma-3n-e4b)

  3. Send a chat completion request with stream: true

  4. Observe: request stays "pending" indefinitely, no response, no XWiki log output

 
{ * } Expected Behavior { * }{*}{*}

  A response is returned from LMStudio, same as with Ollama or cloud providers.

 
{ * } Actual Behavior { * }{*}{*}

  The request hangs indefinitely. LMStudio never receives the request (confirmed via its activity log). No error is logged on the XWiki side.