Skip to content

Commit 715f8e6

Browse files
committed
More tweaks
1 parent 826dd4d commit 715f8e6

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

packages/evals/src/cli/processTask.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export const processTask = async ({ taskId, logger }: { taskId: number; logger?:
5151
export const processTaskInContainer = async ({
5252
taskId,
5353
logger,
54-
maxRetries = 5,
54+
maxRetries = 10,
5555
}: {
5656
taskId: number
5757
logger: FileLogger
@@ -68,8 +68,6 @@ export const processTaskInContainer = async ({
6868
const command = `pnpm --filter @roo-code/evals cli --taskId ${taskId}`
6969
logger.info(command)
7070

71-
let lastError: unknown
72-
7371
for (let attempt = 0; attempt <= maxRetries; attempt++) {
7472
const containerName = `evals-task-${taskId}.${attempt}`
7573
const args = [`--name ${containerName}`, ...baseArgs]
@@ -92,10 +90,8 @@ export const processTaskInContainer = async ({
9290
try {
9391
const result = await subprocess
9492
logger.info(`container process completed with exit code: ${result.exitCode}`)
95-
return result
93+
return
9694
} catch (error) {
97-
lastError = error
98-
9995
if (error && typeof error === "object" && "exitCode" in error) {
10096
logger.error(
10197
`container process failed with exit code: ${error.exitCode} (attempt ${attempt + 1}/${maxRetries + 1})`,
@@ -111,5 +107,6 @@ export const processTaskInContainer = async ({
111107
}
112108

113109
logger.error(`all ${maxRetries + 1} attempts failed, giving up`)
114-
throw lastError
110+
111+
// TODO: Mark task as failed.
115112
}

packages/evals/src/cli/runEvals.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,17 @@ export const runEvals = async (runId: number) => {
4242
await queue.addAll(
4343
tasks
4444
.filter((task) => task.finishedAt === null)
45-
.map(
46-
(task) => () =>
47-
containerized
48-
? processTaskInContainer({ taskId: task.id, logger })
49-
: processTask({ taskId: task.id, logger }),
50-
),
45+
.map((task) => () => {
46+
try {
47+
if (containerized) {
48+
processTaskInContainer({ taskId: task.id, logger })
49+
} else {
50+
processTask({ taskId: task.id, logger })
51+
}
52+
} catch (error) {
53+
logger.error("error processing task", error)
54+
}
55+
}),
5156
)
5257

5358
logger.info("finishRun")

0 commit comments

Comments
 (0)