Skip to content

fix: keep unavailable configured plugins from rolling back updates - #150016

Merged
steipete merged 4 commits into
mainfrom
upd/clawhub-plugin-update-block
Sep 16, 2026
Merged

steipete merged 4 commits into
mainfrom
upd/clawhub-plugin-update-block

Conversation

@steipete

@steipete steipete commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Refs #149960

What Problem This Solves

A missing or unverifiable configured plugin could roll an update back at candidate Doctor lint or Gateway startup, even when the core configuration remained valid.

User Impact

The repaired Doctor availability and payload-verification paths record warnings at the updater’s error threshold, and the Gateway starts degraded when a tracked plugin payload is unavailable. Update results, openclaw update status --json, and Doctor identify the plugin and its next repair action. Authored configuration and pending migration inputs remain preserved.

Ordinary lint severity selection still applies. Structural config errors, data-integrity refusals, ingress protection, and maintenance ownership keep their existing contracts. No schemas, dependencies, or product options change.

Why This Change Was Made

Startup verification and Doctor lint now use one plugin-availability policy. Startup sends convergence warnings through its existing collector. Health registration returns invocation-local findings for missing/untrusted owners and unavailable advertised APIs; it does not import untrusted artifacts. The health registry preserves check selection while preventing stale detect/repair callbacks from an unavailable owner, and restores the registered checks on a later healthy invocation. Errors reported by registered lint checks retain their existing handling.

Thanks to @Olli0103 and @holny for diagnosing the ClawHub source-selection failure. That source fix is already on main in #148518, although released 2026.9.4 lacks it. This PR adds catalog-backed cohort-repair coverage and repairs the remaining lint/readiness gates; source-resolution production changes are zero.

Known gaps: Missing configured plugins.load.paths and other unattributed discovery errors still block update candidates (src/plugins/discovery.ts:1171, src/gateway/server-startup-post-attach.ts:1345). Restore or correct the path before retrying. A severity-only change would remove the incomplete-discovery signal that protects authored plugin/channel config from stale auto-removal (src/commands/doctor/shared/stale-plugin-config.ts:94); config warnings also discard diagnostic classification before lint. A complete fix needs coordinated discovery, config-preservation, and typed warning/report transport changes. This PR uses the explicitly authorized scope escape hatch and qualifies both documentation pages; discovery runtime is unchanged.

Evidence

  • ClawSweeper Rank-up moves: applied the documentation qualification and explicit discovery gap; completed the requested published-driver readiness/finalization/warning proof below. The later CI line-cap failure is repaired by moving the new scenarios to behavior-named sibling files and extracting the existing preflight read-only-worker scope into a named sibling module.
  • Follow-up validation: 350 focused tests passed after current-main integration, including both moved regressions and the original suites. The exact failed-CI line-cap implementation reports Line-cap ratchet OK: 20 changed source files; no new violations or over-cap growth. No cap, suppression, baseline, dependency, or schema changes. The changed-file checks passed; fresh local and branch P1 reviews are scoped-clean for follow-up head 12042fe8d84c82db05323e78c3365f5a824a8a14.
  • Both readiness regressions failed pre-fix: missing install paths were omitted from degraded state, and a host-link repair warning exited 78 with OpenClaw plugin verification failed; refusing to report the gateway ready. Both now pass.
  • The lint-boundary regression failed pre-fix with the missing-plugin exception. Its missing → healthy → broken → missing → untrusted → healthy sequence also exposed stale detector execution before the registry repair. It now proves warning-only availability, recovery, and preservation of real healthy-plugin data errors.
  • 453 focused tests passed, including source repair, lint, Doctor convergence, degraded state, and Gateway readiness; the lint-boundary test passed again after lint cleanup. The earlier corrected 218-test run is retained.
  • The full standard node scripts/check-changed.mjs passed. One standalone lint wrapper hit the nested-checkout declaration guard; the approved direct oxlint check passed and its deliberate no-map-spread canary failed. No suppressions or baseline changes were added.
  • pnpm build on 1976265b235 passed in 9m04s with zero INEFFECTIVE_DYNAMIC_IMPORT warnings. Canonical package inventory, integrity, and import-graph validation passed. Local and branch-mode Codex review (--mode branch --base origin/main, P1) were scoped-clean.
  • Published 9.3 → committed candidate Docker row passed, including lint, candidate canary, external degraded readiness, result/status warnings, and standalone Doctor. Nine replacement requests were denied only for Codex.
  • LOC: production +140/−133 (net +7); tests +501/−86 (net +415); docs +31. The small production growth carries invocation-local findings through existing selection/rendering, prevents stale callbacks, and extracts the read-only-worker lifetime scope outside the capped preflight module. Test growth includes isolated fixtures for the relocated regression cases.
