Skip to content

fix(plugins): keep channels authoritative after activation rollback - #129232

Merged
jalehman merged 1 commit into
mainfrom
oc-27e/plugin-registry-rollback-epoch
Aug 26, 2026
Merged

jalehman merged 1 commit into
mainfrom
oc-27e/plugin-registry-rollback-epoch

Conversation

@jalehman

@jalehman jalehman commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Closes #127393

What Problem This Solves

Fixes an issue where running bundled channels lost trusted ingress and invoker provenance after a candidate plugin registry failed to activate. Although OpenClaw restored the prior registry object, its existing channel runtimes were no longer recognized as live until restart recovery.

Why This Change Was Made

Failed pre-commit activation now uses a rollback-specific registry operation that preserves the prior committed lifecycle epoch because staging never retired it. Successful replacement and genuine later reactivation retain their existing behavior: they retire old authority and mint a fresh epoch.

This adds no config, protocol, plugin SDK, or database surface.

User Impact

Running bundled channels remain authoritative through a failed plugin activation rollback instead of temporarily degrading provenance to unknown. A later successful replacement still revokes the old channel authority.

Evidence

  • Regression failed before the fix: the restored prior epoch was inactive (expected false to be true).
  • mise exec -- node scripts/run-vitest.mjs src/plugins/loader.test.ts src/plugins/registry-runtime.channel-ingress.test.ts
    • loader: 183 passed
    • channel ingress: 25 passed
  • Blacksmith Testbox tbx_01m0w5h6w9axgfr8kxjje3v13c: pnpm build passed in 6m20s (run).
  • Changed-file gate passed policy, formatting, boundaries, dead-export, and production typecheck lanes locally and remotely. The clean remote run stalled without output in core-test typechecking and was explicitly stopped after more than ten minutes (run); focused core tests and the complete clean build passed separately.
  • Autoreview: clean, no actionable findings.
  • LOC: production +21/-3 (net +18); test +13/-1 (net +12). Production growth is the named rollback lifecycle operation and its explicit epoch-preservation boundary.
  • Post-merge same-lease real-behavior proof on Blacksmith Testbox tbx_01m10a0a1s8j0hdt80rr3ss6d3: detached baseline 33e556fe8a2331d2deff610508b45c1d28df5a01 degraded retained channel ingress/invoker authority from present to unknown after failed activation; detached merged head 2056b13ace89cbfa993ff7427b9b00f56ce50ade kept both present, including a subsequent real QA-channel turn, while successful replacement revoked both to unknown. Both scenarios passed through real ephemeral Gateways and operator CLI calls; isolated state, detached worktrees, and remote artifacts were cleaned (run).

@clawsweeper

clawsweeper Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Aug 25, 2026
@jalehman
jalehman marked this pull request as ready for review August 25, 2026 10:15
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 25, 2026
@clawsweeper

clawsweeper Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 25, 2026, 6:52 AM ET / 10:52 UTC.

ClawSweeper review

What this changes

The PR makes failed plugin-registry activation rollback restore the previous registry without reminting its lifecycle epoch, preserving retained bundled-channel provenance.

Regression provenance

