Fix rotation providers never degrading: don't record success on lazy streams
For streaming requests providers returned a lazy generator and immediately
called record_success(), resetting the failure counter to 0 BEFORE the
rotation handler primed the stream and the upstream returned 400/429. Every
attempt did success(reset->0) then failure(->1), so the disable threshold (3)
was never reached and a consistently-failing provider was never disabled.
Guard the premature record_success() so it does not fire for streaming
(codex, openai, runpod, coderai). The caller already records success after
the stream is primed/consumed, so the failure counter now accumulates and a
failing provider is correctly disabled/cooled-down. Bump to 0.99.74.
Co-Authored-By:
Claude Opus 4.8 <noreply@anthropic.com>
Showing
Please
register
or
sign in
to comment