diff --git a/src/core/task/index.ts b/src/core/task/index.ts index 4b242e92..09a1d2c7 100644 --- a/src/core/task/index.ts +++ b/src/core/task/index.ts @@ -2511,7 +2511,19 @@ export class Task { }, ], }) - // Returns early to avoid retry since no assistant message was received + + // Offer the user a chance to retry this API request + const { response } = await this.ask( + "api_req_failed", + "No assistant message was received. Would you like to retry the request?", + ) + + if (response === "yesButtonClicked") { + // Signal the loop to continue (i.e., do not end), so it will attempt again + return false + } + + // Returns early to avoid retry since user dismissed return true }