:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
fix(llma): guard against null generation_id in eval runs table (#59204)
Carlos Marchal1a7328a0949f
diff --git a/products/llm_analytics/frontend/evaluations/components/EvaluationRunsTable.tsx b/products/llm_analytics/frontend/evaluations/components/EvaluationRunsTable.tsxindex 01edc2af9801..488cf87e4436 100644--- a/products/llm_analytics/frontend/evaluations/components/EvaluationRunsTable.tsx+++ b/products/llm_analytics/frontend/evaluations/components/EvaluationRunsTable.tsx@@ -29,21 +29,26 @@ export function EvaluationRunsTable(): JSX.Element {{title: 'Generation ID',key: 'generation_id',- render: (_, run) => (- <div className="font-mono text-sm">- <Link- to={- combineUrl(urls.llmAnalyticsTrace(run.trace_id), {- ...traceSearchParams,- event: run.generation_id,- }).url- }- className="text-primary"- >- {run.generation_id.slice(0, 12)}...- </Link>- </div>- ),+ render: (_, run) => {+ if (!run.generation_id) {+ return <span className="font-mono text-sm text-muted">—</span>+ }+ return (+ <div className="font-mono text-sm">+ <Link+ to={+ combineUrl(urls.llmAnalyticsTrace(run.trace_id), {+ ...traceSearchParams,+ event: run.generation_id,+ }).url+ }+ className="text-primary"+ >+ {run.generation_id.slice(0, 12)}...+ </Link>+ </div>+ )+ },},{title: 'Result',diff --git a/products/llm_analytics/frontend/evaluations/llmEvaluationLogic.ts b/products/llm_analytics/frontend/evaluations/llmEvaluationLogic.tsindex e829f49368e6..627ed5805fbe 100644--- a/products/llm_analytics/frontend/evaluations/llmEvaluationLogic.ts+++ b/products/llm_analytics/frontend/evaluations/llmEvaluationLogic.ts@@ -689,7 +689,9 @@ export const llmEvaluationLogic = kea<llmEvaluationLogicType>([(runs): Record<string, EvaluationRun> => {const lookup: Record<string, EvaluationRun> = {}for (const run of runs) {- lookup[run.generation_id] = run+ if (run.generation_id) {+ lookup[run.generation_id] = run+ }}return lookup},diff --git a/products/llm_analytics/frontend/evaluations/types.ts b/products/llm_analytics/frontend/evaluations/types.tsindex 35c37929b301..fa1a1e593e2d 100644--- a/products/llm_analytics/frontend/evaluations/types.ts+++ b/products/llm_analytics/frontend/evaluations/types.ts@@ -71,7 +71,7 @@ export interface EvaluationRun {id: stringevaluation_id: stringevaluation_name: string- generation_id: string+ generation_id: string | nulltrace_id: stringtimestamp: stringresult: boolean | null