Skip to content

fix: lower default streaming read timeout to 20s [AIR-1092]#597

Open
Cubestormer-IV wants to merge 2 commits into
mainfrom
air-1092-streaming-timeout-default
Open

fix: lower default streaming read timeout to 20s [AIR-1092]#597
Cubestormer-IV wants to merge 2 commits into
mainfrom
air-1092-streaming-timeout-default

Conversation

@Cubestormer-IV

Copy link
Copy Markdown

Context

stream and stream_async in chat, fim, and agents inherited the global 300s timeout. For SSE streaming this becomes an httpx read timeout between chunks — a stalled stream hangs for 5 minutes before failing.

Linear: AIR-1092

Implementation

Changed the hardcoded fallback from 300000 to 20000 (20s) in stream/stream_async methods only. Non-streaming (complete/complete_async) stay at 300s.

The x-speakeasy-timeout extension was also added to the streaming operations in the dashboard OpenAPI spec (PR #41377), but local testing confirmed Speakeasy currently ignores per-operation x-speakeasy-timeout — all methods still fell back to 300000 after regeneration. This direct fix is needed until that's resolved upstream.

Timeout priority remains: per-call timeout_ms= > Mistral(timeout_ms=...) > per-operation default (now 20s for streaming).

Checks / QA

  • Verify chat.stream(...), fim.stream(...), agents.stream(...) time out after ~20s of silence rather than 5 minutes
  • Confirm chat.complete(...) still uses 300s default
  • Override still works: client.chat.stream(..., timeout_ms=60000) should use 60s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant