Repository navigation
Retry turns that fail on provider server and connection errors - #5931
Merged
ymichael merged 1 commit intoOct 20, 2026
Merged
Conversation
Provider retry only scheduled retries for overloads and rate limits, so a turn that failed because the provider or Account Pooler was unreachable (HTTP 500/502/503/504, internal, connection-failed, stream-disconnected) stayed in error until someone sent a new message. These failures now retry with exponential backoff starting at one minute, sharing the existing five-attempt cap. Unauthorized and other non-transient failures are still declined. Refs #4839 Co-Authored-By: Claude Opus 5.5 <[email protected]>
ymichael
deleted the
bb/reproduce-and-analyze-github-issue-4839-thr_zrdzsq2xsj
branch
October 20, 2026 23:44
This was referenced Oct 23, 2026
2 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Human comments
What was wrong
Provider retry only scheduled retries for two kinds of failure: structured overloads (529) and rate limits. Every other failure was declined as
not-retryable. When the Account Pooler, or the provider itself, briefly cannot be reached, Claude Code records the failure as{category: "internal", httpStatusCode: 502}and Codex records{category: "stream-disconnected", httpStatusCode: 502}. Neither matched, so the thread stayed inerroruntil someone sent a new message. The 429 half of #4839 was already fixed by #5283; this PR covers the 502/503 half. Nothing in the history shows 5xx failures being excluded on purpose: #1027 scoped the plugin to subscription limits, and #2801 added onlyoverloaded.What changed
plugins/provider-retry/src/retry-policy.ts: a failure counts as "provider unavailable" when its HTTP status is 500, 502, 503 or 504, or its category isinternal,connection-failedorstream-disconnected. Such failures are retried for every thread, pooled or not, with exponential backoff that starts at 1 minute: 1–2, 2–4, 4–8 and 8–16 minutes with jitter. They share the existing 5-attempt cap, and the queue card shows "Provider unavailable". Overload timing is unchanged; the backoff helper now takes a base delay. Rate-limit failures keep their existing handling.unauthorized(401) and other permanent failures are still declined.bb guide pluginsandbb guide providerstemplates.How you verified
errorInfoshapes above.plugins/provider-retry/server.test.ts):pnpm exec turbo run test typecheck lint --filter=bb-plugin-provider-retry --filter=@bb/templates: 26 and 46 tests pass.pnpm exec turbo run test --filter=@bb/server -- test/threads/turn-failed-retry.test.ts test/services/plugins/plugin-authoring-docs.test.ts test/services/plugins/builtin-plugins.test.ts: 60 tests pass.pnpm exec turbo run test typecheck --filter=@bb/plugin-registry --filter=@bb/bundled-plugins: pass.oxfmt --checkis clean.pnpm start:worktree):Skipped: not-retryable.Fixes #4839
🤖 Generated with Claude Code