Repository navigation
fix(doctor): migrate legacy Skill Workshop backups to verified owners after workspace moves - #148995
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 15, 2026, 9:41 AM ET / 13:41 UTC (Revision 9). ClawSweeper reviewWhat this changesDoctor identifies a moved Skill Workshop backup’s agent from a unique complete content match, preserves unresolved backups, and documents recovery with regression coverage. Merge readiness⛔ Blocked before merge - 1 item remains Keep open: this remains a useful, coordinated fix absent from fetched main. No actionable patch defects were found. The recorded migration tests and accepted Doctor/updater-environment smoke address the earlier compatibility-proof request. Priority: P2 Review scores
Verification
How this fits togetherSkill Workshop stores each agent’s learned skills and collection backups. Doctor reads legacy backups and configured agents, then either migrates verified backups into an agent’s backup directory or preserves them with recovery guidance. flowchart TD
A[Legacy backups] --> C[Doctor ownership discovery]
B[Configured agents and Workshop skills] --> C
C --> D{Workspace owner exists?}
D -->|Yes| F[Existing migration and copy verification]
D -->|No| E{One complete content match?}
E -->|Yes| F
E -->|No| G[Preserve backups with diagnostics]
F --> H[Agent backup available; verified source retired]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +78, Tests +120, Docs +8. Total +206 across 3 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep ownership recovery in the existing Doctor migration, requiring a unique complete match while retaining ambiguous backups and existing archive safeguards. Do we have a high-confidence way to reproduce the issue? Yes, from source: a legacy backup naming a former workspace gets zero configured owners and cannot reach downstream hash verification on fetched main. This read-only review did not execute a reproduction. Is this the best way to solve the issue? Yes. The patch extends the existing admission path and reuses established target resolution, tree hashing, publication, and retirement safeguards without changing configuration or backup formats. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 49c1bc4d6ee9. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (8 earlier review cycles)
|
c05eab7 to
e4eb0f8
Compare
e4eb0f8 to
6d91778
Compare
894698f to
23ef212
Compare
23ef212 to
6c279e0
Compare
|
Merged via squash.
|
Fixes #148974
What Problem This Solves
openclaw doctor --fixrepeatedly preserves a legacy Skill Workshop collection backup withcandidate agents: noneafter its agent's workspace moves, even when the relocated Workshop skills match the backup's recorded results.Reported by @zoroo07 (#148974).
User Impact
Operators affected on 2026.9.4 can migrate these backups to their uniquely verified agent without changing the current workspace or editing the backup manifest. Missing, changed, partial, or ambiguous content stays preserved with per-agent match counts, failure details, and the supported manual recovery procedure. Restart the Gateway after successful repair to clear its retained startup warning.
Why This Change Was Made
When workspace matching finds no candidate, read-only discovery compares every recorded post-cleanup result hash against each configured agent's Workshop skills. Exactly one complete match supplies the owner; the existing migration still determines restorability and verifies published copies before retiring sources. Empty result sets cannot establish ownership.
The approved Option-1 exception retains workspace-equality admission for the shipped archive and same-pass relocation paths. This preserves history-only publication, completed-archive exclusion, and interrupted recovery. No new flag, v1 source-manifest edit, schema, dependency, or retention change is introduced.
Evidence
candidate agents: none, then all five passed after the repair.node scripts/run-vitest.mjs src/commands/doctor-skill-workshop*.test.ts src/infra/state-migrations.skill-workshop.test.ts: 135 tests passed across 11 files. Existing history-only, interrupted archive, and same-pass relocation tests are unchanged.node scripts/check-changed.mjs: passed, including production/test typechecking, formatting, lint, and repository guards.autoreview --mode branch --base origin/main --max-priority P1: scoped-clean, with no actionable P0/P1 findings.pnpm openclaw doctor --fix --non-interactive --no-workspace-suggestions, twice each for standalone and published updater handoff environments: all four runs exited 0. Verified converted backup content, unchanged current skills, retired legacy roots, and quiet second runs. Runtime assets were built through the supported CLI wrapper.The CLI smoke uses synthetic state and the Doctor environment emitted by the published updater; it does not run a complete npm-global update or restart an operator Gateway. Local proof ran on macOS.
The final patch is identical to the scoped-clean reviewed commit (
git range-diff), rebased onto main with the unrelated fixture repairs included. Exact-head CI run 34968948742 completed successfully for6c279e0a38defa1fc7747f0ac8b19fbf4018d4ce; all 146 successful checks are complete with none pending or failed. The focused Workshop command also passed all 135 tests across 11 files after the first patch-identical rebase.ClawSweeper review
ClawSweeper's completed review of
6c279e0a38defa1fc7747f0ac8b19fbf4018d4cefound no actionable code findings and acknowledged the recorded proof acceptance. Its generic compatibility-proof checklist item is covered by the migration regression tests and the maintainer-accepted isolated Doctor CLI/updater-environment smoke. A complete npm-global update remains an explicitly accepted proof limitation. No code fixups or manual re-review request were needed.The same root cause and the content-hash ownership approach were posted independently by @holny on #148974 before this PR; thanks for the analysis.