Files
buzz/crates
npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7andWill Pfleger 4ab0701842 feat(agent): streaming-aware timeout handling for LLM responses
Replace the reqwest client-level .timeout() (which caps total request
time and kills active streams) with a per-chunk timeout on response
body reading. A stalled connection (no data for >chunk_timeout) is
retried and eventually errors, while a slow-but-progressing response
can run indefinitely.

- Remove client .timeout(), keep .connect_timeout(llm_timeout)
- Add chunk_timeout field to Llm struct, enforced via
  tokio::time::timeout on each stream.chunk() poll
- Stall triggers retry (transport-class), surfaces clear error on
  exhaustion
- New config: SPROUT_AGENT_LLM_STREAM_CHUNK_TIMEOUT_SECS (default 120)
- Keepalive already emitted during LLM calls (Phase 1) keeps ACP
  idle clock alive during long streams
- Tests: stalled body timeout + slow-but-progressing success

Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
2026-06-10 10:20:40 -04:00
..