Phase 9.3 → published 9.4 9.3 → readiness-only patch 9.3 → both fixes (1976265b235)
Baseline ClawHub Codex / plugin Doctor Passed Passed Passed
Baseline Gateway readiness HTTP 200, ready:true HTTP 200, ready:true HTTP 200, ready:true
Candidate migration rehearsal Passed Passed (8.090s) Passed (12.133s)
Candidate Doctor lint Exit 1: Codex health API resolution failure Exit 2: configured Codex plugin missing Exit 0 + Codex repair warning (4.437s)
Candidate Gateway canary Not reached Not reached Exit 0 (6.378s)
Update outcome Rolled back to 9.3 Rolled back to 9.3 status:ok, 9.4 retained; no rollback
Independent Gateway readiness Not reached Not reached HTTP 200, ready:true; Codex configured-unavailable
Result / update status / Doctor warnings Update failed first Update failed first All identify Codex and openclaw doctor --fix
Standalone Doctor / config validation Not reached Not reached Exit 0 after stopping the owned Gateway
Updater duration 238.576s 53.478s 126.743s

The final tarball’s SHA-256 is 022b62f1c604175f51fda905d151968cf3aa83b6964bcf0f84b75df8edc3db00; its embedded build commit is 1976265b235c3bc3d6469a8e5d4c197106eb169f. The harness verified installed bytes against that frozen artifact. Admission had 28.65 GiB free with no competing OpenClaw containers; minimum observed free space was 26.68 GiB. Owned containers, images, and runtime/install trees were removed after proof; summaries, phases, diagnostics, and logs remain.

The cells use the repository upgrade-survivor lifecycle with a task-local fixture: real published Codex 9.3 installed through ClawHub, its actual tracked record retained, then only its isolated payload removed and Codex replacement requests denied. The published updater runs with --no-restart, still exercises its private candidate Gateway canary, and is followed by an independently started Gateway. This proves the update and readiness path, not model inference or a system-service handoff.

Two preliminary runs of the same final artifact completed the update but stopped in task-local proof checks: an assumption of one Codex failure record instead of several repair/verification stages, then a maintenance attempt while the owned Gateway was running. The adapter now recognizes fixture-bound availability outcomes and the shipped typed Doctor exit-86 advisory; 12 negative canaries still reject unrelated failures, consent/integrity errors, invalid nonzero exits, and missing guidance. The final row stops its Gateway before doctor --fix and passes end to end. The advisory exit 86 is recorded, not hidden or treated as a core failure.

The published-before row failed at Doctor health API resolution before the original issue’s two exact messages appeared. Its rollback and the readiness-only row are retained as observed plugin-health blockers, not exact-string live reproductions.

The schema-17 refusal was secondary: it disabled optional old-driver repair after lint had already failed. It was not a universal rejection of newer-schema candidates; the successful final row confirms that. Schema code is unchanged.

Published 9.3 schema refusal trace

After lint failed, the already-loaded 9.3 parent bound its repair environment to the private rehearsal and called getRuntimeConfig() in prepareUpdateRepairInference. The exact database refusal was:

OpenClaw state database /tmp/openclaw-upgrade-survivor-runtime/tmp/openclaw-update-canary-DqYooY/state/openclaw.sqlite uses newer schema version 17; this build supports 16.

