Skip to content

fix(plugins): avoid repeating failed update rollbacks - #191182

Merged
vincentkoc merged 2 commits into
mainfrom
audit/update-owner-dedup-20261102
Nov 2, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
audit/update-owner-dedup-20261102

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Plugin updates can attempt a failed rollback twice after peer-link repair fails, or roll back a deferred install before its caller owns settlement.

User Impact

The admitting transaction owner now settles the failure. The original peer-link error and rollback errors remain visible. No config migration or operator action is required.

Why This Change Was Made

Remove the summary's parallel transaction list and rollback catch. Reuse the existing transaction-retention helper and keep install-owner migrations in their existing map.

Production: −45 lines. Tests: +54 lines, replacing helper-only peer-link cases with direct and deferred updater regressions; the allocation covers exactly that growth. Existing ordering, refusal, retry, migration, and alias coverage remains.

This repair must be present in the running plugin updater. It does not change core activation or recovery protocols.

Evidence

  • Formatting and git diff --check passed.
  • Final-head CI passed on 8aeaebdf1838b7a35dc52c99f7132e76d7bb60b2, merge checkout 380eeaf1: Bun authority suite 16/16, including both new direct/deferred rollback regressions; transaction suite 18/18; caller and Doctor persistence suites 14/14. All planned test, production/test type, lint and baseline-ratchet jobs passed. The removed helper's obsolete two-assertion allowance is also deleted.
  • Local dependency-backed execution was unavailable in this code-only checkout. The focused baseline Testbox queued and was stopped during hydration before tests ran (run); no baseline-red result is claimed.
  • Independent local review completed with no actionable P0–P3 findings. Hosted ClawSweeper review covers the final head and reports no actionable defect. Local ClawSweeper was unavailable because its runner checkout was dirty.
  • Rank-up move deferred: shipped-updater failure and latest-stable upgrade replay. This PR repairs settlement ownership inside the running plugin updater, exercised through the updater and lease boundary with injected effect failures; a candidate upgrade cannot change an already-running older updater. No installed-upgrade or live-registry proof is claimed.
  • Installed-version upgrade and live registry execution were not run.

@vincentkoc vincentkoc self-assigned this Nov 2, 2026
@clawsweeper

clawsweeper Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@vincentkoc
vincentkoc marked this pull request as ready for review November 2, 2026 15:19
@vincentkoc
vincentkoc enabled auto-merge (squash) November 2, 2026 15:37
@vincentkoc
vincentkoc disabled auto-merge November 2, 2026 15:40
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 2, 2026
@clawsweeper

clawsweeper Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR removes duplicate plugin-update rollback handling and leaves settlement with the transaction’s admitting owner.

Example: Updating demo to 1.2.4 encounters a peer-link repair error followed by a backup restoration error.

  • Before: A direct update retries the failed rollback immediately; a deferred update attempts rollback before its caller settles it.
  • After: The direct owner attempts rollback once, while deferred settlement remains with the caller; both errors remain available.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The focused implementation is sound on source review, but the supplied mock-backed checks do not satisfy the repository’s real-behavior proof requirement.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A failed plugin update can repeat rollback work or settle a deferred installation before its caller controls settlement.
Reason: This maintainer-authored repair restores the existing single-owner contract without adding settings, public APIs, or recovery machinery.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR addresses a confirmed rollback ownership defect still present on main; no actionable introduced code defect was found.

Priority: P2
Reviewed head: 8aeaebdf1838b7a35dc52c99f7132e76d7bb60b2

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: No shipped updater replay with real filesystem rollback or latest-stable upgrade is supplied, and the regressions have no executed baseline-red result.
Agent review details

How this fits together

The plugin updater consumes install records and installer transactions, repairs host links, and returns updated records and outcomes to the caller that publishes and settles the update.

flowchart TD
  A[CLI or Doctor caller] --> B[Plugin updater]
  B --> C[Installer transaction]
  C --> D[Admitting owner transaction sink]
  B --> E[Host link repair]
  E --> F[Summary or original failure]
  F --> D
  D --> G[Commit or rollback]
Loading

Technical review

Best possible solution:

Retain install transactions only in the admitting owner’s sink and let that owner settle each failed operation once.

Do we have a high-confidence way to reproduce the issue?

Source tracing establishes the duplicate direct rollback and premature deferred settlement paths; no runtime reproduction was performed during this read-only review.

Is this the best way to solve the issue?

The patch is the smallest complete ownership repair: it reuses transaction retention, removes the competing rollback path, and preserves migration metadata and error aggregation.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against dc97a18463c3.

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source -45, Tests +54, Other +1. Total +10 across 6 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 25 70 -45
Tests 2 91 37 +54
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 2 1 +1
Total 6 118 108 +10

Review metrics

Metric Value Why it matters
Production versus regression-test LOC Production +25/-70 (net -45); tests +91/-37 (net +54) Removes duplicate settlement machinery and replaces helper-only cases with distinct direct and deferred updater regressions.

Labels

Label changes:

  • add P2: Repairs a bounded plugin-update failure path involving peer-link repair and rollback errors.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: Repairs a bounded plugin-update failure path involving peer-link repair and rollback errors.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Supply the shipped updater failure and upgrade evidence described in the proof assessment.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 2, 2026, 10:57 AM ET / 15:57 UTC.

@vincentkoc
vincentkoc merged commit c108c2c into main Nov 2, 2026
147 of 148 checks passed
@vincentkoc
vincentkoc deleted the audit/update-owner-dedup-20261102 branch November 2, 2026 16:04
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 3, 2026
* fix(plugins): avoid repeating failed update rollbacks

* chore(plugins): retire removed updater assertion allowance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant