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
This commit is contained in:
parent
00499aadd4
commit
6073d2c93c
6 changed files with 1655 additions and 186 deletions
|
@ -221,6 +221,9 @@ impl ExampleContext {
|
|||
ThreadEvent::ShowError(thread_error) => {
|
||||
tx.try_send(Err(anyhow!(thread_error.clone()))).ok();
|
||||
}
|
||||
ThreadEvent::RetriesFailed { .. } => {
|
||||
// Ignore retries failed events
|
||||
}
|
||||
ThreadEvent::Stopped(reason) => match reason {
|
||||
Ok(StopReason::EndTurn) => {
|
||||
tx.close_channel();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue