🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.
TypeScript analyticsautogenevaluationlangchainlarge-language-modelsllama-indexllmllm-evaluationllm-observabilityllmopsmonitoringobservabilityopen-sourceopenaiplaygroundprompt-engineeringprompt-managementself-hostedycombinator
fix(evals): use correct events flag for code eval test runs (#13884)
Tobias Wochinger368aef0ef13c
diff --git a/web/src/__tests__/server/code-eval-test-run-trpc.servertest.ts b/web/src/__tests__/server/code-eval-test-run-trpc.servertest.tsindex 05932017c7..f4e6f9f4bf 100644--- a/web/src/__tests__/server/code-eval-test-run-trpc.servertest.ts+++ b/web/src/__tests__/server/code-eval-test-run-trpc.servertest.ts@@ -28,9 +28,7 @@ vi.hoisted(() => {const orgIds: string[] = [];const maybe =- env.LANGFUSE_ENABLE_EVENTS_TABLE_OBSERVATIONS === "true"- ? describe- : describe.skip;+ env.LANGFUSE_ENABLE_EVENTS_TABLE_FLAGS === "true" ? describe : describe.skip;async function prepare() {const { project, org } = await createOrgProjectAndApiKey();@@ -209,7 +207,7 @@ maybe("evals.testRunCodeEval", () => {expect(Number(scoreCount[0]?.count ?? 0)).toBe(0);});- it("runs against legacy observations when events table observations are disabled", async () => {+ it("runs against legacy observations when events table evals are disabled", async () => {const { project, caller } = await prepare();const observationId = randomUUID();const traceId = randomUUID();@@ -248,13 +246,13 @@ maybe("evals.testRunCodeEval", () => {]);const mutableEnv = env as unknown as {- LANGFUSE_ENABLE_EVENTS_TABLE_OBSERVATIONS: "true" | "false";+ LANGFUSE_ENABLE_EVENTS_TABLE_FLAGS: "true" | "false";};- const originalEventsTableObservationFlag =- mutableEnv.LANGFUSE_ENABLE_EVENTS_TABLE_OBSERVATIONS;+ const originalEventsTableFlagsFlag =+ mutableEnv.LANGFUSE_ENABLE_EVENTS_TABLE_FLAGS;try {- mutableEnv.LANGFUSE_ENABLE_EVENTS_TABLE_OBSERVATIONS = "false";+ mutableEnv.LANGFUSE_ENABLE_EVENTS_TABLE_FLAGS = "false";const response = await caller.evals.testRunCodeEval({projectId: project.id,@@ -298,8 +296,8 @@ maybe("evals.testRunCodeEval", () => {executionTraceFromTimestamp: expect.any(Date),});} finally {- mutableEnv.LANGFUSE_ENABLE_EVENTS_TABLE_OBSERVATIONS =- originalEventsTableObservationFlag;+ mutableEnv.LANGFUSE_ENABLE_EVENTS_TABLE_FLAGS =+ originalEventsTableFlagsFlag;}});diff --git a/web/src/features/evals/server/codeEvalTestRun.ts b/web/src/features/evals/server/codeEvalTestRun.tsindex f0ebfe2092..c36010f8e5 100644--- a/web/src/features/evals/server/codeEvalTestRun.ts+++ b/web/src/features/evals/server/codeEvalTestRun.ts@@ -227,7 +227,7 @@ async function getObservationForEvalById(params: {shouldReadFromObservationsTable?: boolean;}): Promise<ObservationForEval> {if (- env.LANGFUSE_ENABLE_EVENTS_TABLE_OBSERVATIONS !== "true" ||+ env.LANGFUSE_ENABLE_EVENTS_TABLE_FLAGS !== "true" ||params.shouldReadFromObservationsTable) {return getObservationForEvalByIdFromLegacyObservations(params);