Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions packages/evals/src/cli/runTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
Expand Down Expand Up @@ -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.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

User-aborted tasks should not trigger retries. If a task is aborted (likely user-initiated at line 303-305), the retry will be triggered anyway when API instability is detected. Consider checking taskAbortedAt to prevent retrying intentionally cancelled tasks.

Fix it with Roo Code or mention @roomote and request a fix.

}
}
Loading