From fb18cb07dea7abb5506d0f12ece307f8e1a3873c Mon Sep 17 00:00:00 2001 From: brucearctor <5032356+brucearctor@users.noreply.github.com> Date: Mon, 20 Apr 2026 19:26:09 -0700 Subject: [PATCH] fix: use userId from eval result to prevent session 404 The eval tab was using the component-level userId input (defaulting to 'user') when fetching sessions for eval results. If the eval runner created sessions with a different user_id, the session lookup would 404. Now uses the userId returned in the eval result response, falling back to the component userId if not present. Also adds userId to the EvaluationResult interface and captures it in the history result mapping. Ref: google/adk-python#5423 --- src/app/components/eval-tab/eval-tab.component.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/app/components/eval-tab/eval-tab.component.ts b/src/app/components/eval-tab/eval-tab.component.ts index 5a833188..7b6c862b 100644 --- a/src/app/components/eval-tab/eval-tab.component.ts +++ b/src/app/components/eval-tab/eval-tab.component.ts @@ -50,6 +50,7 @@ interface EvaluationResult { evalMetricResults: any[]; overallEvalMetricResults: any[]; evalMetricResultPerInvocation?: any[]; + userId: string; sessionId: string; sessionDetails: any; } @@ -385,7 +386,11 @@ export class EvalTabComponent implements OnInit, OnChanges { this.currentEvalResultBySet.get(this.selectedEvalSet) ?.filter((c) => c.evalId == evalId)[0]; const sessionId = evalCaseResult!.sessionId; - this.sessionService.getSession(this.userId(), this.appName(), sessionId) + // Use the userId from the eval result instead of the component-level + // userId to avoid session 404 errors when the eval runner creates + // sessions with a different user_id than the UI default. + const evalUserId = evalCaseResult!.userId || this.userId(); + this.sessionService.getSession(evalUserId, this.appName(), sessionId) .subscribe((res) => { this.addEvalCaseResultToEvents(res, evalCaseResult!); const session = this.fromApiResultToSession(res); @@ -545,6 +550,7 @@ export class EvalTabComponent implements OnInit, OnChanges { evalMetricResults: result.evalMetricResults, evalMetricResultPerInvocation: result.evalMetricResultPerInvocation, + userId: result.userId, sessionId: result.sessionId, sessionDetails: result.sessionDetails, overallEvalMetricResults: