Skip to content

fix(plugins): explain SDK incompatibilities after core updates - #139458

Merged
steipete merged 3 commits into
mainfrom
codex/plugin-core-skew
Sep 6, 2026
Merged

steipete merged 3 commits into
mainfrom
codex/plugin-core-skew

Conversation

@steipete

@steipete steipete commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where plugin SDK import failures after a core update produced raw native errors without identifying the repair. Community reports described missing named SDK exports and plugins resolving an incompatible nested OpenClaw SDK. Post-update Doctor could also miss a stale configured runtime plugin because it compared against the updater process's previous version.

Related: #137777, which already repaired failed-plugin generation admission and keeps model-facing errors pointed at runtime inspection.

Why This Change Was Made

src/plugins/loader-records.ts now recognizes native SDK import failures, including wrapped causes, through the existing error recorder. An optional sdkCompatibility diagnostic carries the imported seam, running core, build version when known, and nested-SDK attribution. Existing log lines, plugin errors, inspection output, and Doctor diagnostics receive the same repair message. Existing classifications such as channel-setup-failure remain intact because status health checks depend on them.

Doctor now uses the same compatibility host version for stale-runtime detection and installation (src/commands/doctor/shared/missing-configured-plugin-install.candidates.ts). Validation errors share the existing recorder while preserving silent validation reporting. Redundant identity arguments and a one-call diagnostic append wrapper are removed. Plugin ids that require quoting receive plain update/author guidance instead of an unquoted command. No Plugin SDK exports are removed or renamed, and existing diagnostics require no new fields.

Forwarding raw loader failures into model responses and adding a second error channel were rejected. The existing model error names the failed owner and directs the operator to openclaw plugins inspect <id> --runtime --json; that path is retained. This PR covers diagnostics and the configured-runtime Doctor repair; broader registry-source selection and post-update failure policy are outside this continuation.

The data-model classifier was checked against the diff: no SQLite schema, storage format, retention, indexing, concurrency, or recovery semantics change. Doctor selects an existing repair using the corrected version input; the existing installer and record-commit contracts remain intact. The 111 passing repair tests cover upgrade/selector compatibility.

User Impact

Operators can identify which plugin imported which SDK seam, see the running core/build versions, and follow the update instruction. Nested-SDK failures explicitly tell the operator to update the plugin or contact its author. Configured runtime repair no longer treats an old plugin as current merely because the updater process still runs old code.

Evidence

Head: 85002ef

  • Native synthetic package regressions: four missing-export/nested-subpath cases failed before the diagnostic change and pass afterward. A fifth case exposed loss of the existing channel failure classification; it failed before the preservation correction and now passes.
  • node scripts/run-vitest.mjs src/plugins/loader-records.sdk-compatibility.test.ts src/plugins/loader-records.test.ts src/plugins/loader.cli-metadata.test.ts src/plugins/loader.test.ts: passed (231 tests before the additional classification case).
  • node scripts/run-vitest.mjs src/plugins/loader-records.sdk-compatibility.test.ts src/plugins/loader-records.test.ts src/agents/harness/runtime-plugin.test.ts src/agents/prepared-model-runtime.reply-fallback.test.ts src/commands/doctor-workspace-status.test.ts: passed (80 tests before the additional classification case).
  • node scripts/run-vitest.mjs src/plugins/loader-records.sdk-compatibility.test.ts src/plugins/loader-records.test.ts src/status/status-plugin-health.test.ts: passed (35 tests), including the final classification correction.
  • node scripts/run-vitest.mjs src/commands/doctor/shared/missing-configured-plugin-install.test.ts: passed again (111 tests), with the newer-core fixture derived from VERSION so it stays valid across releases; the new post-core case failed on the original production code because no install was attempted.
  • Isolated state/config with a synthetic old official plugin: pnpm openclaw plugins inspect whatsapp --runtime --json displayed the SDK diagnostic and update command. No live Gateway or user state was changed.
  • node scripts/run-vitest.mjs src/plugins/loader-records.sdk-compatibility.test.ts src/plugins/loader-records.test.ts src/plugins/loader.test.ts src/status/status-plugin-health.test.ts: passed (233 tests), including the id-formatting regression; the final recorder-only rerun passed all 16 tests.
  • pnpm build: passed, including Plugin SDK export verification; the subsequent formatter-only correction changes no imports or public types and is covered by focused tests.
  • pnpm check:changed: passed on the final source.
  • pnpm docs:list, formatting, and git diff --check: passed.
  • Independent Codex autoreview: scoped-clean through P2 on the final source, after serialized input verification.
  • CI recovery: the old merge checkout failed on an unrelated assertion repaired by fix(test): unblock CI after storage-failure regression assertion #139519 (merged as d5c9880). Native preparation confirmed the failed exact-head gate, so W2 was rebased onto repaired main without conflicts. git range-diff confirms all three commits remain patch-identical. Fresh exact-head CI is green: run 34000725024. One unrelated tooling test reported process-group cleanup failure; all seven cases passed locally, then one failed-job rerun passed on the unchanged head. Neither unrelated test was modified.
  • Rebased focused proof: 410 tests passed. A disk-full error interrupted the first run after 349 passing tests; the remaining 61 passed on retry after runner cleanup released space. Fresh independent Codex autoreview is scoped-clean through P2 on the rebased source. Native Testbox preparation completed for the exact head. Rebased pnpm check:changed passed in full using a task-local copy of the repository-pinned pnpm after the shared executable disappeared. git diff --check is clean; native Testbox preparation is complete.

Cumulative LOC: production +90/-91 (net -1); tests +168/-19 (net +149); docs +16/-0. All changes are maintainer-authored from the reported symptoms; no external contributor patch was incorporated.

@clawsweeper

clawsweeper Bot commented Sep 5, 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 commands Command implementations size: M maintainer Maintainer-authored PR labels Sep 5, 2026
@steipete
steipete marked this pull request as ready for review September 5, 2026 22:24
@steipete steipete self-assigned this Sep 5, 2026
@steipete

steipete commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper

clawsweeper Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 5, 2026, 8:20 PM ET / September 6, 2026, 00:20 UTC.

ClawSweeper review

What this changes

The PR adds actionable plugin SDK import diagnostics and makes Doctor detect outdated runtime plugins against the newly installed core version.

Merge readiness

⛔ Blocked before merge - 1 item remains

The PR remains useful: current main lacks both repairs, and no introduced correctness defect was found. Source inspection and the maintainer clarification resolve the previous migration concern.

Priority: P2
Reviewed head: 85002efc5c6ce9f39864f484e6e072aa859ae86e

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with meaningful regression coverage and no identified blocking defect.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer-authored PR is exempt from the external-contributor proof gate and introduces no material authority change. Its captured body reports isolated runtime inspection showing the SDK diagnostic; native-error fixtures and upgrade tests provide supplemental coverage.
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 is exempt from the external-contributor proof gate and introduces no material authority change. Its captured body reports isolated runtime inspection showing the SDK diagnostic; native-error fixtures and upgrade tests provide supplemental coverage.
Evidence reviewed 9 items Current main still needs the diagnostic repair: The fetched main recorder recognizes missing-module dependency hints but has no SDK import classification or compatibility details.
Latest release also retains the old behavior: Inspection of v2026.9.2 shows the old error recorder and Doctor's process-VERSION comparison; neither central repair is present in the supplied latest release.
Existing repair contract is preserved: Candidate detection now uses the same compatibility-host resolver already used by installation. The installer retains source selection, exact-selector handling, capability consent, and beforePersistentEffect callbacks; the patch changes no storage schema or record-commit implementation.
Findings None None.
Security None None.

How this fits together

The plugin loader turns module failures into diagnostics consumed by inspection, status, and Doctor. Post-update Doctor compares installed plugin metadata with the core version and selects repairs through the existing installer.