assertSupportedStateSchemaVersion throws that refusal via createNewerSqliteSchemaVersionError; config loading logs it and repair inference catches it, returning The target configuration could not provide a usable inference route. Check model setup. It disabled repair of the already-failed candidate. The final reason remained doctor-failed. The normal driver path validates in candidate subprocesses and uses a fresh candidate finalizer after migration.

Main really carries OPENCLAW_STATE_SCHEMA_VERSION = 17 in src/state/openclaw-state-db-contract.ts:20. Commit 411ea27d9af (#143227) bumped 16→17 and is an ancestor of released 9.4 and this branch. No schema code changed here.

The follow-up retains the Docker evidence from 1976265b235: the follow-up changes move the existing read-only-worker scope, relocate tests, and qualify documentation. The published ClawHub fixture has no configured plugins.load.paths and does not exercise the deferred discovery branch, so that row was not rerun for this follow-up.

Current main 58bda85ea74af2648437c48bcfc3f90d400321f6 was integrated to resolve one overlapping preflight extraction. Its checkpoint/persistence owner and schema-preparation work are retained unchanged. The final committed tree passes the native pnpm check:line-cap-ratchet --base 58bda85ea74af2648437c48bcfc3f90d400321f6 command. No ratchet, dependency, schema, or baseline changes are part of the PR diff against that base.

@clawsweeper

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

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime commands Command implementations size: M maintainer Maintainer-authored PR labels Sep 16, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 16, 2026
@clawsweeper

clawsweeper Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 16, 2026, 2:18 PM ET / 18:18 UTC (Revision 6).

ClawSweeper review

What this changes

Makes unavailable configured plugins produce Doctor warnings and degraded Gateway readiness while preserving pending migrations and repair guidance.

Merge readiness

⛔ Blocked before merge - 1 item remains

This PR remains useful: current main still contains the lint and readiness blockers it addresses. The earlier documentation concern is resolved, the integration preserves the intended repair, and no actionable introduced defect was found.

Priority: P1
Reviewed head: 12042fe8d84c82db05323e78c3365f5a824a8a14

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with strong upgrade observations, useful regression coverage, and no remaining actionable correctness finding.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): Retained Docker observations exercise the published updater through the changed Doctor and startup owners: denied Codex replacement produces warnings, successful cutover, and independent degraded readiness. Follow-up source inspection supports retaining that proof after extraction and base integration; inference and service-manager handoff are outside its claim.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): Retained Docker observations exercise the published updater through the changed Doctor and startup owners: denied Codex replacement produces warnings, successful cutover, and independent degraded readiness. Follow-up source inspection supports retaining that proof after extraction and base integration; inference and service-manager handoff are outside its claim.
Evidence reviewed 10 items Current main still needs the repair: Fetched main still throws for missing or unverifiable configured Codex health APIs. Its startup verification also excludes missing-install-path failures from quarantine and retains blocking convergence diagnostics.
Latest release retains the health-API blocker: The supplied latest-release commit still throws MissingPublicSurfaceError when the configured Codex owner is missing or untrusted; this repair is not present there.
Availability remains separate from import trust: The selected installation must still be bundled or verified official before its API is imported. Availability findings replace exceptions without changing that predicate or the plugin registration API; invocation-local wrappers suppress unavailable owners' stale detect and repair callbacks.
Findings None None.
Security None None.

How this fits together

Doctor checks configuration and installed plugins before updates and Gateway startup. Its findings determine whether an update proceeds, while plugin quarantine lets the Gateway serve available capabilities and report unavailable ones.

flowchart TD
  A[Configuration and installed plugins] --> B[Doctor verification]
  B --> C{Plugin available?}
  C -->|Yes| D[Registered health checks]
  C -->|No| E[Warning and plugin quarantine]
  D --> F[Update and startup gates]
  E --> F
  F --> G[Gateway readiness and repair guidance]
Loading

Before merge

  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source +7, Tests +415, Docs +31. Total +453 across 22 files.

View PR surface stats
Area Files Added Removed Net
Source 10 140 133 +7
Tests 10 501 86 +415
Docs 2 31 0 +31
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 22 672 219 +453

Review metrics

Metric Value Why it matters
Production versus regression coverage Production net +7 lines; tests net +415 lines The small production increase carries availability findings through existing owners; regression coverage exercises degraded startup, warning retention, and disappearing/recovering plugins.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/commands/doctor-config-preflight-plugin-verification.ts, migration/backfill/repair: src/commands/doctor-config-preflight-startup.ts, migration/backfill/repair: src/commands/doctor-config-preflight-worker-scope.ts, migration/backfill/repair: src/commands/doctor-config-preflight.ts, migration/backfill/repair: src/commands/doctor-lint.ts, migration/backfill/repair: src/flows/doctor-health-contribution-core.ts, and 3 more. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Keep plugin availability advisory through the existing Doctor and quarantine owners while preserving import trust, real health errors, and pending migration inputs.

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

Yes: current-main source exposes the missing-plugin lint exception and blocking startup warning path, supported by the supplied failing-before regressions and published-driver comparison; this review did not execute them.

Is this the best way to solve the issue?

Yes: the patch extends existing availability and warning owners, preserves actual health-check errors and import trust, and explicitly bounds the unchanged discovery limitation.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P1: Unavailable configured plugins can roll back otherwise viable updates, and the supplied published-driver comparison demonstrates that failure.
  • 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): Retained Docker observations exercise the published updater through the changed Doctor and startup owners: denied Codex replacement produces warnings, successful cutover, and independent degraded readiness. Follow-up source inspection supports retaining that proof after extraction and base integration; inference and service-manager handoff are outside its claim.
  • proof: sufficient: Contributor real behavior proof is sufficient. Retained Docker observations exercise the published updater through the changed Doctor and startup owners: denied Codex replacement produces warnings, successful cutover, and independent degraded readiness. Follow-up source inspection supports retaining that proof after extraction and base integration; inference and service-manager handoff are outside its claim.

Evidence

What I checked:

  • Current main still needs the repair: Fetched main still throws for missing or unverifiable configured Codex health APIs. Its startup verification also excludes missing-install-path failures from quarantine and retains blocking convergence diagnostics. (src/flows/bundled-health-checks.ts:213, bf9a9ac70e77)
  • Latest release retains the health-API blocker: The supplied latest-release commit still throws MissingPublicSurfaceError when the configured Codex owner is missing or untrusted; this repair is not present there. (src/flows/bundled-health-checks.ts:206, 3a9d69db306c)
  • Availability remains separate from import trust: The selected installation must still be bundled or verified official before its API is imported. Availability findings replace exceptions without changing that predicate or the plugin registration API; invocation-local wrappers suppress unavailable owners' stale detect and repair callbacks. (src/flows/bundled-health-checks.ts:220, 12042fe8d84c)
  • Actual plugin contract inspected: The health API consumed by the patch is implemented in this repository's Codex plugin. Its registered check uses source 'codex', retains default-disabled selection, and reports actual detector errors independently of API availability. The changed contract concerns OpenClaw plugin loading, not an upstream Codex protocol change or inference claim. (extensions/codex/src/doctor.ts:223, 12042fe8d84c)
  • Retained published-driver proof: The captured PR body, source revision 58ab03d539e1516927568c9be6afd3e34e13c6c67bceaee11cd81e0bdaa2917f, records a published 2026.9.3 updater against artifact 022b62f1c604175f51fda905d151968cf3aa83b6964bcf0f84b75df8edc3db00. With the tracked Codex payload removed and replacement requests denied, candidate lint and canary exited 0, the update remained installed, independent readiness returned HTTP 200/ready:true with Codex unavailable, and status/Doctor retained repair warnings. This covers update and readiness, not inference or service-manager handoff. Prepared screenshots were inspected and belong to the related plugin-search PR, not this runtime proof. (1976265b235c)
  • Re-review continuity and integration: The pinned base-to-head diff preserves the base's checkpoint/persistence and schema-preparation work. The worker-scope extraction retains the same condition and lifetime. The body reports 350 focused tests and changed-file checks after integration. A local prior-head comparison encountered an unavailable promisor blob; the relevant integration patch was subsequently inspected through GitHub. The supplied stale test merge was not used to infer removals or regressions. (src/commands/doctor-config-preflight.ts:79, 12042fe8d84c)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; 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 (5 earlier review cycles)
  • reviewed 2026-09-16T11:45:45.501Z sha 7265e9f :: blocked before merge. :: [P2] Qualify the readiness guarantee for update candidates
  • reviewed 2026-09-16T12:11:16.596Z sha 7265e9f :: blocked before merge. :: [P2] Qualify the readiness guarantee for update candidates
  • reviewed 2026-09-16T17:03:25.815Z sha 1976265 :: blocked before merge. :: [P2] Qualify the readiness guarantee for update candidates
  • reviewed 2026-09-16T17:33:18.117Z sha 1976265 :: blocked before merge. :: [P2] Qualify the readiness guarantee for update candidates
  • reviewed 2026-09-16T17:59:33.771Z sha 5b17f3d :: blocked before merge. :: none

