Skip to content

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

fix(api): scores parsing error on GET /scores leading to dropped scores

Marc Klingen27e1dca4df2d
diff --git a/web/src/features/public-api/types/scores.ts b/web/src/features/public-api/types/scores.ts
index 318f29726a..e9eca27533 100644
--- a/web/src/features/public-api/types/scores.ts
+++ b/web/src/features/public-api/types/scores.ts
@@ -68,7 +68,7 @@ const GetScoresDataBase = z.object({
traceId: z.string(),
observationId: z.string().nullish(),
trace: z.object({
- userId: z.string(),
+ userId: z.string().nullish(),
}),
configId: z.string().nullish(),
});
diff --git a/web/src/pages/api/public/scores.ts b/web/src/pages/api/public/scores.ts
index 87a2415933..1181b2c337 100644
--- a/web/src/pages/api/public/scores.ts
+++ b/web/src/pages/api/public/scores.ts
@@ -137,6 +137,7 @@ export default withMiddlewares({
if (result.success) {
acc.push(result.data);
} else {
+ console.error("Score parsing error: ", result.error);
Sentry.captureException(result.error);
}
return acc;