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"), );