DeepSeek stream terminated at ~4 minutes — API closes connection mid-stream (after #16201 fix) #16372
Replies: 2 comments
|
Investigating, was not able to reproduce right away so moved to discussions. |
|
Reproducible prompt for the ~4-minute DeepSeek termination To help reproduce the issue reported earlier in this thread, below is the prompt that reliably triggers it. My logs are unchanged from the initial report, but I am including the key excerpt below for convenience. Setup: Model: Endpoint: custom DeepSeek endpoint (
No attachments Reproduces in both standard chat and Agent mode Reproduces in Edge, Firefox, and Chrome Prompt: Expected behaviour: LibreChat timeout configuration in this instance: The running image is PR #16201 changed the defaults for Agent model calls to There is no handle.js patch mounted. The container uses the image's version. Redis is enabled for resumable streams ( Provider-side limits (for context): Providers impose their own streaming limits. DeepSeek documentation and community reports mention various limits in the 2-minute to 10-minute range, but there is no single authoritative figure for Actual behaviour: Client-side evidence (unchanged from initial report): HTTP 200 received, SSE stream started. Connection closed by the remote server at ~4 minutes. No client-side Relevant log excerpt from the failure is below. Suggested action: Relevant log excerpt: |
Uh oh!
There was an error while loading. Please reload this page.
What happened?
After upgrading to v0.8.8-rc4, which includes the fix from PR #16201 for the 5-minute undici timeout (issue #16195), a new and different termination occurs.
Agent and Preset runs using the custom DeepSeek endpoint now terminate after approximately 4 minutes with:
The model provider could not complete this request.
terminated
This is NOT the previous undici body/header timeout. Testing with NODE_DEBUG=undici,http,net shows the following sequence:
UNDICI: connected to api.deepseek.com using https:h1
UNDICI: sending request to POST https://api.deepseek.com/v1/chat/completions
UNDICI: received response to POST https://api.deepseek.com/v1/chat/completions - HTTP 200
...streaming for ~4 minutes...
NET: close handle
NET: emit close
UNDICI: request to POST https://api.deepseek.com/v1/chat/completions errored - other side closed
There is no bodyTimeout, no headersTimeout, and no ECONNRESET. The remote server (api.deepseek.com) closes the TCP connection after roughly 4 minutes of streaming.
HTTP 200 was received before the connection closed, so the request itself was accepted. The failure is on the response streaming.
This happens in both standard chat and Agent modes, and in Edge, Firefox, Chrome, and Opera, so it is not browser-specific.
Expected behaviour: The stream should continue until the model finishes, or LibreChat should retry when the connection is closed by the provider.
Actual behaviour: The stream terminates at ~4 minutes and the user sees a generic error.
Version Information
LibreChat v0.8.8-rc4
Deployment: Self-hosted Docker Compose (local)
Image: ghcr.io/danny-avila/librechat:v0.8.8-rc4
Digest: ghcr.io/danny-avila/librechat@sha256:929f4491cb9a87d6beb02e9e9ce9a54d4ee05bc56b65b1debe5b1f28a327a4fb
Reverse proxy: None (direct port 3080)
Custom endpoints: DeepSeek V4 Pro, DeepSeek Flash, Gemini, Qwen
Redis: redis:7-alpine (docker), USE_REDIS_STREAMS=true
Steps to Reproduce
What browsers are you seeing the problem on?
Chrome, Firefox, Microsoft Edge
Relevant log output
Screenshots
Code of Conduct
All reactions