Repository navigation
fix(plugins): preserve update failures and prevent duplicate settlement - #146483
Conversation
Keep peer-link failures primary when rollback also fails, detach managed install handles before persistence, and share successful batch settlement. Preserve retryable rollback recovery.
|
🦞👀 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: needs maintainer review before merge. Reviewed September 12, 2026, 6:15 PM ET / 22:15 UTC (Revision 3). ClawSweeper reviewWhat this changesPreserves original plugin update errors alongside rollback failures, removes completed installation handles, and prevents successful transaction settlement from repeating. Merge readiness✅ Ready for maintainer review This remains a useful repair: current main and the latest release retain the error-masking path. No actionable correctness or security findings remain, and the PR body explicitly records the maintainer’s deferral of the prior smoke-test request. Priority: P2 Review scores
Verification
How this fits togetherPlugin installation stages package files before committing installation records and configuration. Its transaction handling determines whether staged changes are finalized or restored and which errors reach the CLI. flowchart TD
A[Plugin install or update] --> B[Stage package files]
B --> C[Installation transaction]
C --> D{Finalization succeeds?}
D -->|Yes| E[Commit and consume handle]
D -->|No| F[Roll back staged changes]
F --> G[Report original and cleanup errors]
E --> H[Skip repeated settlement]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +32, Tests +87, Docs +2. Total +121 across 8 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep failure aggregation and completed-handle consumption at the installation owner while preserving the directory owner’s retryable recovery behavior. Do we have a high-confidence way to reproduce the issue? Yes, from source: simultaneous peer-link repair and rollback failures cause current main to lose the original error. The PR reports failing-before regressions; this review did not execute them. Is this the best way to solve the issue? Yes. The patch repairs the existing settlement and management boundaries, retains pending handoffs, and preserves failed-rollback retries without changing configuration or persisted formats. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ee89d82253ec. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
Merged via squash.
|
…nt (openclaw#146483) Preserve the original plugin update failure when rollback also fails, keeping rollback errors as additional diagnostics. Consume completed managed install transaction handles and share successful or concurrent settlement, while retaining retryability after failed rollback in the existing recovery owner. Regression evidence covers primary-error propagation through update finalization and the CLI, handle consumption across managed install sources, and duplicate/concurrent settlement. The authoring lane recorded failing-before/passing-after regressions and 356 passing focused tests; exact-head CI passed. Published-driver × candidate installation smoke remains a disclosed validation gap accepted for this scoped landing. Fixes openclaw#146435 Refs openclaw#146434 Reported by @aniruddhaadak80 (openclaw#146435, openclaw#146434).
What Problem This Solves
Plugin updates hide the actionable peer-link error when rollback also fails, and completed managed install results retain their staging transaction handle.
Fixes #146435
Refs #146434
Reported by @aniruddhaadak80 (#146435, #146434).
User Impact
Plugin update failures report the real cause instead of a rollback error, and install transactions can no longer be settled twice after successful completion. No configuration or migration is required.
Why This Change Was Made
The transaction owner now retains the primary error as the first aggregate member and cause, with its message first. Both peer-link finalization and the CLI's outer rollback path supply that primary failure.
Management takes and removes the handle before persistence owns settlement, so the completed result cannot spread it to another caller. Pending source adapters retain their existing handoffs. Batch settlement shares in-flight work and remembers successful completion; failed rollback remains retryable, preserving the directory owner's recovery contract.
The reported handle leak was reproduced. The existing directory transaction already guards successful settlement, so the stronger claim of repeated filesystem side effects was not reproduced with that owner; the batch-level regression demonstrates duplicate callbacks with generic transactions.
Evidence
The regressions ran on unchanged production code first:
After the fix, all 356 focused tests passed across install transactions, management install compensation, plugin updates, git installs, CLI updates, and hook-pack updates. The finalization and batch regressions are now colocated in
install-transaction.test.tsto keep the plugin test shard within its unchanged 700-root budget.The final combined regressions and shard-budget owner tests passed (29 tests):
node scripts/check-changed.mjspassed its formatting, ratchet, dependency, and boundary checks, then stopped at an unrelated existing type error:The same error reproduced with all production changes in this PR temporarily reversed, using
node scripts/run-tsgo.mjs -p tsconfig.core.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core.tsbuildinfo. The fix was restored afterward.Known gap: no published-driver × candidate installation smoke was run; proof covers the plugin and CLI finalization boundaries with synthetic fixtures.
Targeted Oxlint passed for the changed TypeScript files, including the combined regression file. The selected test typecheck (
plugins-platform,config-cli) is blocked by the same pre-existing Gateway error.git diff --checkpassed.The coercion-helper, deprecated-API, and dead-export guards also passed.
The first CI run caught the extra test-file count (
plugins-platform: 701 test roots exceeds the 700 limit). Consolidating the two related regression suites fixes that failure without changing the cap or assertions; the cap owner's full 24-test suite now passes locally.CI passed on
d8c37ed583581cacdc7ead818a536ace3855fe15: run 34720278306. The exact-head watcher reportedrollup=green,github_rollup=SUCCESS,pending=0, andGREEN. The previously failing shard-budget job also passed.ClawSweeper review
The completed review of
d8c37ed583581cacdc7ead818a536ace3855fe15found no actionable code or security findings. Both remaining requests concern the same published-driver × candidate installation smoke. That broader smoke is deferred under the maintainer's explicit decision to land this scoped repair; the existing synthetic plugin/CLI regressions and exact-head green CI cover the changed finalization boundaries. No published-updater or full installation/recovery validation is claimed. No code fixups were needed.