earendil-works/pi · error · SessionError

invalid_entry

invalid_entry

Error message

Entry ${current} not found

What it means

Error "Entry ${current} not found" thrown in earendil-works/pi.

Source

Thrown at packages/agent/src/harness/compaction/branch-summarization.ts:104

): Promise<CollectEntriesResult> {
	if (!oldLeafId) {
		return { entries: [], commonAncestorId: null };
	}
	const oldPath = new Set((await session.findEntriesOnBranch({ start: oldLeafId })).map((entry) => entry.id));
	const targetPath = await session.findEntriesOnBranch({ start: targetId });
	let commonAncestorId: string | null = null;
	for (const entry of targetPath) {
		if (oldPath.has(entry.id)) {
			commonAncestorId = entry.id;
			break;
		}
	}
	const entries: Entry[] = [];
	let current: string | null = oldLeafId;

	while (current && current !== commonAncestorId) {
		const entry = await session.getEntry(current);
		if (!entry) throw new SessionError("invalid_entry", `Entry ${current} not found`);
		entries.push(entry);
		current = entry.parentId;
	}
	entries.reverse();

	return { entries, commonAncestorId };
}
function getMessageFromEntry(entry: Entry): AgentMessage | undefined {
	switch (entry.type) {
		case "message":
			if (entry.message.role === "toolResult") return undefined;
			return entry.message;

		case "branch_summary":
			return createBranchSummaryMessage(entry.summary, entry.fromId, entry.timestamp);

		case "compaction":
			return createCompactionSummaryMessage(entry.summary, entry.tokensBefore, entry.timestamp);

View on GitHub (pinned to 4af9d21d3b)

Solutions

  1. Verify the entry id exists before summarizing; list the available branch entries and pass a valid id.

When it happens

Trigger: Thrown at packages/agent/src/harness/compaction/branch-summarization.ts:104 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of earendil-works/pi@4af9d21d3b (2026-08-24). Data as JSON: /api/errors/4ccb4661ae3dfc03. Report an issue: GitHub.