fix: increase API timeout default from 900s to 1800s for slow-thinking models (#3431)

Models like GLM-5/5.1 can think for 15+ minutes. The previous 900s
(15 min) default for HERMES_API_TIMEOUT killed legitimate requests.

Raised to 1800s (30 min) in both places that read the env var:
- _build_api_kwargs() timeout (non-streaming total timeout)
- _call_chat_completions() write timeout (streaming connection)

The streaming per-chunk read timeout (60s) and stale stream detector
(180-300s) are unchanged — those are appropriate for inter-chunk timing.
This commit is contained in:
Teknium
2026-03-27 13:02:23 -07:00
committed by GitHub
parent fd8c465e42
commit fb46a90098
2 changed files with 3 additions and 3 deletions

View File

@@ -637,7 +637,7 @@ class TestBuildApiKwargs:
kwargs = agent._build_api_kwargs(messages)
assert kwargs["model"] == agent.model
assert kwargs["messages"] is messages
assert kwargs["timeout"] == 900.0
assert kwargs["timeout"] == 1800.0
def test_provider_preferences_injected(self, agent):
agent.providers_allowed = ["Anthropic"]