flowchart TD
  A[Plugin module import] --> B[Loader error recorder]
  B --> C[Inspection and Doctor diagnostics]
  D[Installed plugin metadata] --> E[Compare with updated core]
  F[Compatibility host version] --> E
  E --> G[Existing consent and installation flow]
Loading

Before merge

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

Security

None.

PR surface

Source -1, Tests +149, Docs +16. Total +164 across 13 files.

View PR surface stats
Area Files Added Removed Net
Source 8 90 91 -1
Tests 3 168 19 +149
Docs 2 16 0 +16
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 13 274 110 +164

Review metrics

None.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/commands/doctor/shared/missing-configured-plugin-install.candidates.ts, unknown-data-model-change: src/commands/doctor/shared/missing-configured-plugin-install.candidates.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Keep SDK repair guidance in the shared diagnostic recorder and use one compatibility-host version for Doctor's detection and installation decisions.

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

Yes, from source: current main compares installed runtime plugins with the old process VERSION even when post-update convergence supplies a newer compatibility host. The focused regression captures that mismatch; this review did not execute it.

Is this the best way to solve the issue?

Yes. The patch repairs the version input at candidate selection and extends the existing error recorder without adding a competing repair flow or changing SDK exports.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This is a bounded improvement to plugin failure diagnosis and post-update repair selection.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool 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 is exempt from the external-contributor proof gate and introduces no material authority change. Its captured body reports isolated runtime inspection showing the SDK diagnostic; native-error fixtures and upgrade tests provide supplemental coverage.

Evidence

What I checked:

  • Current main still needs the diagnostic repair: The fetched main recorder recognizes missing-module dependency hints but has no SDK import classification or compatibility details. (src/plugins/loader-records.ts:164, 75c7f919326d)
  • Latest release also retains the old behavior: Inspection of v2026.9.2 shows the old error recorder and Doctor's process-VERSION comparison; neither central repair is present in the supplied latest release. (src/commands/doctor/shared/missing-configured-plugin-install.candidates.ts:108, 3928bad9badf)
  • Existing repair contract is preserved: Candidate detection now uses the same compatibility-host resolver already used by installation. The installer retains source selection, exact-selector handling, capability consent, and beforePersistentEffect callbacks; the patch changes no storage schema or record-commit implementation. (src/commands/doctor/shared/missing-configured-plugin-install.install.ts:169, 85002efc5c6c)
  • Diagnostic compatibility and caller preservation: The recorder preserves an explicit channel-setup-failure code, suppresses import hints during validation, and adds optional SDK details to the existing diagnostic object. Caller inspection confirms record identity and origin come from the same candidate and manifest as before. (src/plugins/loader-records.ts:237, 85002efc5c6c)
  • Focused regression coverage: The new native-Node fixtures cover direct and wrapped missing exports, nested SDK subpaths, retained channel classification, and unsafe command identifiers. Doctor's added case makes the installed plugin equal the old process version while the compatibility host is newer. These tests were inspected, not executed in this read-only review. (src/plugins/loader-records.sdk-compatibility.test.ts:15, 85002efc5c6c)
  • Prior review concern and reported validation: The supplied maintainer comment explicitly explains why this is an existing repair-selection correction rather than a persistent-data-model change. The captured PR body reports 111 repair tests, an isolated runtime inspection displaying the new diagnostic, and 410 rebased focused test executions. These are contributor-reported results, not reviewer executions. (85002efc5c6c)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Josh Lehman: 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 (4 earlier review cycles)
  • reviewed 2026-09-05T22:31:36.872Z sha 10c2918 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-05T23:04:43.777Z sha 10c2918 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-05T23:24:45.202Z sha e5cb283 :: blocked before merge. :: none
  • reviewed 2026-09-05T23:45:23.770Z sha e5cb283 :: blocked before merge. :: none

@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 Sep 5, 2026
@steipete

steipete commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

Maintainer verification of the data-model note: this diff adds no SQLite schema, storage format, retention, indexing, concurrency, or recovery changes. The Doctor change corrects the version input used to select an existing package repair; the installation, consent, selector-preservation, and record-commit flows are unchanged. The optional SDK information is attached to the existing runtime diagnostic channel.

