Add read timeouts to llama-server clients so hangs fail fast #43

Merged
ryan merged 2 commits from llama-timeouts into main 2026-09-11 17:18:15 -04:00
Owner

The OpenAI client defaults to a 600s read timeout, so a wedged llama-server blocked requests for 10 minutes and never raised — meaning the existing with_fallbacks() to OpenAI never triggered.

  • ChatOpenAI (conversation agent) and LLMClient now use a per-chunk read timeout (120s, configurable via LLAMA_TIMEOUT_SECONDS) with one retry
  • A hang now surfaces as an exception quickly and the conversation continues on the OpenAI fallback; context is preserved because message history is rebuilt from Postgres on every request
The OpenAI client defaults to a 600s read timeout, so a wedged llama-server blocked requests for 10 minutes and never raised — meaning the existing with_fallbacks() to OpenAI never triggered. - ChatOpenAI (conversation agent) and LLMClient now use a per-chunk read timeout (120s, configurable via LLAMA_TIMEOUT_SECONDS) with one retry - A hang now surfaces as an exception quickly and the conversation continues on the OpenAI fallback; context is preserved because message history is rebuilt from Postgres on every request
ryan added 1 commit 2026-09-11 17:05:45 -04:00
The OpenAI client defaults to a 600s read timeout, so a wedged
llama-server blocked requests for 10 minutes and never raised, which
meant with_fallbacks() to OpenAI never triggered. Set a per-chunk read
timeout (120s, configurable via LLAMA_TIMEOUT_SECONDS) plus one retry
on the ChatOpenAI and LLMClient clients. Context is preserved because
conversation history is rebuilt from Postgres on every request.
ryan added 1 commit 2026-09-11 17:13:13 -04:00
ryan merged commit 2988482791 into main 2026-09-11 17:18:15 -04:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ryan/simbarag#43