The first number is the count of modules that contain a package that imports this one.
The module count is a better indicator of popularity than the package count.
A module with 100 importing packages is counted only once instead of 100 times,
reflecting the fact that the choice to use the package was likely made only once,
not 100 times.
A '?' means that the value hasn't been computed yet.
Package chatretry provides retry logic for transient LLM provider
errors. It classifies errors as retryable or permanent and uses
exponential backoff with provider retry hints when available.
const (
// InitialDelay is the backoff duration for the first retry// attempt.
InitialDelay = 1 * time.Second// MaxDelay is the upper bound for the exponential backoff// duration. Matches the cap used in coder/mux.
MaxDelay = 60 * time.Second// MaxAttempts is the upper bound on retry attempts before// giving up. With a 60s max backoff this allows roughly// 25 minutes of retries, which is reasonable for transient// LLM provider issues.
MaxAttempts = 25
)
Delay returns the backoff duration for the given 0-indexed attempt.
Uses exponential backoff: min(InitialDelay * 2^attempt, MaxDelay).
Matches the backoff curve used in coder/mux.
Retry calls fn repeatedly until it succeeds, returns a
non-retryable error, ctx is canceled, or MaxAttempts is reached.
Retries use exponential backoff capped at MaxDelay, unless the
normalized error includes a longer provider Retry-After hint.
The onRetry callback (if non-nil) is called before each retry
attempt, giving the caller a chance to reset state, log, or
publish status events.
OnRetryFn is called before each retry attempt with the attempt
number (1-indexed), the raw error that triggered the retry, the
normalized error payload, and the delay before the next attempt.
RetryFn is the function to retry. It receives a context and returns
an error. The context may be a child of the original with adjusted
deadlines for individual attempts.