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

@@ -168,6 +168,9 @@ describe("doctor state integrity oauth dir checks", () => {
expect(text).toContain("recent sessions are missing transcripts");
expect(text).toMatch(/openclaw sessions --store ".*sessions\.json"/);
expect(text).toMatch(/openclaw sessions cleanup --store ".*sessions\.json" --dry-run/);
expect(text).toMatch(
/openclaw sessions cleanup --store ".*sessions\.json" --enforce --fix-missing/,
);
expect(text).not.toContain("--active");
expect(text).not.toContain(" ls ");
});