@steipete steipete changed the title fix(gateway): start degraded when a configured plugin cannot be verified fix: keep unavailable configured plugins from rolling back updates Sep 16, 2026
@steipete
steipete marked this pull request as ready for review September 16, 2026 17:26
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. and removed merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Sep 16, 2026
@clawsweeper clawsweeper Bot added 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: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 16, 2026
@steipete
steipete merged commit eb8bca1 into main Sep 16, 2026
190 of 192 checks passed
@steipete
steipete deleted the upd/clawhub-plugin-update-block branch September 16, 2026 18:38
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Sep 16, 2026
Record a typed preserve disposition at discovery and retain it through the plugin index. Keep uninspected settings intact across validation, cleanup, migration, and automatic activation; carry the warning into Doctor and update readiness reports. Refs #150016 and #149960.
steipete added a commit that referenced this pull request Sep 16, 2026
…150312)

* fix: preserve unavailable plugin paths during updates

Record a typed preserve disposition at discovery and retain it through the plugin index. Keep uninspected settings intact across validation, cleanup, migration, and automatic activation; carry the warning into Doctor and update readiness reports. Refs #150016 and #149960.

* test: activate missing-path upgrade fixture at startup

* fix(doctor): preserve unavailable bundled path aliases

* test(update): keep base upgrade install on native storage

* test(update): verify retained migration sources for unavailable plugins

* fix(plugins): retain filesystem inspection failures during updates

* test(doctor): require the inspection diagnostic before projection checks

* style(doctor): avoid mapped spreads in inspection findings

* test(update): follow survivor runtime and artifact paths

* fix(doctor): preserve availability warnings through startup repair

* test(e2e): share upgrade survivor installation paths
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 17, 2026
…penclaw#150016)

* fix(gateway): start degraded when a configured plugin cannot be verified

* fix(doctor): warn when configured plugins are unavailable

* fix(doctor): satisfy line caps and clarify discovery limits
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 17, 2026
…penclaw#150312)

* fix: preserve unavailable plugin paths during updates

Record a typed preserve disposition at discovery and retain it through the plugin index. Keep uninspected settings intact across validation, cleanup, migration, and automatic activation; carry the warning into Doctor and update readiness reports. Refs openclaw#150016 and openclaw#149960.

* test: activate missing-path upgrade fixture at startup

* fix(doctor): preserve unavailable bundled path aliases

* test(update): keep base upgrade install on native storage

* test(update): verify retained migration sources for unavailable plugins

* fix(plugins): retain filesystem inspection failures during updates

* test(doctor): require the inspection diagnostic before projection checks

* style(doctor): avoid mapped spreads in inspection findings

* test(update): follow survivor runtime and artifact paths

* fix(doctor): preserve availability warnings through startup repair

* test(e2e): share upgrade survivor installation paths
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR 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: L 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