{"record":{"id":"75374a8cb4fa2b69","repo":"n8n-io/n8n","slug":"found-multiple-eval-results-entries-for-test-case-75374a","errorCode":null,"errorMessage":"Found multiple eval-results entries for test case \"${serializedTestCaseName}\"","messagePattern":"Found multiple eval-results entries for test case \"(.+?)\"","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/@n8n/instance-ai/evaluations/eval-results-artifact.ts","lineNumber":54,"sourceCode":"\tserializedTestCaseName: string | undefined,\n): StoredTestCaseResult<TEvalResult> | undefined {\n\tconst slug = getTestCaseSlug(testCasePath);\n\tconst bySlug = evalResults.testCases.filter(\n\t\t(testCaseResult) => testCaseResult.testCaseFile === slug,\n\t);\n\tif (bySlug.length === 1) return bySlug[0];\n\tif (bySlug.length > 1) {\n\t\tthrow new Error(`Found multiple eval-results entries for test case slug \"${slug}\"`);\n\t}\n\n\tconst byName = serializedTestCaseName\n\t\t? evalResults.testCases.filter(\n\t\t\t\t(testCaseResult) => testCaseResult.name === serializedTestCaseName,\n\t\t\t)\n\t\t: [];\n\tif (byName.length === 1) return byName[0];\n\tif (byName.length > 1) {\n\t\tthrow new Error(\n\t\t\t`Found multiple eval-results entries for test case \"${serializedTestCaseName}\"`,\n\t\t);\n\t}\n\n\treturn evalResults.testCases.length === 1 ? evalResults.testCases[0] : undefined;\n}\n\nexport function findStoredVerifierRun<TEvalResult>(\n\tstoredTestCase: StoredTestCaseResult<TEvalResult> | undefined,\n\tscenarioName: string,\n): StoredVerifierRun<TEvalResult> | undefined {\n\tconst storedScenario = storedTestCase?.scenarios.find(\n\t\t(scenarioResult) => scenarioResult.name === scenarioName,\n\t);\n\tif (!storedScenario) return undefined;\n\n\tfor (let runIndex = 0; runIndex < storedScenario.runs.length; runIndex++) {\n\t\tconst run = storedScenario.runs[runIndex];","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/instance-ai/evaluations/eval-results-artifact.ts#L36-L72","documentation":"Thrown by `findStoredTestCaseResult()` as the fallback branch: slug-based matching (error 434) did not yield exactly one entry, so the function tried matching by the serialized test-case name (`serializedTestCaseName`), and that ALSO matched more than one entry. This indicates duplicate display names in `eval-results.json` — multiple test-case blocks share the same `name` field. The function refuses to guess which one is canonical; the caller must disambiguate the source data.","triggerScenarios":"Two different test-case entries share the same `name` (e.g. both named 'cross-team linear report') but have different `testCaseFile` slugs. A copy-paste of an entry that kept the name. A name-collision between a workflow case and an agent case that wasn't disambiguated.","commonSituations":"Hand-editing the artifact. A writer bug that uses a default name when none was set. Two case files with the same top-level `name` field.","solutions":["Open `eval-results.json` and find the entries sharing the cited name.","Give each a unique `name` (or remove the stale duplicate).","If the duplication comes from source case files with the same `name`, rename one in its JSON.","Regenerate the artifact rather than editing by hand where possible."],"exampleFix":"// before (eval-results.json)\n{\n  \"testCases\": [\n    { \"name\": \"linear-report\", \"testCaseFile\": \"a\" },\n    { \"name\": \"linear-report\", \"testCaseFile\": \"b\" }\n  ]\n}\n// after\n{\n  \"testCases\": [\n    { \"name\": \"linear-report-a\", \"testCaseFile\": \"a\" },\n    { \"name\": \"linear-report-b\", \"testCaseFile\": \"b\" }\n  ]\n}","handlingStrategy":"validation","validationCode":"function assertUniqueNames(results: StoredEvalResults<unknown>): void {\n  const seen = new Set<string>();\n  for (const t of results.testCases) {\n    if (t.name && seen.has(t.name)) throw new Error(`Duplicate name: ${t.name}`);\n    if (t.name) seen.add(t.name);\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ensure case files declare a unique top-level `name`.","Don't hand-edit the artifact — regenerate it.","Add a uniqueness check to whatever writes `eval-results.json`."],"tags":["eval-results","artifact","data-integrity","duplicate","configuration"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}