Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Don't auto-retry in certain circumstances (#35037)

Richard Feldman2a9355a3d25d
diff --git a/crates/agent/src/thread.rs b/crates/agent/src/thread.rs
index 1b3b022ab23..1af27ca8a7a 100644
--- a/crates/agent/src/thread.rs
+++ b/crates/agent/src/thread.rs
@@ -2037,6 +2037,12 @@ impl Thread {
if let Some(retry_strategy) =
Thread::get_retry_strategy(completion_error)
{
+ log::info!(
+ "Retrying with {:?} for language model completion error {:?}",
+ retry_strategy,
+ completion_error
+ );
+
retry_scheduled = thread
.handle_retryable_error_with_delay(
&completion_error,
@@ -2246,15 +2252,14 @@ impl Thread {
..
}
| AuthenticationError { .. }
- | PermissionError { .. } => None,
- // These errors might be transient, so retry them
- SerializeRequest { .. }
- | BuildRequestBody { .. }
- | PromptTooLarge { .. }
+ | PermissionError { .. }
+ | NoApiKey { .. }
| ApiEndpointNotFound { .. }
- | NoApiKey { .. } => Some(RetryStrategy::Fixed {
+ | PromptTooLarge { .. } => None,
+ // These errors might be transient, so retry them
+ SerializeRequest { .. } | BuildRequestBody { .. } => Some(RetryStrategy::Fixed {
delay: BASE_RETRY_DELAY,
- max_attempts: 2,
+ max_attempts: 1,
}),
// Retry all other 4xx and 5xx errors once.
HttpResponseError { status_code, .. }