earendil-works/pi · error · Error
First kept entry has no UUID - session may need migration
Error message
First kept entry has no UUID - session may need migration
What it means
Data-integrity failure in compaction: the entry chosen as the first kept entry after summarization has no UUID, so the compaction entry cannot reference a stable point in the transcript. Usually indicates an old session file predating UUID-based entries.
Solutions
- Migrate or re-save the session so entries carry UUIDs
- Start a new session if migration is not available
- Report a bug with the session file for migration support
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at packages/coding-agent/src/core/compaction/compaction.ts:940 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/1c366d63b175c9c1.
Report an issue: GitHub.
Appendix: source
Thrown at packages/coding-agent/src/core/compaction/compaction.ts:940
customInstructions,
previousSummary,
thinkingLevel,
streamFn,
env,
retry,
callbacks,
sessionId,
);
summary = result.text;
summaryUsage = result.usage;
}
// Compute file lists and append to summary
const { readFiles, modifiedFiles } = computeFileLists(fileOps);
summary += formatFileOperations(readFiles, modifiedFiles);
if (!firstKeptEntryId) {
throw new Error("First kept entry has no UUID - session may need migration");
}
return {
summary,
firstKeptEntryId,
tokensBefore,
usage: summaryUsage,
details: { readFiles, modifiedFiles } as CompactionDetails,
};
}
/**
* Generate a summary for a turn prefix (when splitting a turn).
*/
async function generateTurnPrefixSummary(
messages: AgentMessage[],
model: Model<any>,
reserveTokens: number,View on GitHub (pinned to 4af9d21d3b)