Adding a retry button for cases when the streaming response breaks with no text or error (#5505)
This commit is contained in:
1 file changed
+13
-1
+13
-1
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user