Skip to content

feat(retry): let an error decide for itself whether it is retryable - #438

Merged
taciturnaxolotl merged 1 commit into
mainfrom
feat/retryable-errors
Oct 30, 2026
Merged

taciturnaxolotl merged 1 commit into
mainfrom
feat/retryable-errors

Conversation

@taciturnaxolotl

Copy link
Copy Markdown
Member

Retry decisions are made by matching on what an error looks like: a ProviderError, a net.Error, or a transport error. An error that knows it is worth retrying, but is none of those, has to dress up as one. Crush's request timeout was posing as a net.Error just to get retried, and even then a retryable timeout that wrapped a 400 ProviderError lost to the provider error's own verdict.

  • Adds a RetryableError interface with IsRetryable() bool. The outermost one in the chain decides. ProviderError already has that method, so it satisfies the interface and its separate branch is gone.
  • An error that wraps a context error is still never retried. The abort check runs first, and the interface doc says so.

Used by charmbracelet/crush#3985, which has to point at a release containing this before it can merge.

💘 Generated with Crush

💘 Generated with Crush

Assisted-by: Crush:claude-opus-5-5
@taciturnaxolotl
taciturnaxolotl merged commit b494fd1 into main Oct 30, 2026
6 checks passed
@taciturnaxolotl
taciturnaxolotl deleted the feat/retryable-errors branch October 30, 2026 14:31
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.

2 participants