Skip to content

fix(plugins): prevent config conflicts during legacy plugin installation - #154539

Merged
obviyus merged 4 commits into
openclaw:mainfrom
goutamadwant:fix/plugin-install-kind-inspection
Sep 21, 2026
Merged

obviyus merged 4 commits into
openclaw:mainfrom
goutamadwant:fix/plugin-install-kind-inspection

Conversation

@goutamadwant

@goutamadwant goutamadwant commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Closes #154325

What Problem This Solves

Fixes first-install configuration conflicts when a legacy plugin's registration callback writes configuration while the installer is still inspecting its kind.

User Impact

Legacy plugins can install successfully on the first attempt instead of leaving settings written but the plugin disabled. Exported plugin kinds, exclusive-slot selection, post-install registration, and existing settings are preserved. No configuration or storage migration is introduced by this fix.

Why This Change Was Made

Slot inspection now selects the loader's existing validation mode, which reads the legacy kind before returning without calling registration. The mode travels in the existing report parameters; no additional loader, retry, or separate configuration writer is added. Ordinary diagnostics retain their current registration behavior.

The regression extends the existing first-install table: a legacy registration callback writes a marker, and installation must not invoke it. The standalone test file and its database-lane entry were removed.

Evidence

  • Real source-built CLI → isolated Gateway installation reproduced the original config-hash conflict after a joined public-SDK configuration write. The plugin was not enabled. A manifest-declared-kind plugin with the same write, and a legacy plugin without a write, both installed successfully.
  • With the fix, all three installations succeeded. The legacy callback observed the enabled entry before its configuration write. A subsequent CLI setting and forced reinstall preserved the authored setting. All owned Gateway groups, children, and ports settled.
  • The consolidated regression failed on the original registration path (one legacy case failed; six controls passed). Final slot/inspection suites passed 53 tests in 33.04 seconds total runner time. The existing 32-case inspection file reported 30.54 seconds including transformation; it exercises real registration/resource retirement and config persistence, and the regression reuses its existing setup. Scoped type-aware lint, formatting, and both source-size ratchets passed.
  • The canonical candidate package passed its tarball integrity checks. In an isolated local Docker Linux/arm64 environment on Node 24.19.0, the actual npm-published 2026.9.5 updater ran update --tag /inputs/candidate.tgz --yes --no-restart --json and completed with status: ok. The installed build changed from release ec9c1a13db89 to candidate 2a0b8a39dcbd2355ec164f6c7555088a7b483609, despite both packages using version 2026.9.5.
  • That upgrade preserved the existing legacy plugin's entry, install record, selected slot, and user setting. The resulting candidate Gateway then completed a new config-writing legacy installation and forced reinstall. Installed payload hashes matched the candidate. Native cleanup verified the Gateway process and port closed; the proof container was deleted and confirmed absent.

The updater retained a Doctor advisory for the fixture's synthetic plaintext Gateway token. No real credentials or operator Gateway/state were used. The proof uses locally authored legacy plugins, not the reporter's particular plugin or its crash sequence; it does not claim a service restart or a cross-platform upgrade matrix.

The publication preserves the contributor's original commit and has the same complete source tree as the tested and packaged candidate: 1f864e2437a7f719061cc96d69a09d7be7c69eec.

@clawsweeper

clawsweeper Bot commented Sep 21, 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.

@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 21, 2026
@clawsweeper

clawsweeper Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 21, 2026, 6:53 AM ET / 10:53 UTC (Revision 3).

ClawSweeper review

What this changes

The PR prevents legacy plugin registration during installation-time kind inspection while preserving slot selection, and extends the existing installation regression tests.

Merge readiness

✅ Ready for maintainer review

This remains a useful fix: current main and the latest release retain the failing path. No blocking defect was found, and the updated installation and upgrade evidence resolves the previous proof blocker.

Priority: P1
Reviewed head: 8b335012d683e15b930ab17a24409c8b791f51fe

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level fix with meaningful regression coverage and sufficient fresh-install, reinstall, and upgrade evidence.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The captured body records real CLI-to-Gateway installation recovery for the changed slot-inspection path and a published 2026.9.5 updater-to-candidate run preserving existing settings, followed by successful installation and reinstall. The tested candidate and reviewed head have identical source trees, resolving the prior proof gap.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The captured body records real CLI-to-Gateway installation recovery for the changed slot-inspection path and a published 2026.9.5 updater-to-candidate run preserving existing settings, followed by successful installation and reinstall. The tested candidate and reviewed head have identical source trees, resolving the prior proof gap.
Evidence reviewed 10 items Introduced change: The pinned introduction delta adds validation mode only to legacy slot inspection, forwards it through internal report parameters, and extends the existing persistence test. It changes no dependencies, workflows, public SDK methods, configuration options, or storage formats.
Existing loader supplies the required boundary: The loader copies the exported kind at line 528 and returns for validation-only loading at lines 552–555 before registration. The caller-owned registry remains non-activating, and loader cache identity includes the mode. Ordinary diagnostics omit the new option and retain registration.
Persistence ordering: Installation selects slots before committing configuration with the captured base hash, then applies runtime activation after the commit. Preventing the intervening registration removes the reported conflicting write without weakening conflict detection or changing install-authority checks.
Findings None None.
Security None None.

How this fits together

The plugin installer determines which exclusive capability slots a plugin owns before saving its configuration. Legacy plugins expose that information through module exports; registration should occur after installation settings are committed.

flowchart TD
  A[Plugin installation] --> B[Read manifest metadata]
  B --> C{Kind declared?}
  C -->|Yes| E[Select capability slots]
  C -->|No| D[Read legacy exports without registration]
  D --> E
  E --> F[Commit installation settings]
  F --> G[Activate plugin registration]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +3, Tests +1. Total +4 across 3 files.

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

Review metrics

None.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #154325
Summary: This PR is the candidate repair for the linked registration-before-persistence defect; the issue should remain open until the fix merges.

Members:

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

Technical review

Best possible solution:

Keep legacy kind discovery within the existing validation loader and reserve registration for post-commit activation.

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

Yes: current main calls legacy registration before committing installation settings with the original config hash, so a registration-time configuration write can cause the reported conflict. This review verified the source path and inspected supplied runtime observations without executing it.

Is this the best way to solve the issue?

Yes: selecting the existing validation mode removes premature registration while retaining exported kinds, slot selection, conflict guards, and normal activation; retrying the stale write would leave the unwanted side effects intact.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The captured body records real CLI-to-Gateway installation recovery for the changed slot-inspection path and a published 2026.9.5 updater-to-candidate run preserving existing settings, followed by successful installation and reinstall. The tested candidate and reviewed head have identical source trees, resolving the prior proof gap.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The captured body records real CLI-to-Gateway installation recovery for the changed slot-inspection path and a published 2026.9.5 updater-to-candidate run preserving existing settings, followed by successful installation and reinstall. The tested candidate and reviewed head have identical source trees, resolving the prior proof gap.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P1: This repairs a reported current-release plugin installation regression that can leave installation incomplete or terminate the Gateway.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The captured body records real CLI-to-Gateway installation recovery for the changed slot-inspection path and a published 2026.9.5 updater-to-candidate run preserving existing settings, followed by successful installation and reinstall. The tested candidate and reviewed head have identical source trees, resolving the prior proof gap.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured body records real CLI-to-Gateway installation recovery for the changed slot-inspection path and a published 2026.9.5 updater-to-candidate run preserving existing settings, followed by successful installation and reinstall. The tested candidate and reviewed head have identical source trees, resolving the prior proof gap.

Evidence

What I checked:

  • Introduced change: The pinned introduction delta adds validation mode only to legacy slot inspection, forwards it through internal report parameters, and extends the existing persistence test. It changes no dependencies, workflows, public SDK methods, configuration options, or storage formats. (src/plugins/slot-selection.ts:69, 8b335012d683)
  • Existing loader supplies the required boundary: The loader copies the exported kind at line 528 and returns for validation-only loading at lines 552–555 before registration. The caller-owned registry remains non-activating, and loader cache identity includes the mode. Ordinary diagnostics omit the new option and retain registration. (src/plugins/loader-runtime-candidate.ts:528, 8b335012d683)
  • Persistence ordering: Installation selects slots before committing configuration with the captured base hash, then applies runtime activation after the commit. Preventing the intervening registration removes the reported conflicting write without weakening conflict detection or changing install-authority checks. (src/plugins/install-persistence.ts:347, 8b335012d683)
  • Supported legacy contract: The manifest documentation explicitly retains runtime-exported kinds as a compatibility fallback for older external plugins. This patch preserves that fallback instead of requiring third-party manifest changes. Public docs: docs/plugins/manifest.md. (docs/plugins/manifest.md:398, 8b335012d683)
  • Still necessary on main and released source: Both fetched main and release commit ec9c1a1 retain the diagnostics call without validation mode. The source reads establish that this repair is not already present in either inspected version. (src/plugins/slot-selection.ts:64, 2d3dd99f5642)
  • Regression coverage and prior review follow-up: The existing seven-case first-install table now checks that registration leaves no marker while slot and install-record persistence remain correct. The captured body reports the legacy case failed before the fix, six controls passed, and the final suites passed 53 tests in 33.04 seconds. It records 30.54 seconds for the existing inspection file and explains its real persistence/resource lifecycle coverage. The previous standalone regression and lane entry were consolidated. (src/plugins/status.runtime-inspection.test.ts:556, 8b335012d683)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • obviyus: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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 (2 earlier review cycles)
  • reviewed 2026-09-21T07:05:23.394Z sha bf2a9d2 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-21T09:11:02.978Z sha bf2a9d2 :: needs real behavior proof before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Sep 21, 2026
@obviyus obviyus self-assigned this Sep 21, 2026
@obviyus obviyus changed the title fix(plugins): first install fails when legacy registration changes config fix(plugins): prevent config conflicts during legacy plugin installation Sep 21, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 21, 2026
@obviyus

obviyus commented Sep 21, 2026

Copy link
Copy Markdown
Collaborator

landpr-approve-unrelated-red
pr: 154539
head: 8b33501
run: 35590291182 attempt: 1
failed: checks-node-compact-large-24 job=106303442055 conclusion=failure
failed: checks-node-compact-large-31 job=106303441895 conclusion=failure
failed: checks-node-compact-large-8 job=106303444858 conclusion=failure
check: openclaw/ci-gate

@obviyus
obviyus merged commit d510628 into openclaw:main Sep 21, 2026
233 of 238 checks passed
@obviyus

obviyus commented Sep 21, 2026

Copy link
Copy Markdown
Collaborator

Merged as d510628. Legacy plugin kind inspection now avoids registration-time configuration writes, fixing first-install conflicts while preserving normal registration and existing settings. Verified first install, reinstall, and a published 2026.9.5 updater installing the candidate, plus 53 focused tests. Exact-head review passed; unrelated hosted CI failures are recorded above. Thanks @goutamadwant for the fix and @obviyus for the maintainer repair and verification.

vincentkoc added a commit that referenced this pull request Sep 21, 2026
* commit '0883394977d1fb3af657635967f6e447bd7fff9a': (72 commits)
  fix(ui): await scheduled rail layout in focus test
  fix(cron): keep healthy active runs from delaying job lists (#154421)
  fix(plugins): prevent config conflicts during legacy plugin installation (#154539)
  perf(gateway): reduce repeated session-list work (#154551)
  fix(tasks): retain admitted work across list retries (#154338)
  perf(gateway): speed up transcript artifact downloads (#154726)
  chore(ui): refresh control ui locales (#154580)
  fix(release): keep two extended-stable months eligible (#154777)
  fix(tests): avoid avatar descriptor reuse race (#154747)
  perf(plugins): reduce callback scope overhead (#154625)
  fix(ui): include final request time in completed work summaries (#149240)
  fix(ai): avoid retrying conflicting Responses terminal statuses (#149242)
  fix: identify malformed Code Mode JavaScript as input errors (#149222)
  fix(doctor): settle imported JSONL transcript leftovers (#154413)
  fix(cloud): restore node bootstrap with bundled browser runtime (#154654)
  test(ui): await publication state notifications (#154768)
  fix(plugins): keep unchanged plugins running across metadata refreshes (#151281)
  fix: keep chat panel accessibility targets within each pane (#153478)
  fix: forced Gateway restarts cancel healthy subagent work (#154300)
  improve: reduce session delivery reader imports (#154740)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 22, 2026
…ion (openclaw#154539)

Closes openclaw#154325

## What Problem This Solves

Fixes first-install configuration conflicts when a legacy plugin's registration callback writes configuration while the installer is still inspecting its kind.

## User Impact

Legacy plugins can install successfully on the first attempt instead of leaving settings written but the plugin disabled. Exported plugin kinds, exclusive-slot selection, post-install registration, and existing settings are preserved. No configuration or storage migration is introduced by this fix.

## Why This Change Was Made

Slot inspection now selects the loader's existing validation mode, which reads the legacy kind before returning without calling registration. The mode travels in the existing report parameters; no additional loader, retry, or separate configuration writer is added. Ordinary diagnostics retain their current registration behavior.

The regression extends the existing first-install table: a legacy registration callback writes a marker, and installation must not invoke it. The standalone test file and its database-lane entry were removed.

## Evidence

- Real source-built CLI → isolated Gateway installation reproduced the original config-hash conflict after a joined public-SDK configuration write. The plugin was not enabled. A manifest-declared-kind plugin with the same write, and a legacy plugin without a write, both installed successfully.
- With the fix, all three installations succeeded. The legacy callback observed the enabled entry before its configuration write. A subsequent CLI setting and forced reinstall preserved the authored setting. All owned Gateway groups, children, and ports settled.
- The consolidated regression failed on the original registration path (one legacy case failed; six controls passed). Final slot/inspection suites passed **53 tests** in 33.04 seconds total runner time. The existing 32-case inspection file reported 30.54 seconds including transformation; it exercises real registration/resource retirement and config persistence, and the regression reuses its existing setup. Scoped type-aware lint, formatting, and both source-size ratchets passed.
- The canonical candidate package passed its tarball integrity checks. In an isolated **local Docker Linux/arm64** environment on Node 24.19.0, the actual npm-published **2026.9.5 updater** ran `update --tag /inputs/candidate.tgz --yes --no-restart --json` and completed with `status: ok`. The installed build changed from release `ec9c1a13db89` to candidate `2a0b8a39dcbd2355ec164f6c7555088a7b483609`, despite both packages using version 2026.9.5.
- That upgrade preserved the existing legacy plugin's entry, install record, selected slot, and user setting. The resulting candidate Gateway then completed a new config-writing legacy installation and forced reinstall. Installed payload hashes matched the candidate. Native cleanup verified the Gateway process and port closed; the proof container was deleted and confirmed absent.

The updater retained a Doctor advisory for the fixture's synthetic plaintext Gateway token. No real credentials or operator Gateway/state were used. The proof uses locally authored legacy plugins, not the reporter's particular plugin or its crash sequence; it does not claim a service restart or a cross-platform upgrade matrix.

The publication preserves the contributor's original commit and has the same complete source tree as the tested and packaged candidate: `1f864e2437a7f719061cc96d69a09d7be7c69eec`.

Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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.

[Bug]: First-time plugin install fails because gateway-ized install executes plugin register (kind inspection), racing install's own config write

2 participants