Repository navigation
fix(skills): stop skills update from destroying local skill changes - #118190
Conversation
|
Codex review: needs changes before merge. Reviewed August 22, 2026, 2:23 AM ET / 06:23 UTC. ClawSweeper reviewWhat this changesThe PR protects tracked ClawHub skill updates from replacing locally changed files, adds explicit CLI and Gateway force overrides, and restores the original directory when sink-bound verification rejects a replacement. Regression provenancePossible regression — probable (reviewed change; known regression link). No predecessor PR is attributed. Merge readinessKeep open: the skill-update repair follows the correct lifecycle owner, but this head also reintroduces a nested Control UI main landmark and reverts a current-main Gateway allocation fix. Those unrelated regressions block merge; legacy digest-free update behavior still needs maintainer confirmation. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherClawHub updates resolve a tracked skill, download and stage a replacement, and hand it to the shared package-directory installer. The installer owns the destructive swap; CLI and Gateway surfaces report whether an update was refused or forced. flowchart LR
A[Tracked skill metadata] --> B[Skill update request]
B --> C[Download and stage replacement]
C --> D[Shared package installer]
D --> E[Move existing skill to backup]
E --> F{Backup matches digests?}
F -->|yes| G[Publish replacement]
F -->|no| H[Restore original skill]
G --> I[CLI or Gateway result]
H --> I
Decision needed
Why: Both options change the upgrade contract for released installs, and source evidence cannot choose the operator-policy tradeoff. Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +172, Tests +441, Docs +6. Total +619 across 15 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the sink-owned backup validation, remove the unrelated UI and Gateway reversions, then explicitly accept or replace the one-time forced migration for digest-free installs. Do we have a high-confidence way to reproduce the issue? Yes for the PR-introduced UI regression: the app shell already renders main and the activity view is inserted beneath it, while current main's regression test asserts that view adds no main. The reported local-skill loss is supported by the PR's before/after lifecycle evidence but was not executed in this read-only review. Is this the best way to solve the issue? No for the branch as submitted: the sink-owned validation is the right repair location, but it must not carry unrelated current-main reversions and the legacy digest migration needs explicit product acceptance. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c8d6604261ef. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (11 earlier review cycles; latest 8 shown)
|
|
Applied two of the three review items at head c8b924c:
The remaining item is the maintainer call the review names: whether fail-closed is the accepted upgrade behavior for digest-free records. The PR keeps fail-closed deliberately because a digest-free directory is indistinguishable from a locally modified one, silent replacement is unrecoverable, and both uninstall and Claw package removal already refuse the same state. If maintainers prefer a non-destructive migration instead, a follow-up could compare the freshly downloaded same-version tree against the installed directory and auto-record digests on an exact match; happy to build that if preferred. PR body Evidence and head references are refreshed for c8b924c; the production diff is unchanged from the reviewed 45bd736 (the new commit adds only the regression fixture and docs). |
657be6c to
7f2c2e3
Compare
|
Addressed every open verdict item at head 7f2c2e39cfa (rebased onto current main 6aee279). [P1] Block unreadable existing skills before replacement: fixed. The guard no longer trusts the planner's [P2] Gateway-usable force retry guidance: fixed. Blocked updates now return a transport-neutral Rebase onto current main: done. The branch absorbed the clawhub lifecycle facade split and #119606's owner-qualified uninstall refs. Because the update flow deliberately accepts tracked slugs via the lenient Owner decision (digest-free installs require one explicit force): unchanged and still yours to accept. The PR keeps the documented fail-closed one-time migration, matching the review's own recommendation. The non-destructive digest bootstrap alternative remains available as a follow-up if you prefer it. Proof refreshed against the pushed head; the unforced update refusal, byte-for-byte local file survival, forced replacement, and the unreadable-SKILL.md preservation case are all live lifecycle runs on pristine main vs this patch. |
|
Thanks for the contribution! New skills should be published on ClawHub for everyone to use. We’re keeping the core lean on skills, so I’m closing this out. |
|
Thanks for the contribution! New skills should be published on ClawHub for everyone to use. We’re keeping the core lean on skills, so I’m closing this out. |
|
Maintainer decision: I accept the documented one-time explicit |
What Problem This Solves
openclaw skills updatealways passedforce: trueto the ClawHub installer. The shared package sink then replaced the tracked skill directory and deleted its backup, even when the installed tree no longer matched the recordedskillFileandfileTreeSha256digests. Same-version updates could reportchanged: falseafter silently deleting local edits and added files.The uninstall owner already enforced the missing invariant: destructive lifecycle operations must verify the installed tree against its recorded digests at the commit boundary.
Fix
skills update --forceand Gatewayskills.update { force: true }provide the explicit destructive override. Blocked results usecode: "force_required".security.installPolicywarning acknowledgement behavior is preserved.--all --forcefor this migration.Fresh installs and forced updates do not run the guard. Archive and GitHub-backed ClawHub resolutions share the same transaction-owned boundary.
Review finding resolved
The previous head ran its second check in
afterInstall, then awaited target existence before moving the live directory. An edit in that interval was still deleted. The repaired owner boundary validates the already-moved backup and rolls it back on refusal.The branch was conflict-resolved against
mainwithout rewriting contributor history or force-pushing.Evidence
Exact head:
2216e2d52d9aaabdea4c23c8fc5a23c238a4759bmain0933263f76f435b16d73c29dc60b98cd30e4c45e:src/infra/install-package-dir.test.ts > restores edits detected after the existing install moves to backupreceived{ ok: true }; the local edit was not preserved.src/infra/install-package-dir.test.tssrc/skills/lifecycle/archive-install.test.tssrc/skills/lifecycle/clawhub-uninstall.test.tssrc/skills/lifecycle/clawhub.test.tssrc/cli/skills-cli.commands.test.tssrc/gateway/server-methods/skills.clawhub.test.tspackages/gateway-protocol/src/schema/agents-models-skills.test.tsoxfmt --check: pass on all 15 changed files.oxlint: pass on all changed TypeScript files.pnpm tsgo: pass.pnpm check:test-types: pass.node scripts/check-changed.mjs -- <changed paths>: pass, including assertion-safety, formatting, dependency, boundary, dead-code, lint, schema, database-first, import-cycle, and type gates.gpt-5.6-sol, high): clean; patch correct, zero actionable findings.git diff --check: pass.Distill result: one digest plan, one rollback owner, no duplicate update implementation. Greybeard result: unforced updates perform one fail-fast tree read and one required transaction-boundary read; forced updates perform neither.
Effective diff versus integrated
main: production +196/-24, tests +445/-4, docs +7/-1. Production growth is the rollback hook, carried digest plan, force retry contract, and explicit rollback-failure reporting.32557839497: every touched-path, build, docs, type, baseline-ratchet, security, and 65 test-shard lane passed. The sole failure is current-mainui/src/components/markdown.test.tsexceeding its max-lines baseline; this PR has no diff in that file.ci-gatefails only as its aggregate consequence.gpt-5.6-terra, high): PASS; patch correct, 0 findings, 0 security concerns, no maintainer decision, 0 Rank-up moves. Report:local-review-118190-gpt-5-6-terra-2216e2d5-20260822T064937.161Z.@foremanclawbot, live@steipete/weatherinstall, localSKILL.mdedit plusnotes/local-note.md, then unforced update. Gateway recordedforce_required; both files remained byte-for-byte intact. Telegram emittedCLAWHUB_LOCAL_CHANGES_FIXED_DONEas Bot API message1881. Recording: 3 messages, 9 edits, 1 deletion, 6 typing events; 5 mock-provider turns; both workspace assertions passed.User-visible behavior
Without
--force, locally edited, added, unreadable, or concurrently changed skill files survive and the update reportsforce_required. With--force, replacement proceeds intentionally.