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
Mid-stream error events still raise APIStatusError with status_code=200 (#1258 closed without a fix) #1918
Correction (same day):#1258 was not closed without a fix. #1587 added APIStatusError.type, which carries the in-stream error type (overloaded_error here), and the maintainers chose that over synthesizing a status code. What this issue is really about is the class: an in-stream error is still the bare APIStatusError, never OverloadedError / RateLimitError, so class-based handling misses it. The status code staying 200 is by design. PR that only picks the class from error.type: #1921
Follow-up to #1258, closed as completed on 2026-03-31. The behaviour is unchanged on 0.122.0, 1.4.0 and main.
When the API sends an error event inside a stream, _streaming.py passes the original 200 response to _make_status_error, which dispatches on response.status_code only, so the result is a bare APIStatusError with status_code=200. For an overloaded_error that means OverloadedError (529) is never raised in-stream, and anything that keys retries on the exception class or the status code sees a 200 "error". Wrappers end up with "overloaded_error" in str(e) (agno does exactly that) because nothing else is stable.
Expected: the in-stream error mapped from body["error"]["type"] (overloaded_error to OverloadedError / 529, rate_limit_error to RateLimitError / 429, api_error to InternalServerError / 500, and so on), with the 200 response still attached. #1263 and #1269 did roughly that and were closed unmerged. Happy to send a fresh PR in whatever shape the "better approach" mentioned in #1258 was meant to take.
Activity