Upgrade compatibility is covered by the 111 passing configured-plugin repair tests, including the new old-process/new-core case, explicit and floating selector behavior, beta convergence, preservation of newer installed packages, and capability-consent behavior. The new regression failed before the detection fix and passes afterward. I consider the automated persistent-data-model classification inapplicable to this patch.

The current merge blocker is CI run 33998298926. Its merge checkout includes a main-branch test regression in src/agents/embedded-agent-runner/run/assistant-failure.test.ts:273: the storage-failure test asserts on the removed failover.maybeRetryTransient spy. This causes both check-test-types-core-1 (TS2339) and checks-node-compact-large-9 (undefined spy) to fail. W2 does not modify that file. The assertion was added in #139409 after the controller refactor in #139410, and remains in main at 67e8e2da4b10a7db00a36f39e77537ed3a2ea91a.

Holding the merge until that separate main repair and fresh exact-head CI are available.

Post-update repair now uses the newly installed compatibility host version for both candidate detection and installation, so an updater still running old code refreshes stale configured runtime plugins. Preserve existing selector, consent, and newer-package behavior.
Annotate native SDK import failures through the existing registry diagnostic channel with the imported seam, core/build versions, and repair guidance. Preserve channel health classifications and raw-error suppression in model responses. Consolidate validation error recording and redundant formatting wrappers to keep production code net-negative across the repair.
@steipete
steipete force-pushed the codex/plugin-core-skew branch from e5cb283 to 85002ef Compare September 6, 2026 00:13
@steipete

steipete commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

Final head: 85002ef.

#139519 merged, and native preparation confirmed the failed old-head CI gate before W2 was rebased onto repaired main. The rebase had no conflicts; all three commits are patch-identical. The unrelated assertion file was not changed.

Rebased proof: 410 focused tests passed, full pnpm check:changed passed, and fresh independent Codex review is clean through P2. Exact-head CI run 34000725024 is green. One unrelated tooling process-cleanup failure passed its seven local tests and a single failed-job rerun on the unchanged head. Native Testbox preparation completed successfully. A local disk-full interruption and disappearance of the shared pnpm executable were resolved without changing source, project dependencies, or test assertions.

The remaining automated data-model compatibility checkbox is inapplicable: candidate selection uses the same compatibility-host resolver as the existing installer; no schema, stored record, migration, or installer commit semantics changed. All 111 Doctor repair tests pass, including the regression where the loaded process version is older than the new core. The current ClawSweeper technical review confirms that contract and reports no actionable correctness or security findings.

Production +90/-91 (net -1); tests +168/-19 (net +149); docs +16/-0. No additional PRs.

@steipete
steipete merged commit 1d9ce1a into main Sep 6, 2026
308 of 310 checks passed
@steipete
steipete deleted the codex/plugin-core-skew branch September 6, 2026 01:11
@steipete

