Anthropic's 429 responses include retry-after and x-ratelimit-reset-* headers that tell us exactly when to retry. Previously we ignored these and used exponential backoff (2s, 4s, 8s), which is both wrong and misleading in the UI countdown. - Add retryAfterMs to AssistantMessage as the structured carrier - Extract retry-after / x-ratelimit-reset-requests / x-ratelimit-reset-tokens from Anthropic SDK APIError.headers in the provider catch block - Session uses retryAfterMs when present (capped by maxDelayMs=60s), falls back to exponential backoff for errors with no timing hint The UI countdown now shows the actual Anthropic reset time. No UI changes needed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| src | ||
| bedrock-provider.d.ts | ||
| bedrock-provider.js | ||
| package.json | ||
| tsconfig.json | ||