Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"limiter": "^3.0.0",
"marked": "^16.1.1",
"node-fetch": "^3.3.2",
"p-queue": "^8.1.0",
"p-queue": "^9.0.0",
"puppeteer": "^24.10.1",
"sass": "^1.89.2",
"strict-csp": "^1.1.1",
Expand Down
22 changes: 11 additions & 11 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion runner/orchestration/gateways/local_gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ export class LocalGateway implements Gateway<LocalEnvironment> {
reject(err);
});
}),
{throwOnTimeout: true},
);
}

Expand Down
103 changes: 50 additions & 53 deletions runner/orchestration/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,60 +152,57 @@ export async function generateCodeAndAssess(options: {

for (const rootPromptDef of promptsToProcess) {
allTasks.push(
appConcurrencyQueue.add(
async () => {
const evalID = await env.gateway.initializeEval();
let results: AssessmentResult[] | undefined;

try {
results = await callWithTimeout(
`Evaluation of ${rootPromptDef.name}`,
async abortSignal =>
startEvaluationTask(
evalID,
env,
env.gateway,
ratingLlm,
options.model,
rootPromptDef,
options.localMode,
options.skipScreenshots,
options.outputDirectory,
options.ragEndpoint,
abortSignal,
options.skipAxeTesting,
!!options.enableUserJourneyTesting,
!!options.enableAutoCsp,
workerConcurrencyQueue,
progress,
options.autoraterModel || DEFAULT_AUTORATER_MODEL_NAME,
options.a11yRepairAttempts ?? 0,
),
// 10min max per app evaluation. We just want to make sure it never gets stuck.
10,
);
return results;
} catch (e: unknown) {
failedPrompts.push({
promptName: rootPromptDef.name,
error: `${e}`,
stack: e instanceof Error ? e.stack : undefined,
});

let details = `Error: ${e}`;
if (e instanceof Error && e.stack) {
details += `\nStack: ${e.stack}`;
}

progress.log(rootPromptDef, 'error', 'Failed to evaluate code', details);
return [] satisfies AssessmentResult[];
} finally {
progress.evalFinished(rootPromptDef, results || []);
await env.gateway.finalizeEval(evalID);
appConcurrencyQueue.add(async () => {
const evalID = await env.gateway.initializeEval();
let results: AssessmentResult[] | undefined;

try {
results = await callWithTimeout(
`Evaluation of ${rootPromptDef.name}`,
async abortSignal =>
startEvaluationTask(
evalID,
env,
env.gateway,
ratingLlm,
options.model,
rootPromptDef,
options.localMode,
options.skipScreenshots,
options.outputDirectory,
options.ragEndpoint,
abortSignal,
options.skipAxeTesting,
!!options.enableUserJourneyTesting,
!!options.enableAutoCsp,
workerConcurrencyQueue,
progress,
options.autoraterModel || DEFAULT_AUTORATER_MODEL_NAME,
options.a11yRepairAttempts ?? 0,
),
// 10min max per app evaluation. We just want to make sure it never gets stuck.
10,
);
return results;
} catch (e: unknown) {
failedPrompts.push({
promptName: rootPromptDef.name,
error: `${e}`,
stack: e instanceof Error ? e.stack : undefined,
});

let details = `Error: ${e}`;
if (e instanceof Error && e.stack) {
details += `\nStack: ${e.stack}`;
}
},
{throwOnTimeout: true},
),

progress.log(rootPromptDef, 'error', 'Failed to evaluate code', details);
return [] satisfies AssessmentResult[];
} finally {
progress.evalFinished(rootPromptDef, results || []);
await env.gateway.finalizeEval(evalID);
}
}),
);
}

Expand Down
1 change: 0 additions & 1 deletion runner/orchestration/serve-testing-worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ export async function serveAndTestApp(
reject(err);
});
}),
{throwOnTimeout: true},
);
},
);
Expand Down
Loading