openclaw - ✅(Solved) Fix [Bug]: doctor suggests incomplete sessions cleanup preview for missing transcripts [2 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#54877Fetched 2026-04-08 01:34:57
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
cross-referenced ×2referenced ×1renamed ×1

openclaw doctor reports missing recent session transcripts, but the suggested preview command does not surface the same missing entries unless --fix-missing is manually added.

This creates a misleading workflow for users: doctor says recent sessions are missing transcripts, but openclaw sessions cleanup --dry-run appears to contradict it by reporting Would prune missing transcripts: 0.

Root Cause

From the current CLI implementation in 2026.3.24:

  • doctor checks recent sessions directly and warns when resolveSessionFilePath(...) does not exist.
  • sessions cleanup --dry-run only counts missing transcripts when --fix-missing is explicitly provided.

So the suggested doctor preview command is incomplete.

Fix Action

Fixed

PR fix notes

PR #54896: fix: include --fix-missing in doctor cleanup preview

Description (problem / solution / changelog)

Summary

  • update the missing-transcript doctor hint so the suggested dry-run preview includes --fix-missing
  • keep the repair command unchanged
  • cover the updated hint in the state-integrity test

Closes #54877

Testing

  • pnpm exec vitest run src/commands/doctor-state-integrity.test.ts

Changed files

  • src/commands/doctor-state-integrity.test.ts (modified, +3/-1)
  • src/commands/doctor-state-integrity.ts (modified, +1/-1)

PR #54925: fix: include --fix-missing in doctor cleanup preview suggestion

Description (problem / solution / changelog)

Fixes #54877

Problem

openclaw doctor suggests a preview command without --fix-missing, so sessions cleanup --dry-run reports 0 missing transcripts even when they exist.

Fix

Added --fix-missing to the doctor's suggested preview command so the dry-run actually counts missing transcripts.

Impact

Doctor preview command now correctly shows missing transcript count, matching the doctor's own warning.

Changed files

  • src/commands/doctor-state-integrity.test.ts (modified, +3/-1)
  • src/commands/doctor-state-integrity.ts (modified, +1/-1)

Code Example

openclaw doctor

---

- 2/5 recent sessions are missing transcripts.
  Verify sessions in store: openclaw sessions --store "/Users/neoshi/.openclaw/agents/agent-qwen/sessions/sessions.json"
  Preview cleanup impact: openclaw sessions cleanup --store "/Users/neoshi/.openclaw/agents/agent-qwen/sessions/sessions.json" --dry-run
  Prune missing entries: openclaw sessions cleanup --store "/Users/neoshi/.openclaw/agents/agent-qwen/sessions/sessions.json" --enforce --fix-missing

---

openclaw sessions cleanup --store "/Users/neoshi/.openclaw/agents/agent-qwen/sessions/sessions.json" --dry-run

---

Would prune missing transcripts: 0
Would prune stale: 0
Would cap overflow: 0

---

/Users/neoshi/.openclaw/agents/agent-qwen/sessions/e3498641-132c-48ec-9ebf-72bb77a51353.jsonl

---

agent:agent-qwen:cron:a88d8cdb-b7c1-4afe-9472-4af18b52810b
agent:agent-qwen:cron:a88d8cdb-b7c1-4afe-9472-4af18b52810b:run:2d42e95c-e10f-4e57-a8f5-de824a3d5ace

---

openclaw sessions cleanup --store ".../sessions.json" --dry-run --fix-missing
RAW_BUFFERClick to expand / collapse

Summary

openclaw doctor reports missing recent session transcripts, but the suggested preview command does not surface the same missing entries unless --fix-missing is manually added.

This creates a misleading workflow for users: doctor says recent sessions are missing transcripts, but openclaw sessions cleanup --dry-run appears to contradict it by reporting Would prune missing transcripts: 0.

Version

  • OpenClaw: 2026.3.24

Reproduction

1. Run doctor

openclaw doctor

Observed warning:

- 2/5 recent sessions are missing transcripts.
  Verify sessions in store: openclaw sessions --store "/Users/neoshi/.openclaw/agents/agent-qwen/sessions/sessions.json"
  Preview cleanup impact: openclaw sessions cleanup --store "/Users/neoshi/.openclaw/agents/agent-qwen/sessions/sessions.json" --dry-run
  Prune missing entries: openclaw sessions cleanup --store "/Users/neoshi/.openclaw/agents/agent-qwen/sessions/sessions.json" --enforce --fix-missing

2. Run the suggested preview command exactly as shown

openclaw sessions cleanup --store "/Users/neoshi/.openclaw/agents/agent-qwen/sessions/sessions.json" --dry-run

Observed output:

Would prune missing transcripts: 0
Would prune stale: 0
Would cap overflow: 0

3. Inspect the store directly

The store actually contains 2 entries whose transcript file is missing.

Both entries point to the same missing file:

/Users/neoshi/.openclaw/agents/agent-qwen/sessions/e3498641-132c-48ec-9ebf-72bb77a51353.jsonl

Affected keys:

agent:agent-qwen:cron:a88d8cdb-b7c1-4afe-9472-4af18b52810b
agent:agent-qwen:cron:a88d8cdb-b7c1-4afe-9472-4af18b52810b:run:2d42e95c-e10f-4e57-a8f5-de824a3d5ace

Root cause

From the current CLI implementation in 2026.3.24:

  • doctor checks recent sessions directly and warns when resolveSessionFilePath(...) does not exist.
  • sessions cleanup --dry-run only counts missing transcripts when --fix-missing is explicitly provided.

So the suggested doctor preview command is incomplete.

Expected behavior

Either of these would be acceptable:

  1. doctor should suggest:
openclaw sessions cleanup --store ".../sessions.json" --dry-run --fix-missing
  1. Or sessions cleanup --dry-run should automatically preview missing transcript pruning when doctor recommends it.

Actual behavior

  • doctor reports missing recent transcripts.
  • The suggested dry-run preview command does not include --fix-missing.
  • Users therefore see a contradictory result (Would prune missing transcripts: 0) even when missing transcript entries exist.

Why this matters

This makes diagnosis confusing and weakens trust in the repair workflow. The warning is real, but the suggested preview command appears to deny it.

extent analysis

Fix Plan

To resolve the issue, we need to modify the doctor command to suggest the correct preview command with --fix-missing. Here are the steps:

  • Update the doctor command to include --fix-missing in the suggested preview command:
openclaw doctor

Should suggest:

openclaw sessions cleanup --store "/Users/neoshi/.openclaw/agents/agent-qwen/sessions/sessions.json" --dry-run --fix-missing
  • Alternatively, update the sessions cleanup --dry-run command to automatically preview missing transcript pruning when doctor recommends it.

Example code change:

# In the doctor command implementation
if missing_transcripts:
    suggested_command = "openclaw sessions cleanup --store '{}' --dry-run --fix-missing".format(store_path)
    print("Verify sessions in store: {}".format(suggested_command))

Verification

To verify the fix, run the doctor command and check the suggested preview command. It should include --fix-missing. Then, run the suggested preview command and check the output. It should correctly report the number of missing transcripts.

Example verification steps:

openclaw doctor

Should suggest:

openclaw sessions cleanup --store "/Users/neoshi/.openclaw/agents/agent-qwen/sessions/sessions.json" --dry-run --fix-missing

Run the suggested command:

openclaw sessions cleanup --store "/Users/neoshi/.openclaw/agents/agent-qwen/sessions/sessions.json" --dry-run --fix-missing

Should output:

Would prune missing transcripts: 2

Extra Tips

  • Make sure to test the fix thoroughly to ensure it works correctly in all scenarios.
  • Consider adding automated tests to prevent similar issues in the future.
  • Review the documentation to ensure it reflects the updated behavior.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Either of these would be acceptable:

  1. doctor should suggest:
openclaw sessions cleanup --store ".../sessions.json" --dry-run --fix-missing
  1. Or sessions cleanup --dry-run should automatically preview missing transcript pruning when doctor recommends it.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING