Skip to content

Extend model error retry logic to all providers#114

Merged
tsubasakong merged 1 commit intomainfrom
fix/extend-retry-to-all-providers
Mar 17, 2026
Merged

Extend model error retry logic to all providers#114
tsubasakong merged 1 commit intomainfrom
fix/extend-retry-to-all-providers

Conversation

@tsubasakong
Copy link
Collaborator

Summary

  • Remove the OpenAI-only guard from the retry logic so all model providers benefit from automatic retries on transient server errors (5xx).

Why

Google Gemini (and other non-OpenAI providers) returned 503 "high demand" errors that caused immediate task failure. The existing retry logic (max 2 retries with exponential backoff) was gated behind an isOpenAiLikeRuntimeModel check, excluding all other providers.

Changes

  • src/agent/runtime/attempt.ts: Removed the isOpenAiLikeRuntimeModel(modelInfo) condition from isRetryableUpstreamModelError, so hasRetryableServerErrorSignature alone determines retryability.

Testing

  • All 649 existing tests pass.
  • Build succeeds with no type errors.
  • The retry behavior (max 2 retries, 1s/2s exponential backoff) is unchanged — only the provider restriction is lifted.

Checklist

  • I ran relevant tests, or the Testing section explains why I did not.
  • I updated docs, or confirmed no doc changes were needed.
  • I confirmed the PR does not include secrets, credentials, or private data.

🤖 Generated with Claude Code

Previously, transient 5xx server errors were only retried for OpenAI-like
models. This caused tasks using other providers (e.g. Google Gemini) to
fail immediately on temporary outages like 503 high-demand errors.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Mar 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
openpocket Ready Ready Preview, Comment Mar 17, 2026 5:33pm

Request Review

@tsubasakong tsubasakong merged commit 8c482ba into main Mar 17, 2026
5 checks passed
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