# Automatically retry when API is Overloaded or 500s \(\#33275\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/6073d2c93c4bc9ded0c6fc3a22bce814f4ac9716)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 6073d2c93c4bc9ded0c6fc3a22bce814f4ac9716

Requested commit: 6073d2c93c4bc9ded0c6fc3a22bce814f4ac9716

Commit: 6073d2c93c4bc9ded0c6fc3a22bce814f4ac9716

Tree: 59fee2bbda662bff745fa905f9d7be794e2ab53c

Author: Richard Feldman

Committer: GitHub

## Message

```
Automatically retry when API is Overloaded or 500s (#33275)

<img width="484" alt="Screenshot 2025-06-25 at 2 26 16 PM"
src="https://github.com/user-attachments/assets/340f15d7-b115-4895-bae8-b12a915bfda1"
/>

<img width="460" alt="Screenshot 2025-06-25 at 2 26 08 PM"
src="https://github.com/user-attachments/assets/6e587a38-d542-405f-809f-402e87520538"
/>

Now we:
* Automatically retry up to 3 times on upstream Overloaded or 500 errors
(currently for Anthropic only; will add others in future PRs)
* Also automatically retry on rate limit errors (using the provided
duration to wait, if we were given one)
* Give you a notification if you don't have Zed open and we stopped the
thread because of an error

Still todo in future PRs:
* Update collab to report Overloaded and 500 errors differently if
collab itself is passing through an upstream error vs not (currently we
report these as "Zed's API is overloaded" when actually it's the
upstream one!)
* Updating providers other than Anthropic to categorize their errors so
that they benefit from this
* Expanding graceful error handling/retry to other things besides
Overloaded and 500 errors (e.g. connection reset)

Release Notes:

- Automatically retry in Agent Panel instead of erroring out when an
upstream AI API is overloaded or 500s
- Show a notification when an Agent thread errors out and Zed is not the
active window
```

## Parents

- [00499aadd452cacf074ccaeabd0c9e11fdbaa8a1](https://git.cafe/gitcafe/zed/commit/00499aadd452cacf074ccaeabd0c9e11fdbaa8a1?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/6073d2c93c4bc9ded0c6fc3a22bce814f4ac9716?format=markdown)
