Repository navigation
fix(migrate): reject external plugin paths during adoption - #110
Patrick-Erichsen merged 3 commits into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 8:11 PM ET / August 27, 2026, 00:11 UTC. ClawSweeper reviewWhat this changesThe PR changes OCM adoption so an installed path plugin outside the copied state root aborts the import and removes the partial environment. Merge readinessKeep open pending a maintainer decision on the intentional fail-closed compatibility change. Likely related people: Patrick Erichsen (recent adoption-state contributor, medium confidence) and Shakker (long-running migration-area contributor, medium confidence). Priority: P1 Review scores
Verification
Live VerificationCommand: Result: FAIL (failed) — execution before step 1 Assertions:
How this fits togetherOCM adoption copies a plain OpenClaw home into a managed environment, rewrites runtime-state references, and then exposes that environment to OCM commands. Installed-plugin records feed the adopted runtime, so their paths must not retain access to source-owned state. flowchart LR
A[Plain OpenClaw home] --> B[Adopt import]
B --> C[Copy target environment]
C --> D[Rewrite runtime state]
D --> E{Plugin paths contained?}
E -->|yes| F[Publish managed environment]
E -->|no| G[Remove partial target]
F --> H[OCM runtime commands]
Decision needed
Why: The implementation is narrow and tested, but it deliberately replaces the current warning-and-continue compatibility path for existing external path-plugin setups. Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Confirm fail-closed containment for external path plugins, then merge this narrow validation and retain the broader isolation work in #98. Do we have a high-confidence way to reproduce the issue? Yes. Current-main source and its existing test establish the warning-and-continue path, while the PR supplies a production CLI transcript showing rejection, cleanup, and unchanged source data after the fix. Is this the best way to solve the issue? Yes, conditionally: returning an error before plugin records are published and relying on the existing rollback path is the narrowest repair if maintainers choose fail-closed adoption. AGENTS.md: not found in the target repository. Codex review notes: model internal, reasoning high; reviewed against c4365f11c3c7. LabelsLabel justifications:
EvidenceWhat 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 (3 earlier review cycles) |
|
@clawsweeper re-review Added the requested after-fix production-command proof from a safe temporary fixture. The targeted regression test passes; the real CLI run exits nonzero, removes the partial target environment, and leaves both the source SQLite database and external plugin marker byte-for-byte unchanged. The PR body now also calls out the remaining maintainer policy decision explicitly. |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@Patrick-Erichsen The requested real-command proof and CI-equivalent local verification are now in the PR body. The remaining maintainer decision is the compatibility policy: this patch intentionally fails closed when an external path plugin cannot be contained, instead of preserving the current warning-and-continue behavior. Could you confirm that fail-closed adoption is the intended policy? |
What Problem This Solves
ocm adopt importcan retain absolutesourcePathorinstallPathvalues for path plugins outside the adopted environment. The import currently succeeds with a warning, so a candidate runtime can still receive a writable reference to source-owned state even though the environment is intended to be disposable.Why This Change Was Made
Containment is a safety boundary, not a compatibility warning. The import now fails before publishing relocated plugin records when any plugin path cannot be isolated inside the target state root. The existing migration transaction then removes the partially created environment.
User Impact
Adoption no longer produces a runnable environment with external plugin references. Operators must relocate or remove external path plugins before importing. Managed ClawHub and npm plugin records continue to relocate into the adopted state as before.
Verification
Targeted regression test
Real CLI behavior with a safe temporary fixture
The fixture contains a path plugin outside the source OpenClaw home. Paths are redacted below. The source database and external plugin marker were hashed before and after the production
ocmcommand.Additional CI-equivalent verification on commit
9695362:cargo fmt --checkpasses.cargo test --lockedpasses in a clean WSL-native Linux checkout.cargo +1.88.0 check --workspace --all-targets --lockedpasses.git diff --check upstream/main...HEADpasses.Maintainer Decision Requested
Please confirm that fail-closed adoption is the intended policy when a path plugin cannot be contained. This intentionally changes the previous warning-and-continue behavior: operators must relocate or remove the external path plugin before retrying adoption.
Related: #98
Related: openclaw/openclaw#129673