Possible regression — probable (reproduction; reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open. This active maintainer-labelled PR is the canonical repair for the linked regression; current main still remints the restored registry epoch, while the branch preserves it only on failed staging.

Priority: P2
Reviewed head: 2056b13ace89cbfa993ff7427b9b00f56ce50ade

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, source-backed lifecycle repair with regression coverage and no concrete correctness or security finding.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: The maintainer-authored PR includes focused regression and build evidence; the external-contributor real-behavior gate does not apply.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer-authored PR includes focused regression and build evidence; the external-contributor real-behavior gate does not apply.
Evidence reviewed 6 items Current-main defect: Current main restores the prior snapshot through the normal installer, which unconditionally activates it and therefore remints its epoch.
Lifecycle invariant: Each activation creates a fresh opaque registry epoch; bundled channel owners capture and validate that exact epoch before being considered live.
Branch repair: The rollback-specific helper skips reactivation only when restoring the pre-staging snapshot; its normal installer path still retires the staged candidate.
Findings None None.
Security None None.

Live Verification

Command: mise exec -- node scripts/run-vitest.mjs src/plugins/loader.test.ts src/plugins/registry-runtime.channel-ingress.test.ts

Result: FAIL (partial) — step 2 expect_output passed: expected terminal output was not visible within 30 seconds: "passed"

mise exec -- node scripts/run-vitest.mjs src/plugins/loader.test.ts src/plugins/registry-runtime.channel-ingress.test.tsrunner@runnervm76f27:/tmp/clawsweeper-li
ve-proof-129232-4GgiKn/target$ mise exec -- node scripts/run-vitest.mjs src/plugins/loader.test.ts src/plugins/registry-runtime.channel-ingress.test.ts
Command 'mise' not found, did you mean:
  command 'muse' from deb muse (4.2.1-1)
Try: apt install ‹deb name›
runner@runnervm76f27:/tmp/clawsweeper-live-proof-129232-4GgiKn/target$ mise exec -- node scripts/run-vitest.mjs src/plugins/loader.test.ts src/plugins/registry-
runtime.channel-ingress.test.ts
Command 'mise' not found, did you mean:
  command 'muse' from deb muse (4.2.1-1)
Try: apt install ‹deb name›
runner@runnervm76f27:/tmp/clawsweeper-live-proof-129232-4GgiKn/target$








































Assertions:

  • FAIL expect_output: passed

How this fits together

Plugin activation temporarily stages a replacement registry before committing it. Bundled channel runtimes retain an epoch from the active registry; that epoch controls whether their ingress and invoker provenance can be attached to the next channel context.

flowchart LR
A[Active plugin registry] --> B[Stage replacement registry]
B --> C{Activation succeeds?}
C -->|Yes| D[Retire prior epoch]
D --> E[Old channel closures rejected]
C -->|No| F[Rollback prior registry]
F --> G[Retained channel provenance stays live]
Loading

Before merge

  • Resolve merge risk (P1) - Production code grows by net 18 lines; that is justified only by keeping the no-reactivation mode private to failed staging while retaining ordinary reactivation semantics elsewhere.
  • Complete next step (P2) - The linked issue is already owned by this active PR, which needs ordinary maintainer review rather than a separate repair job.
Agent review details

Security

None.

PR surface

Source +30. Total +30 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 3 34 4 +30
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 34 4 +30

Review metrics

Metric Value Why it matters
Production vs test LOC production +18 net; tests +12 net The production growth is confined to distinguishing failed staging rollback from genuine registry reactivation.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #127393
Summary: This PR is the candidate fix for the linked failed-activation lifecycle-epoch regression.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep rollback as the sole caller of the no-reactivation path, preserve ordinary activation for genuine replacement, and land the focused lifecycle regression coverage with the PR.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep rollback as the sole caller of the no-reactivation path, preserve ordinary activation for genuine replacement, and land the focused lifecycle regression coverage with the PR.

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

Yes. Current main’s restore call reaches an unconditional activation that remints the captured epoch; the changed regression test models a failed activation followed by a successful replacement.

Is this the best way to solve the issue?

Yes. The branch repairs the lifecycle owner rather than masking lost provenance downstream, and preserves the distinct retirement behavior for successful replacement.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against f830b8c1590b.

Labels

Label justifications:

  • P2: This repairs a bounded active-channel provenance regression after failed plugin activation.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The maintainer-authored PR includes focused regression and build evidence; the external-contributor real-behavior gate does not apply.

Evidence

What I checked:

  • Current-main defect: Current main restores the prior snapshot through the normal installer, which unconditionally activates it and therefore remints its epoch. (src/plugins/loader-shared.ts:377, f830b8c1590b)
  • Lifecycle invariant: Each activation creates a fresh opaque registry epoch; bundled channel owners capture and validate that exact epoch before being considered live. (src/plugins/registry-lifecycle.ts:20, f830b8c1590b)
  • Branch repair: The rollback-specific helper skips reactivation only when restoring the pre-staging snapshot; its normal installer path still retires the staged candidate. (src/plugins/runtime.ts:204, 2056b13ace89)
  • Regression coverage: The changed loader test forces activation failure, verifies the prior epoch remains live, then verifies a later successful replacement invalidates it. (src/plugins/loader.registration.test-utils.ts:376, 2056b13ace89)
  • History and ownership: Current-main blame attributes the implicated baseline boundary to Peter Steinberger; the synthetic/promisor checkout cannot establish earlier introduction provenance. (src/plugins/runtime.ts:212, c5d1cb38e208)
  • Release status: The repair commit is not contained by any local release tag; latest supplied release v2026.7.1-2 predates the 2026-08-25 PR commit. (2056b13ace89)

Likely related people:

  • steipete: Current-main blame reaches Peter Steinberger at the implicated plugin lifecycle boundary; the linked canonical issue is also authored by steipete. (role: recent area contributor; confidence: low; commits: c5d1cb38e208; files: src/plugins/runtime.ts, src/plugins/loader-shared.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-25T10:20:46.971Z sha 2056b13 :: needs maintainer review before merge. :: none

@jalehman
jalehman enabled auto-merge (squash) August 26, 2026 23:52
@jalehman
jalehman merged commit bcf330c into main Aug 26, 2026
479 of 481 checks passed
@jalehman
jalehman deleted the oc-27e/plugin-registry-rollback-epoch branch August 26, 2026 23:52
vincentkoc added a commit that referenced this pull request Aug 26, 2026
* origin/main: (26 commits)
  fix(plugins): preserve registry epoch on activation rollback (#129232)
  refactor(plugins): make discovery invocation-owned (#130486)
  feat(ui): save appearance preferences per user profile (#130340)
  fix: Buzz bots recover relay stalls and reject revoked senders (#130467)
  fix(code-mode): serialize catalog handles nested in final values (#130276)
  fix(webchat): CLI skill and harness-injected turns render as operator-sent messages (#130427)
  fix(agents): read the published model catalog owner from session_status (#130277)
  fix(channels): preserve long presentation text (#130368)
  fix(agents): route CLI bootstrap truncation notice into the system prompt (#130325)
  refactor(plugins): unify setup registration and artifact selection (#130474)
  fix(memory): prevent forgotten session content from returning (#130451)
  refactor(outbound): consolidate transport completion (#130460)
  fix(workers): protect in-flight workspace manifests from concurrent retention (#130449)
  fix(portals): keep worker previews reachable and owned by the active environment (#130434)
  fix(config): keep core channels keys in the generated config schema (#120736)
  chore(deps): refresh dependencies after seven-day cooldown (#130296)
  fix(agents): remind exec models to quote shell metacharacters (#125485)
  fix(auth): honor shared-store ownership in temp-state exec and agent deletion (#130437)
  fix(openshell): preserve file writes during concurrent mirror commands (#130447)
  fix(workers): report full nodes as at capacity, not offline (#130445)
  ...
@jalehman

Copy link
Copy Markdown
Contributor Author

Post-merge real-behavior proof passed on the same Blacksmith Testbox lease tbx_01m10a0a1s8j0hdt80rr3ss6d3 (run).

Using detached worktrees and isolated OPENCLAW_STATE_DIRs, the real pnpm openclaw qa suite flow started the bundled QA channel and ephemeral Gateways (45459 baseline, 44143 fixed), sent real inbound turns, and exercised activation through operator gateway call RPCs. Baseline 33e556fe8a2331d2deff610508b45c1d28df5a01 changed retained ingress/invoker authority from present to unknown after the synthetic activation failure. Merged head 2056b13ace89cbfa993ff7427b9b00f56ce50ade preserved both as present, and the subsequent channel turn audited as present; a later successful replacement still revoked both to unknown.

Command: node scripts/crabbox-wrapper.mjs run --provider blacksmith-testbox --id tbx_01m10a0a1s8j0hdt80rr3ss6d3 --timing-json -- OPENCLAW_TESTBOX=1 OPENCLAW_TESTBOX_REMOTE_RUN=1 bash .pr129232-proof/run-remote.sh

Result: 1 passed, 0 failed on each revision; wrapper exit 0 in 11m49s. Detached worktrees, isolated state, and remote artifacts were removed; no proof artifacts were committed.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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.

Failed plugin registry activation invalidates the restored registry lifecycle epoch

1 participant