fix(sessions): add fix-missing cleanup path for orphaned store entries

Introduce a sessions cleanup flag to prune entries whose transcript files are missing and surface the exact remediation command from doctor to resolve missing-transcript deadlocks.

Made-with: Cursor
(cherry picked from commit 690d3d596b)
This commit is contained in:
SidQin-cyber
2026-02-26 20:21:47 +08:00
committed by Peter Steinberger
parent a481ed00f5
commit 71e45ceecc
6 changed files with 121 additions and 5 deletions

View File

@@ -438,6 +438,7 @@ export async function noteStateIntegrity(
`- ${missing.length}/${recentTranscriptCandidates.length} recent sessions are missing transcripts.`,
` Verify sessions in store: ${formatCliCommand(`openclaw sessions --store "${absoluteStorePath}"`)}`,
` Preview cleanup impact: ${formatCliCommand(`openclaw sessions cleanup --store "${absoluteStorePath}" --dry-run`)}`,
` Prune missing entries: ${formatCliCommand(`openclaw sessions cleanup --store "${absoluteStorePath}" --enforce --fix-missing`)}`,
].join("\n"),
);
}