|
@@ -217,11 +217,23 @@ export const runTask = async ({ run, task, publish, logger }: RunTaskOptions) =>
|
|
|
"diff_error",
|
|
"diff_error",
|
|
|
"condense_context",
|
|
"condense_context",
|
|
|
"condense_context_error",
|
|
"condense_context_error",
|
|
|
|
|
+ "api_req_retry_delayed",
|
|
|
|
|
+ "api_req_retried",
|
|
|
]
|
|
]
|
|
|
|
|
|
|
|
|
|
+ let isApiUnstable = false
|
|
|
|
|
+
|
|
|
client.on(IpcMessageType.TaskEvent, async (taskEvent) => {
|
|
client.on(IpcMessageType.TaskEvent, async (taskEvent) => {
|
|
|
const { eventName, payload } = 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.
|
|
// Publish all events except for these to Redis.
|
|
|
if (!ignoreEvents.broadcast.includes(eventName)) {
|
|
if (!ignoreEvents.broadcast.includes(eventName)) {
|
|
|
await publish({ ...taskEvent, taskId: task.id })
|
|
await publish({ ...taskEvent, taskId: task.id })
|
|
@@ -388,4 +400,8 @@ export const runTask = async ({ run, task, publish, logger }: RunTaskOptions) =>
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
logger.close()
|
|
logger.close()
|
|
|
|
|
+
|
|
|
|
|
+ if (isApiUnstable) {
|
|
|
|
|
+ throw new Error("API is unstable, throwing to trigger a retry.")
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|