What happened?
Long-running Agent requests terminate at exactly 5 minutes with:
error: [api/server/controllers/agents/client.js #sendCompletion] Unhandled error type terminated
This occurs despite all of the following:
- HTTP_REQUEST_TIMEOUT_MS=900000 (15 minutes) set in .env and confirmed present inside the API container via
docker-compose exec api printenv HTTP_REQUEST_TIMEOUT_MS.
waitForRun timeout in api/server/services/Runs/handle.js patched to 60000 * 15 and confirmed active inside the container via grep.
- Redis enabled with USE_REDIS=true and USE_REDIS_STREAMS=true, confirmed PONG from redis-cli.
Expected: Agent runs should respect the configured 15-minute timeout and complete normally.
Actual: Agent runs are terminated at exactly 5 minutes. The 5-minute mark matches undici's default bodyTimeout and headersTimeout (300,000 ms).
Precedent: This exact issue was already fixed for MCP connections in PR #9476, where an undici Agent with bodyTimeout: 0 and headersTimeout: 0 was configured to prevent the 5-minute cutoff. This report requests the same fix be applied to the OpenAI/DeepSeek client used by the Agent controller.
Presets are less affected than Agents under identical long-running queries, suggesting the Agent networking path is the source of the cutoff.
Version Information
LibreChat v0.8.7
Deployment: Self-hosted Docker Compose (local)
Image: registry.librechat.ai/danny-avila/librechat-dev:latest
Reverse proxy: None (direct port 3080)
Custom endpoints: DeepSeek V4 Pro, Gemini, Qwen
Redis: redis:7-alpine (docker), USE_REDIS_STREAMS=true
Steps to Reproduce
-
Configure an Agent using the DeepSeek endpoint (deepseek-v4-pro) with reasoning_effort: high.
-
Set HTTP_REQUEST_TIMEOUT_MS=900000 in .env and pass it to the api service in docker-compose.override.yml.
-
Patch api/server/services/Runs/handle.js: change timeout = 60000 * 3 to timeout = 60000 * 15 and mount it via docker-compose.override.yml. Confirm inside the container with:
docker-compose exec api grep -n "timeout = 60000" /app/api/server/services/Runs/handle.js
-
Enable Redis with USE_REDIS=true and USE_REDIS_STREAMS=true.
-
Send a complex query that requires more than 5 minutes of high-effort reasoning.
-
Observe the API logs. At exactly 5 minutes, the request terminates with:
error: [api/server/controllers/agents/client.js #sendCompletion] Unhandled error type terminated
What browsers are you seeing the problem on?
Microsoft Edge, Firefox, Chrome
Relevant log output
2026-09-13 17:40:34 error: [api/server/controllers/agents/client.js #sendCompletion] Unhandled error type terminated
2026-09-13 17:44:51 error: [api/server/controllers/agents/client.js #sendCompletion] Unhandled error type terminated
Screenshots
No response
Code of Conduct
What happened?
Long-running Agent requests terminate at exactly 5 minutes with:
error: [api/server/controllers/agents/client.js #sendCompletion] Unhandled error type terminated
This occurs despite all of the following:
docker-compose exec api printenv HTTP_REQUEST_TIMEOUT_MS.waitForRuntimeout in api/server/services/Runs/handle.js patched to60000 * 15and confirmed active inside the container via grep.Expected: Agent runs should respect the configured 15-minute timeout and complete normally.
Actual: Agent runs are terminated at exactly 5 minutes. The 5-minute mark matches undici's default bodyTimeout and headersTimeout (300,000 ms).
Precedent: This exact issue was already fixed for MCP connections in PR #9476, where an undici Agent with bodyTimeout: 0 and headersTimeout: 0 was configured to prevent the 5-minute cutoff. This report requests the same fix be applied to the OpenAI/DeepSeek client used by the Agent controller.
Presets are less affected than Agents under identical long-running queries, suggesting the Agent networking path is the source of the cutoff.
Version Information
LibreChat v0.8.7
Deployment: Self-hosted Docker Compose (local)
Image: registry.librechat.ai/danny-avila/librechat-dev:latest
Reverse proxy: None (direct port 3080)
Custom endpoints: DeepSeek V4 Pro, Gemini, Qwen
Redis: redis:7-alpine (docker), USE_REDIS_STREAMS=true
Steps to Reproduce
Configure an Agent using the DeepSeek endpoint (deepseek-v4-pro) with reasoning_effort: high.
Set HTTP_REQUEST_TIMEOUT_MS=900000 in .env and pass it to the api service in docker-compose.override.yml.
Patch api/server/services/Runs/handle.js: change
timeout = 60000 * 3totimeout = 60000 * 15and mount it via docker-compose.override.yml. Confirm inside the container with:docker-compose exec api grep -n "timeout = 60000" /app/api/server/services/Runs/handle.js
Enable Redis with USE_REDIS=true and USE_REDIS_STREAMS=true.
Send a complex query that requires more than 5 minutes of high-effort reasoning.
Observe the API logs. At exactly 5 minutes, the request terminates with:
error: [api/server/controllers/agents/client.js #sendCompletion] Unhandled error type terminated
What browsers are you seeing the problem on?
Microsoft Edge, Firefox, Chrome
Relevant log output
Screenshots
No response
Code of Conduct