You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 5259f9f
Browse filesBrowse the repository at this point in the historyBrowse files
fix(core): abort stalled provider streams with header and chunk timeouts
The custom fetch on the OpenAI client only set the keep-alive agent. The
SDK's own timeout covers the wait for response headers only, so a stream
that went silent after the headers arrived - a gateway hiccup or a
black-holed connection - never aborted and the CLI spun until the user
interrupted it.
timeoutFetch() wraps the client's fetch with two bounds:
- A 300s response-header timeout, cleared once the headers arrive.
- A 300s per-chunk idle timeout for the response body; every received
chunk resets it, so a healthy stream of any length is never cut off.
Both timers abort with a descriptive reason ("No response headers after
300s..." / "No data received for 300s while streaming..."), which
surfaces as the request's error message. The caller's own signal is
combined, and user interrupts keep working.
0 commit comments