better retry display

This commit is contained in:
Dax Raad
2025-11-17 11:30:55 -05:00
parent a5365ce294
commit 8b19c6c7e4
7 changed files with 118 additions and 211 deletions

View File

@@ -325,16 +325,15 @@ export namespace SessionProcessor {
const error = MessageV2.fromError(e, { providerID: input.providerID })
if (error?.name === "APIError" && error.data.isRetryable) {
attempt++
const delay = SessionRetry.getRetryDelayInMs(error, attempt)
if (delay) {
SessionStatus.set(input.sessionID, {
type: "retry",
attempt,
message: error.data.message,
})
await SessionRetry.sleep(delay, input.abort).catch(() => {})
continue
}
const delay = SessionRetry.delay(error, attempt)
SessionStatus.set(input.sessionID, {
type: "retry",
attempt,
message: error.data.message,
next: Date.now() + delay,
})
await SessionRetry.sleep(delay, input.abort).catch(() => {})
continue
}
input.assistantMessage.error = error
Bus.publish(Session.Event.Error, {