fix(doctor): detect stale session snapshot paths#82867
Conversation
|
Codex review: needs maintainer review before merge. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: yes. Source inspection shows current main lacks the session snapshot doctor contribution, and the PR proof artifacts demonstrate before/after detection of stale cached bundled-skill paths without current-runtime or workspace false positives. Real behavior proof Next step before merge Security Review detailsBest possible solution: Merge the bounded read-only doctor diagnostic after maintainer review, keeping it tied to existing session-store and bundled-skill snapshot contracts. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows current main lacks the session snapshot doctor contribution, and the PR proof artifacts demonstrate before/after detection of stale cached bundled-skill paths without current-runtime or workspace false positives. Is this the best way to solve the issue? Yes. A read-only doctor contribution is the narrowest maintainable solution for this diagnostic request, and the latest scanner uses existing bundled-skill and session-store contracts rather than changing runtime session behavior. What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against a5a5df67da35. |
|
Updated proof artifacts for the stale session snapshot doctor check:
The corrected before log now proves \ lacks the detector/contribution, and the after log proves the PR reports stale install/temp/Windows runtime paths without current-runtime or workspace false positives. |
|
Corrected the PR body markdown after the first proof update mangled inline backticks. Final proof artifacts:
The before log proves |
Warn when cached session snapshot metadata still references bundled skill paths from inactive OpenClaw runtime roots, while keeping workspace skill roots and current runtime paths quiet. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
b5bbebf to
5403a4d
Compare
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Updated for ClawSweeper P2 on configured session stores. What changed:
Validation:
Crabbox note: node scripts/crabbox-wrapper.mjs run --shell -- "pnpm check:changed" leased an AWS raw box but failed before validation with pnpm: command not found; rerunning with --provider blacksmith-testbox failed because .github/workflows/crabbox-hydrate.yml has no Testbox step configured. Local hydrated pnpm check:changed passed on pushed head 8a41822. |
|
/review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Expand home-relative cached snapshot paths before stale bundled-skill classification and scan raw session-store JSON so persisted resolvedSkills are inspected before normal session-store normalization strips them. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Addressed the remaining ClawSweeper P2 findings. What changed:
Validation:
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
* fix(doctor): detect stale session snapshot paths Warn when cached session snapshot metadata still references bundled skill paths from inactive OpenClaw runtime roots, while keeping workspace skill roots and current runtime paths quiet. * fix(doctor): honor configured session stores * fix(doctor): scan raw snapshot paths Expand home-relative cached snapshot paths before stale bundled-skill classification and scan raw session-store JSON so persisted resolvedSkills are inspected before normal session-store normalization strips them.
* fix(doctor): detect stale session snapshot paths Warn when cached session snapshot metadata still references bundled skill paths from inactive OpenClaw runtime roots, while keeping workspace skill roots and current runtime paths quiet. * fix(doctor): honor configured session stores * fix(doctor): scan raw snapshot paths Expand home-relative cached snapshot paths before stale bundled-skill classification and scan raw session-store JSON so persisted resolvedSkills are inspected before normal session-store normalization strips them.
* fix(doctor): detect stale session snapshot paths Warn when cached session snapshot metadata still references bundled skill paths from inactive OpenClaw runtime roots, while keeping workspace skill roots and current runtime paths quiet. * fix(doctor): honor configured session stores * fix(doctor): scan raw snapshot paths Expand home-relative cached snapshot paths before stale bundled-skill classification and scan raw session-store JSON so persisted resolvedSkills are inspected before normal session-store normalization strips them.
* fix(doctor): detect stale session snapshot paths Warn when cached session snapshot metadata still references bundled skill paths from inactive OpenClaw runtime roots, while keeping workspace skill roots and current runtime paths quiet. * fix(doctor): honor configured session stores * fix(doctor): scan raw snapshot paths Expand home-relative cached snapshot paths before stale bundled-skill classification and scan raw session-store JSON so persisted resolvedSkills are inspected before normal session-store normalization strips them.
* fix(doctor): detect stale session snapshot paths Warn when cached session snapshot metadata still references bundled skill paths from inactive OpenClaw runtime roots, while keeping workspace skill roots and current runtime paths quiet. * fix(doctor): honor configured session stores * fix(doctor): scan raw snapshot paths Expand home-relative cached snapshot paths before stale bundled-skill classification and scan raw session-store JSON so persisted resolvedSkills are inspected before normal session-store normalization strips them.
* fix(doctor): detect stale session snapshot paths Warn when cached session snapshot metadata still references bundled skill paths from inactive OpenClaw runtime roots, while keeping workspace skill roots and current runtime paths quiet. * fix(doctor): honor configured session stores * fix(doctor): scan raw snapshot paths Expand home-relative cached snapshot paths before stale bundled-skill classification and scan raw session-store JSON so persisted resolvedSkills are inspected before normal session-store normalization strips them.
* fix(doctor): detect stale session snapshot paths Warn when cached session snapshot metadata still references bundled skill paths from inactive OpenClaw runtime roots, while keeping workspace skill roots and current runtime paths quiet. * fix(doctor): honor configured session stores * fix(doctor): scan raw snapshot paths Expand home-relative cached snapshot paths before stale bundled-skill classification and scan raw session-store JSON so persisted resolvedSkills are inspected before normal session-store normalization strips them.
* fix(doctor): detect stale session snapshot paths Warn when cached session snapshot metadata still references bundled skill paths from inactive OpenClaw runtime roots, while keeping workspace skill roots and current runtime paths quiet. * fix(doctor): honor configured session stores * fix(doctor): scan raw snapshot paths Expand home-relative cached snapshot paths before stale bundled-skill classification and scan raw session-store JSON so persisted resolvedSkills are inspected before normal session-store normalization strips them.
* fix(doctor): detect stale session snapshot paths Warn when cached session snapshot metadata still references bundled skill paths from inactive OpenClaw runtime roots, while keeping workspace skill roots and current runtime paths quiet. * fix(doctor): honor configured session stores * fix(doctor): scan raw snapshot paths Expand home-relative cached snapshot paths before stale bundled-skill classification and scan raw session-store JSON so persisted resolvedSkills are inspected before normal session-store normalization strips them.
* fix(doctor): detect stale session snapshot paths Warn when cached session snapshot metadata still references bundled skill paths from inactive OpenClaw runtime roots, while keeping workspace skill roots and current runtime paths quiet. * fix(doctor): honor configured session stores * fix(doctor): scan raw snapshot paths Expand home-relative cached snapshot paths before stale bundled-skill classification and scan raw session-store JSON so persisted resolvedSkills are inspected before normal session-store normalization strips them.
* fix(doctor): detect stale session snapshot paths Warn when cached session snapshot metadata still references bundled skill paths from inactive OpenClaw runtime roots, while keeping workspace skill roots and current runtime paths quiet. * fix(doctor): honor configured session stores * fix(doctor): scan raw snapshot paths Expand home-relative cached snapshot paths before stale bundled-skill classification and scan raw session-store JSON so persisted resolvedSkills are inspected before normal session-store normalization strips them.
* fix(doctor): detect stale session snapshot paths Warn when cached session snapshot metadata still references bundled skill paths from inactive OpenClaw runtime roots, while keeping workspace skill roots and current runtime paths quiet. * fix(doctor): honor configured session stores * fix(doctor): scan raw snapshot paths Expand home-relative cached snapshot paths before stale bundled-skill classification and scan raw session-store JSON so persisted resolvedSkills are inspected before normal session-store normalization strips them.
Fixes #47534.
Summary
skillsSnapshot.prompt, runtime-onlyskillsSnapshot.resolvedSkills, andsystemPromptReport.injectedWorkspaceFilesTests
CI=1 node scripts/run-vitest.mjs src/commands/doctor-session-snapshots.test.ts src/commands/doctor-session-transcripts.test.tspnpm exec oxfmt --check --threads=1 src/commands/doctor-session-snapshots.ts src/commands/doctor-session-snapshots.test.ts src/flows/doctor-health-contributions.tsgit diff --checkpnpm check:changedReal behavior proof
Behavior or issue addressed:
openclaw doctordid not warn when cached session snapshot metadata still referenced bundled skills under an inactive OpenClaw runtime root after an install/runtime path change.Real environment tested: WSL Ubuntu source checkout with deterministic temp session-store fixtures and the real doctor session snapshot scanner registered through the doctor health contribution list.
Exact steps or command run after this patch:
CI=1 node scripts/run-vitest.mjs src/commands/doctor-session-snapshots.test.ts src/commands/doctor-session-transcripts.test.ts,pnpm check:changed, and the scripted before/after proof published below.Evidence after fix:
Observed result after fix: Before
origin/main, no doctor session snapshot detector/contribution exists. After this PR, stale POSIX install-root, temp-backed, and Windows cached bundled skill paths are reported, while current-runtime and workspace skill paths are not false positives. The doctor note distinguishes the healthy live bundled skills root from stale cached session metadata and gives safe fresh-session/reset guidance.What was not tested: A live macOS Homebrew install migration was not run; the proof uses source-level session-store fixtures for the stale cached metadata shape from the issue.