steipete commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 6, 2026
* origin/main: (302 commits)
  test(gateway): preserve held-work close failures (#139593)
  refactor(exec): share package argument scanning (#139560)
  fix(audit): preserve sequence range validation before numeric decoding (#139587)
  fix(transcripts): retain capture ownership through failed cleanup (#139572)
  refactor(models): share selector reference traversal (#139571)
  perf(agents): classify allowlists without intermediate sets (#138392)
  chore(release): update appcast for 2026.9.2 (#139575)
  fix(ci): synchronize cloud retries and board widget input (#139506)
  fix(plugins): explain SDK incompatibilities after core updates (#139458)
  fix(voice-call): retain installed WebSocket behavior under Bun (#139567)
  test(text): consolidate literal sanitizer cases (#139579)
  test(gateway): observe native drain without a lint exception (#139576)
  test(memory): consolidate visibility fixtures without policy defaults (#139569)
  fix(ui): show shimmer skeletons while loading Control UI (#139525)
  test(qa): make cleanup child logging deterministic (#139566)
  test(cli): keep Unix socket fixtures within path limits (#139565)
  fix: avoid slow incognito key checks in large session stores (#139528)
  feat(macos): open Gateway windows from the Gateways menu (#139522)
  test(workshop): isolate marker casing fixture identities (#139554)
  fix(process): require cleanup evidence before releasing owned work (#139517)
  ...

# Conflicts:
#	scripts/release-check.ts
vincentkoc added a commit that referenced this pull request Sep 6, 2026
* commit '047587a542ce205ee78354fbd88ba8ec05c07844': (45 commits)
  chore(ui): refresh control ui locales (#139481)
  fix(slack): keep prototype-named emoji shortcodes intact (#136374)
  fix(gateway): deliver upgrade rejection responses under Bun (#139516)
  refactor(test): simplify catalog guards and fix native report fixture (#139496)
  fix(macos): prevent dashboard fixture loopback timeouts (#139556)
  fix(matrix): preserve selected reply targets inside threads (#139479)
  test(gateway): preserve held-work close failures (#139593)
  refactor(exec): share package argument scanning (#139560)
  fix(audit): preserve sequence range validation before numeric decoding (#139587)
  fix(transcripts): retain capture ownership through failed cleanup (#139572)
  refactor(models): share selector reference traversal (#139571)
  perf(agents): classify allowlists without intermediate sets (#138392)
  chore(release): update appcast for 2026.9.2 (#139575)
  fix(ci): synchronize cloud retries and board widget input (#139506)
  fix(plugins): explain SDK incompatibilities after core updates (#139458)
  fix(voice-call): retain installed WebSocket behavior under Bun (#139567)
  test(text): consolidate literal sanitizer cases (#139579)
  test(gateway): observe native drain without a lint exception (#139576)
  test(memory): consolidate visibility fixtures without policy defaults (#139569)
  fix(ui): show shimmer skeletons while loading Control UI (#139525)
  ...
vincentkoc added a commit that referenced this pull request Sep 6, 2026
* commit 'refs/openclaw/tasks/pr-135167-main': (2467 commits)
  refactor(ios): reuse shared integer conversion (#139581)
  fix(sessions): prevent database lock failures during reclamation (#139469)
  perf(test): reuse transforms within owned scheduler slots (#139553)
  test(agents): share sparse transcript input fixtures (#139589)
  chore(ui): refresh control ui locales (#139481)
  fix(slack): keep prototype-named emoji shortcodes intact (#136374)
  fix(gateway): deliver upgrade rejection responses under Bun (#139516)
  refactor(test): simplify catalog guards and fix native report fixture (#139496)
  fix(macos): prevent dashboard fixture loopback timeouts (#139556)
  fix(matrix): preserve selected reply targets inside threads (#139479)
  test(gateway): preserve held-work close failures (#139593)
  refactor(exec): share package argument scanning (#139560)
  fix(audit): preserve sequence range validation before numeric decoding (#139587)
  fix(transcripts): retain capture ownership through failed cleanup (#139572)
  refactor(models): share selector reference traversal (#139571)
  perf(agents): classify allowlists without intermediate sets (#138392)
  chore(release): update appcast for 2026.9.2 (#139575)
  fix(ci): synchronize cloud retries and board widget input (#139506)
  fix(plugins): explain SDK incompatibilities after core updates (#139458)
  fix(voice-call): retain installed WebSocket behavior under Bun (#139567)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 6, 2026
…law#139458)

* fix(doctor): detect stale runtime plugins against updated core

Post-update repair now uses the newly installed compatibility host version for both candidate detection and installation, so an updater still running old code refreshes stale configured runtime plugins. Preserve existing selector, consent, and newer-package behavior.

* fix(plugins): explain incompatible SDK imports

Annotate native SDK import failures through the existing registry diagnostic channel with the imported seam, core/build versions, and repair guidance. Preserve channel health classifications and raw-error suppression in model responses. Consolidate validation error recording and redundant formatting wrappers to keep production code net-negative across the repair.

* test(doctor): keep version-skew fixture ahead of the running core
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 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: 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