singularity-forge/packages
Lex Christopherson ca8697ae26 feat: use server-requested retry delay for Anthropic rate limits
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>
2026-03-13 16:51:17 -06:00
..
native feat: native Rust output truncation module (#268) 2026-03-13 16:48:49 -06:00
pi-agent-core feat: vendor Pi source into workspace monorepo 2026-03-12 21:55:17 -06:00
pi-ai feat: use server-requested retry delay for Anthropic rate limits 2026-03-13 16:51:17 -06:00
pi-coding-agent feat: use server-requested retry delay for Anthropic rate limits 2026-03-13 16:51:17 -06:00
pi-tui fix: truncate oversized TUI lines instead of crashing (#287) 2026-03-13 16:50:58 -06:00