mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-06 08:18:39 +00:00
Retry eval tasks if API instability detected (#9365)
This commit is contained in:
parent
1fa12f6aa6
commit
045c2d6b3b
1 changed files with 16 additions and 0 deletions
|
|
@ -217,11 +217,23 @@ export const runTask = async ({ run, task, publish, logger }: RunTaskOptions) =>
|
|||
"diff_error",
|
||||
"condense_context",
|
||||
"condense_context_error",
|
||||
"api_req_retry_delayed",
|
||||
"api_req_retried",
|
||||
]
|
||||
|
||||
let isApiUnstable = false
|
||||
|
||||
client.on(IpcMessageType.TaskEvent, async (taskEvent) => {
|
||||
const { eventName, payload } = taskEvent
|
||||
|
||||
if (
|
||||
eventName === RooCodeEventName.Message &&
|
||||
payload[0].message.say &&
|
||||
["api_req_retry_delayed", "api_req_retried"].includes(payload[0].message.say)
|
||||
) {
|
||||
isApiUnstable = true
|
||||
}
|
||||
|
||||
// Publish all events except for these to Redis.
|
||||
if (!ignoreEvents.broadcast.includes(eventName)) {
|
||||
await publish({ ...taskEvent, taskId: task.id })
|
||||
|
|
@ -388,4 +400,8 @@ export const runTask = async ({ run, task, publish, logger }: RunTaskOptions) =>
|
|||
}
|
||||
|
||||
logger.close()
|
||||
|
||||
if (isApiUnstable) {
|
||||
throw new Error("API is unstable, throwing to trigger a retry.")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue