Repository navigation
fix(plugins): make marketplace installs transactional - #129266
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 27, 2026, 12:09 AM ET / 04:09 UTC. ClawSweeper reviewWhat this changesThis PR routes managed plugin installs through a shared transaction coordinator so replacement payloads commit only after config and install-record persistence succeeds. Merge readinessKeep open: current main still lacks this transaction boundary, and the patch appears to repair the reported inconsistency. GitHub reports the current head as conflicting with main, while the protected maintainer label requires an explicit compatibility review after rebase. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: FAIL (partial) — step 2 Assertions:
How this fits togetherThe plugin-install CLI selects a source and calls the plugin management service, which publishes plugin payloads and persists configuration and install records. This change makes the management service coordinate commit or rollback across those two durable states. flowchart LR
A[Plugin install CLI] --> B[Management service]
B --> C[Source installer]
C --> D[Deferred payload transaction]
D --> E[Config and install-record persistence]
E --> F{Persistence succeeds?}
F -->|Yes| G[Commit payload]
F -->|No| H[Restore prior payload]
Decision needed
Why: The implementation is a focused repair, but it deliberately changes recovery semantics for already-installed plugins and the protected maintainer label requires an explicit owner decision. Before merge
Agent review detailsSecurityNone. PR surfaceSource +59, Tests +236. Total +295 across 5 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. Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Rebase onto current main, retain one management-service transaction owner for all mutable install sources, and verify both commit and rollback through the real CLI before merging. Do we have a high-confidence way to reproduce the issue? Yes. The supplied A-to-B fixture scenario is concrete and current main lacks the deferred transaction coordination; this read-only review did not execute the failing baseline itself. Is this the best way to solve the issue? Yes. Centralizing settlement in the management service removes the prior CLI split and lets every mutable installer carry its own rollback receipt through the durable-state boundary. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 751e6c540f9a. 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 (4 earlier review cycles)
|
|
@clawsweeper re-review The npm-pack P1 is repaired at the managed-NPM producer boundary on
The PR Evidence section contains the exact commands and LOC accounting. Source audit found no sibling receipt-producing installer that drops the request. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Blacksmith Testbox behavioral proof (exact PR head)
node scripts/crabbox-wrapper.mjs run \
--provider blacksmith-testbox \
--timing-json -- \
CI=1 NODE_OPTIONS=--max-old-space-size=4096 \
OPENCLAW_TEST_PROJECTS_PARALLEL=6 \
OPENCLAW_VITEST_MAX_WORKERS=1 \
OPENCLAW_TESTBOX=1 OPENCLAW_TESTBOX_REMOTE_RUN=1 \
bash -lc '<A-to-B forced local-plugin replacement scenario>'Exact scenario: the shell first required pnpm openclaw plugins install "$ROOT/plugin-a" --force
pnpm openclaw config set plugins.entries.demo-transaction-proof.config.mode a
pnpm openclaw plugins install "$ROOT/plugin-b" --forceThe third command was required to fail. The scenario asserted its output contained
Result: PASS ( Lease cleanup: the one-shot wrapper stopped the lease after success. Independent |
ba91ae4 to
41cddd4
Compare
Blacksmith Testbox behavioral proof (rebased exact PR head)
node scripts/crabbox-wrapper.mjs run \
--provider blacksmith-testbox \
--timing-json -- \
CI=1 NODE_OPTIONS=--max-old-space-size=4096 \
OPENCLAW_TEST_PROJECTS_PARALLEL=6 \
OPENCLAW_VITEST_MAX_WORKERS=1 \
OPENCLAW_TESTBOX=1 OPENCLAW_TESTBOX_REMOTE_RUN=1 \
bash tmp-pr129266-testbox-proof.shThe delegated sync created only its standard Exact scenario: isolated The scenario then asserted through real CLI/state paths that:
Result: PASS ( Lease cleanup: the one-shot wrapper stopped the lease after success. Independent |
|
@clawsweeper re-review Rebased exact head Fresh evidence is durable in the PR body and #129266 (comment):
Please refresh the durable review against this exact head. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Superseded by #122984, squash-merged as 0c313d712839670f3ac60f8fd238af7e308cdc18. That landed change contains the same owner-boundary repair and is stronger than this branch:
Rebasing this PR onto current main conflicts exactly in those owner modules. Resolving by replaying this branch would reintroduce the deleted compensation stack and would roll back payload bytes after some post-commit failures, recreating durable-state divergence that #122984 explicitly prevents. Current-main verification at node scripts/run-vitest.mjs \
src/plugins/management-service.install-compensation.test.ts \
src/plugins/install.npm-spec.test.ts \
src/plugins/install-persistence.test.tsResult: 3 files, 101 tests passed. PR #122984 also carries real built-CLI A-to-B rollback proof, post-commit failure proof, and green exact-head CI: https://github.com/openclaw/openclaw/actions/runs/33050938121. Closing this PR as fully superseded by the canonical landed implementation. Attribution for this branch remains in its history and review trail. |
41cddd4 to
b85a2f2
Compare
b85a2f2 to
f4b2abb
Compare
|
Exact-head Blacksmith Testbox behavioral proof passed for
Local exact-head focused proof and fresh Codex branch autoreview are also clean. The prior superseded compensation implementation remains deleted; this head contains only the marketplace residual explicitly left by #122984. |
|
Merged via squash.
|
What Problem This Solves
Marketplace plugin installs still published payload bytes before durable config and install-record persistence. If persistence rejected the replacement, the CLI reported failure while the new marketplace payload remained active.
This is the marketplace remainder of #127244. #122984 landed the stronger canonical transaction owner as
0c313d712839670f3ac60f8fd238af7e308cdc18for local, npm, npm-pack, Git, and ClawHub sources, and explicitly left marketplace routing as a named follow-up.Why This Change Was Made
Route marketplace installs through the existing
installManagedPluginSourceowner introduced by #122984. That owner requests the installer's deferred transaction, records the authoritative persistence commit boundary, rolls back only pre-commit failures, and retains committed payloads after late refresh failures.The obsolete compensation implementation from this PR's prior head is not retained or replayed. The CLI's duplicate marketplace capability-consent and persistence path is removed.
User Impact
Failed marketplace replacements restore the previous payload and durable record as one generation. Successful persistence commits the replacement, while a post-commit refresh failure no longer rolls back already-authoritative bytes.
Evidence
node scripts/run-vitest.mjs src/plugins/management-service.install-compensation.test.tsfailed because the marketplace row never invoked the marketplace installer through the transaction owner.node scripts/run-vitest.mjs src/plugins/management-service.install-compensation.test.ts src/cli/plugins-cli.install.test.ts— 211 tests passed.node scripts/check-changed.mjs -- src/cli/plugins-install-command.ts src/plugins/management-service.ts src/plugins/management-service.install-compensation.test.ts— passed.origin/main— no accepted/actionable findings.33063448628passed forf4b2abb59eb06c0dd83f138ad4d49526f7475c30.33063639575fetched and verified that pushed SHA in a detached worktree, then passed 211/211 tests; leasetbx_01m11cjd49m1sthpqppz0nd705was cleaned after success.Fixes the remaining marketplace path from #127244.