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
fix(#1743): retry primary model on transient errors even without fallback models
getEffectiveRetries returned 0 when no fallback models were configured,
meaning retryable errors (5xx, timeouts) got zero retries. This caused
Anthropic streaming 'Internal server error' to immediately surface as
'all models failed' instead of being retried with backoff.
Changed getEffectiveRetries to always return DefaultFallbackRetries (2)
when no explicit retry count is configured, regardless of whether
fallback models exist. Retrying the same model on transient errors is
always valuable.
Fixes#1743
Assisted-By: cagent
name: "anthropic streaming internal server error",
186
+
err: fmt.Errorf("error receiving from stream: %w", errors.New(`received error while streaming: {"type":"error","error":{"details":null,"type":"api_error","message":"Internal server error"},"request_id":"req_test"}`)),
// server error), then succeeds. No fallback models are configured.
889
+
successStream:=newStreamBuilder().
890
+
AddContent("Success after transient failures").
891
+
AddStopWithUsage(10, 5).
892
+
Build()
893
+
primary:=&countingProvider{
894
+
id: "primary/counting",
895
+
failCount: 2,
896
+
err: errors.New(`error receiving from stream: received error while streaming: {"type":"error","error":{"details":null,"type":"api_error","message":"Internal server error"}}`),
0 commit comments