Summary
Two related issues when using DeepSeek provider via Anthropic-compatible endpoint (https://api.deepseek.com/anthropic) with long-running sessions:
Issue 1: Stream retry breaks credential pool
After a ReadTimeout stream drop, retry fails with credential error:
Stream drop on attempt 2/3 -- retrying.
provider=deepseek base_url=https://api.deepseek.com/anthropic
error_type=ReadTimeout elapsed=601.51s
Failed to rebuild shared OpenAI client (stream_retry_pool_cleanup)
error=Missing credentials. Please pass an api_key...
The credential context from the initial connection is lost when rebuilding the client for stream retry.
Issue 2: DeepSeek 600s server-side stream limit
DeepSeek's Anthropic-compatible endpoint drops streams after ~600 seconds:
http_status=200 bytes=775 chunks=4 elapsed=601.51s ttfb=1.50s upstream=[server=openresty]
http_status=200 bytes=58354 chunks=287 elapsed=605.87s ttfb=0.89s upstream=[server=openresty]
http_status=200 bytes=41394 chunks=205 elapsed=604.86s ttfb=0.99s upstream=[server=openresty]
- HTTP 200 returned (connection established successfully)
- TTFB is fast (~1s)
- Connection drops at ~600s regardless of request_timeout_seconds (tested at 1200s)
- Upstream is openresty (nginx), suggesting server-side proxy timeout
Environment
- Hermes Agent v0.13.0
- Provider: deepseek (via Anthropic-compatible endpoint)
- Model: deepseek-v4-pro
- Config: request_timeout_seconds=1200, stale_timeout_seconds=1800, streaming.enabled=true
- macOS 26.2, Intel x86_64
Workaround
Higher request_timeout_seconds does not help (600s limit is server-side). Sessions under 10 minutes work fine. Enabling streaming.enabled=true may help with connection management.
Summary
Two related issues when using DeepSeek provider via Anthropic-compatible endpoint (
https://api.deepseek.com/anthropic) with long-running sessions:Issue 1: Stream retry breaks credential pool
After a ReadTimeout stream drop, retry fails with credential error:
The credential context from the initial connection is lost when rebuilding the client for stream retry.
Issue 2: DeepSeek 600s server-side stream limit
DeepSeek's Anthropic-compatible endpoint drops streams after ~600 seconds:
Environment
Workaround
Higher request_timeout_seconds does not help (600s limit is server-side). Sessions under 10 minutes work fine. Enabling streaming.enabled=true may help with connection management.