From 2ec21eda349d2ee8b0047858c98b9c277daa5dae Mon Sep 17 00:00:00 2001 From: Ara Date: Wed, 13 Aug 2025 16:53:27 -0700 Subject: [PATCH] Adding a retry button for cases when the streaming response breaks with no text or error (#5505) --- src/core/task/index.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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 }