{"record":{"id":"4ccb4661ae3dfc03","repo":"earendil-works/pi","slug":"invalid-entry","errorCode":"invalid_entry","errorMessage":"Entry ${current} not found","messagePattern":"Entry (.+?) not found","errorType":"error_code","errorClass":"SessionError","httpStatus":null,"severity":"error","filePath":"packages/agent/src/harness/compaction/branch-summarization.ts","lineNumber":104,"sourceCode":"): Promise<CollectEntriesResult> {\n\tif (!oldLeafId) {\n\t\treturn { entries: [], commonAncestorId: null };\n\t}\n\tconst oldPath = new Set((await session.findEntriesOnBranch({ start: oldLeafId })).map((entry) => entry.id));\n\tconst targetPath = await session.findEntriesOnBranch({ start: targetId });\n\tlet commonAncestorId: string | null = null;\n\tfor (const entry of targetPath) {\n\t\tif (oldPath.has(entry.id)) {\n\t\t\tcommonAncestorId = entry.id;\n\t\t\tbreak;\n\t\t}\n\t}\n\tconst entries: Entry[] = [];\n\tlet current: string | null = oldLeafId;\n\n\twhile (current && current !== commonAncestorId) {\n\t\tconst entry = await session.getEntry(current);\n\t\tif (!entry) throw new SessionError(\"invalid_entry\", `Entry ${current} not found`);\n\t\tentries.push(entry);\n\t\tcurrent = entry.parentId;\n\t}\n\tentries.reverse();\n\n\treturn { entries, commonAncestorId };\n}\nfunction getMessageFromEntry(entry: Entry): AgentMessage | undefined {\n\tswitch (entry.type) {\n\t\tcase \"message\":\n\t\t\tif (entry.message.role === \"toolResult\") return undefined;\n\t\t\treturn entry.message;\n\n\t\tcase \"branch_summary\":\n\t\t\treturn createBranchSummaryMessage(entry.summary, entry.fromId, entry.timestamp);\n\n\t\tcase \"compaction\":\n\t\t\treturn createCompactionSummaryMessage(entry.summary, entry.tokensBefore, entry.timestamp);","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/earendil-works/pi/blob/4af9d21d3b4d664e4a29fcabfec85171077248e3/packages/agent/src/harness/compaction/branch-summarization.ts#L86-L122","documentation":"Error \"Entry ${current} not found\" thrown in earendil-works/pi.","triggerScenarios":"Thrown at packages/agent/src/harness/compaction/branch-summarization.ts:104 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the entry id exists before summarizing; list the available branch entries and pass a valid id."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4af9d21d3b4d664e4a29fcabfec85171077248e3","analyzedAt":"2026-08-24T13:07:14.692Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}