Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

fix(evals): fix score filtering on evaluator runs page (#13225)

Tobias Wochingerbc9ef188b42f
diff --git a/web/src/features/evals/components/eval-log.tsx b/web/src/features/evals/components/eval-log.tsx
index 94cec165c1..7c5a966c8e 100644
--- a/web/src/features/evals/components/eval-log.tsx
+++ b/web/src/features/evals/components/eval-log.tsx
@@ -32,7 +32,6 @@ export type JobExecutionRow = {
startTime?: string;
endTime?: string;
traceId?: string;
- sessionId?: string;
executionTraceId?: string;
templateId: string;
evaluatorId: string;
@@ -161,20 +160,6 @@ export default function EvalLogTable({
) : undefined;
},
}),
- columnHelper.accessor("sessionId", {
- id: "sessionId",
- header: "Session",
- enableHiding: true,
- cell: (row) => {
- const sessionId = row.getValue();
- return sessionId ? (
- <TableLink
- path={`/project/${projectId}/sessions/${encodeURIComponent(sessionId)}`}
- value={sessionId}
- />
- ) : undefined;
- },
- }),
columnHelper.accessor("executionTraceId", {
id: "executionTraceId",
header: "Execution Trace",
@@ -243,7 +228,6 @@ export default function EvalLogTable({
startTime: jobConfig.startTime?.toLocaleString() ?? undefined,
endTime: jobConfig.endTime?.toLocaleString() ?? undefined,
traceId: jobConfig.jobInputTraceId ?? undefined,
- sessionId: jobConfig.sessionId ?? undefined,
executionTraceId: jobConfig.executionTraceId ?? undefined,
templateId: jobConfig.jobTemplateId ?? "",
evaluatorId: jobConfig.jobConfigurationId,
diff --git a/web/src/features/evals/server/router.ts b/web/src/features/evals/server/router.ts
index 067109c9d1..3114b7c017 100644
--- a/web/src/features/evals/server/router.ts
+++ b/web/src/features/evals/server/router.ts
@@ -66,6 +66,12 @@ import {
} from "@/src/features/evals/server/audit-log-resource-types";
import { getEvaluatorDefinitionPreflightError } from "@/src/features/evals/server/evaluator-preflight";
+// Filter columns that used to be backed by the Postgres `traces` and
+// `scores` JOINs. Those tables now live in ClickHouse, so the eval logs
+// query can no longer resolve them. Filters referencing these columns are
+// dropped server-side to keep bookmarked URLs from failing.
+const DEPRECATED_FILTER_COLUMNS = new Set(["scoreValue", "sessionId"]);
+
const ConfigWithTemplateSchema = z.object({
id: z.string(),
projectId: z.string(),
@@ -1332,8 +1338,15 @@ export const evalRouter = createTRPCRouter({
scope: "evalJobExecution:read",
});
+ // Strip deprecated filters — these columns were removed from the UI
+ // because they required traces/scores data that no longer lives in
+ // Postgres, but bookmarked URLs may still include them.
+ const filters = input.filter.filter(
+ (f) => !DEPRECATED_FILTER_COLUMNS.has(f.column),
+ );
+
const filterCondition = tableColumnsToSqlFilterAndPrefix(
- input.filter,
+ filters,
evalExecutionsFilterCols,
"job_executions",
);
@@ -1352,7 +1365,7 @@ export const evalRouter = createTRPCRouter({
| "jobConfigurationId"
| "executionTraceId"
| "error"
- > & { sessionId: string | null }
+ >
>
>(
generateExecutionsQuery(
@@ -1365,8 +1378,7 @@ export const evalRouter = createTRPCRouter({
je.job_template_id as "jobTemplateId",
je.job_configuration_id as "jobConfigurationId",
je.execution_trace_id as "executionTraceId",
- je.error,
- t.session_id as "sessionId"
+ je.error
`,
input.projectId,
filterCondition,
@@ -1589,8 +1601,6 @@ const generateExecutionsQuery = (
SELECT
${select}
FROM job_executions je
- LEFT JOIN traces t ON je.job_input_trace_id = t.id AND je.project_id = t.project_id
- LEFT JOIN scores s ON je.job_output_score_id = s.id AND je.project_id = s.project_id
WHERE je.project_id = ${projectId}
${filterCondition}
AND je.status != 'CANCELLED'
diff --git a/web/src/features/filters/config/eval-logs-config.ts b/web/src/features/filters/config/eval-logs-config.ts
index 1b0be0e589..3ff8a583e0 100644
--- a/web/src/features/filters/config/eval-logs-config.ts
+++ b/web/src/features/filters/config/eval-logs-config.ts
@@ -21,23 +21,10 @@ export const evalLogFilterConfig: FilterConfig = {
column: "traceId",
label: "Trace ID",
},
- {
- type: "string" as const,
- column: "sessionId",
- label: "Session ID",
- },
{
type: "string" as const,
column: "executionTraceId",
label: "Execution Trace ID",
},
- {
- type: "numeric" as const,
- column: "scoreValue",
- label: "Score Value",
- min: 0,
- max: 1,
- step: 0.01,
- },
],
};
diff --git a/web/src/server/api/definitions/evalExecutionsTable.ts b/web/src/server/api/definitions/evalExecutionsTable.ts
index 7d093dd4be..f841ab2cb1 100644
--- a/web/src/server/api/definitions/evalExecutionsTable.ts
+++ b/web/src/server/api/definitions/evalExecutionsTable.ts
@@ -16,22 +16,10 @@ export const evalExecutionsFilterCols: ColumnDefinition[] = [
type: "string",
internal: 'je."job_input_trace_id"',
},
- {
- name: "Session ID",
- id: "sessionId",
- type: "string",
- internal: 't."session_id"',
- },
{
name: "Execution Trace ID",
id: "executionTraceId",
type: "string",
internal: 'je."execution_trace_id"',
},
- {
- name: "Score Value",
- id: "scoreValue",
- type: "number",
- internal: 's."value"',
- },
];