From 46e63165f0c07fbe92ac189b80bdc1f868066d42 Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Thu, 9 Oct 2025 15:34:16 +0000 Subject: [PATCH] refactor: do not generate user journeys when they are not used Arguably these user journeys may be nice to show in the UI of individual apps, but without any testing there, it doesn't make sense to generate them and consume more tokens. --- runner/orchestration/generate.ts | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/runner/orchestration/generate.ts b/runner/orchestration/generate.ts index 89e160c..9edf72b 100644 --- a/runner/orchestration/generate.ts +++ b/runner/orchestration/generate.ts @@ -322,23 +322,24 @@ async function startEvaluationTask( break; } - const userJourneys = await generateUserJourneysForApp( - ratingLlm, - rootPromptDef.name, - defsToExecute[0].prompt, - initialResponse.files, - abortSignal, - ); + const userJourneys = config.enableUserJourneyTesting + ? await generateUserJourneysForApp( + ratingLlm, + rootPromptDef.name, + defsToExecute[0].prompt, + initialResponse.files, + abortSignal, + ) + : undefined; // TODO: Only execute the serve command on the "final working attempt". // TODO: Incorporate usage. - const userJourneyAgentTaskInput: BrowserAgentTaskInput | undefined = - config.enableUserJourneyTesting - ? { - userJourneys: userJourneys.result, - appPrompt: defsToExecute[0].prompt, - } - : undefined; + const userJourneyAgentTaskInput: BrowserAgentTaskInput | undefined = userJourneys + ? { + userJourneys: userJourneys.result, + appPrompt: defsToExecute[0].prompt, + } + : undefined; const attemptDetails: AttemptDetails[] = []; // Store details for assessment.json