From 6ed2aafe3c6e759e8758bef6eb374bf7203572c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A2=81=E7=84=8A=E5=BF=A0?= Date: Tue, 7 Jul 2026 13:49:44 +0800 Subject: [PATCH] fix(doctor): preview missing transcript cleanup (#83630) * fix(doctor): preview missing transcript cleanup * fix(doctor): preview missing transcript cleanup --------- Co-authored-by: YuanHanzhong Co-authored-by: openclaw-clownfish[bot] <280122609+openclaw-clownfish[bot]@users.noreply.github.com> --- src/commands/doctor-state-integrity.test.ts | 7 ++++++- src/commands/doctor-state-integrity.ts | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/commands/doctor-state-integrity.test.ts b/src/commands/doctor-state-integrity.test.ts index ffce52695f0e..eaf1514eba72 100644 --- a/src/commands/doctor-state-integrity.test.ts +++ b/src/commands/doctor-state-integrity.test.ts @@ -633,7 +633,12 @@ describe("doctor state integrity oauth dir checks", () => { const text = await runStateIntegrityText(cfg); 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" --dry-run --fix-missing/, + ); + expect(text).not.toMatch( + /openclaw sessions cleanup --store ".*sessions\.json" --dry-run(?! --fix-missing)/, + ); expect(text).toMatch( /openclaw sessions cleanup --store ".*sessions\.json" --enforce --fix-missing/, ); diff --git a/src/commands/doctor-state-integrity.ts b/src/commands/doctor-state-integrity.ts index b0c6e7b5e072..91e1305afbb8 100644 --- a/src/commands/doctor-state-integrity.ts +++ b/src/commands/doctor-state-integrity.ts @@ -1298,7 +1298,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`)}`, + ` Preview cleanup impact: ${formatCliCommand(`openclaw sessions cleanup --store "${absoluteStorePath}" --dry-run --fix-missing`)}`, ` Prune missing entries: ${formatCliCommand(`openclaw sessions cleanup --store "${absoluteStorePath}" --enforce --fix-missing`)}`, ].join("\n"), );