Files
zed/crates/anthropic
Conrad Irwin 5255bd7f27 anthropic: Handle additional API error codes (#62984)
Anthropic now returns distinct error types for billing failures, request
conflicts, and gateway timeouts. Because the Anthropic client did not
recognize these values, they fell through to
`LanguageModelCompletionError::Other`, losing their structured status
and causing callers to apply generic handling.

Recognize the documented `billing_error`, `conflict_error`, and
`timeout_error` codes. Billing failures now become `PaymentRequired`,
conflicts preserve their HTTP 409 status and provider message, and
timeouts become typed upstream HTTP 504 failures. End-to-end tests
exercise each mapping through the HTTP response parsing path.

Testing:

- `cargo fmt --check`
- `cargo nextest run -p anthropic`
- `./script/clippy -p anthropic`
- `git diff --check`

Release Notes:

- Fixed handling of Anthropic billing, conflict, and timeout errors.
2026-08-21 05:38:56 +00:00
..
2025-01-29 23:03:20 +00:00