Skip to content

fix(plugin-sdk): keep published pre-split plugin imports loading after upgrade - #124086

Merged
steipete merged 2 commits into
mainfrom
codex/autoqa-sdk-shipped-exports
Aug 15, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/autoqa-sdk-shipped-exports

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Installed official plugins break after a core upgrade because published npm artifacts import SDK names at module top level that recent refactors removed from the barrels — the same bug class as #124041, verified against the actual published tarballs (@openclaw/{voice-call,matrix,whatsapp,slack}@2026.7.2-beta.7):

  • voice-call + matrix doctor contracts import archiveLegacyStateSource, detectOpenClawStateDatabaseSchemaMigrations, repairOpenClawStateDatabaseSchema, detectPluginInstallPathIssue, formatPluginInstallPathIssue, removePluginFromConfig, and createPluginStateSyncKeyedStore from openclaw/plugin-sdk/runtime-doctor — those names moved to doctor-repair-runtime, so the contract module fails to load and the plugin's doctor migrations silently never run (worst bug class: no visible outcome, no recorded reason).
  • whatsapp imports shouldAckReactionForWhatsApp from openclaw/plugin-sdk/channel-feedback — owner policy moved in-plugin by refactor(channels): move owner policy into plugins #121257, so the installed channel fails to load outright.
  • slack imports resolveChannelProgressDraftRender from openclaw/plugin-sdk/channel-outbound — the render key was retired by refactor(config): retire dead streaming.progress.render key #122927, so the installed channel fails to load outright.

Why This Change Was Made

Shipped external Plugin SDK API gets compat-first treatment per repo doctrine: deprecated load-only bridges with a named removal window ("once managed releases have replaced the old npm latest/extended-stable packages and their upgrade window has closed"), not silent breakage. Behavior is preserved verbatim from the pre-move owners (whatsapp gate semantics delegate to the shared shouldAckReaction gate; slack render reads the retired key pre-doctor and defaults to "text"). Current source keeps importing the canonical modules directly — the bridges are load-only.

User Impact

Operators upgrading core while running installed (non-bundled) voice-call, matrix, whatsapp, or slack plugins no longer hit plugin load failures or silently-skipped doctor migrations.

Evidence

  • Verified the exact import shapes by unpacking the published npm tarballs (npm pack @openclaw/<pkg>@2026.7.2-beta.7) and grepping their dist imports.
  • New loader regression fixture (src/plugins/loader.native-module-loader.test.ts) loads a plugin using the published import shapes across all three subpaths — fails without the bridges (verified via stash), passes with them.
  • New behavior locks in src/plugin-sdk/shipped-export-bridges.test.ts (whatsapp gate truth table, slack render default/passthrough/junk).
  • Contract test src/plugins/contracts/plugin-sdk-subpaths.test.ts updated: barrel now intentionally mentions the bridged names; owner-file omits assertions kept.
  • SDK surface budgets bumped with named comments in scripts/plugin-sdk-surface-report.mts (precedent: fix(plugin-sdk): installed llama providers fail to load after upgrade #124041, refactor(config): retire dead streaming.progress.render key #122927); pnpm plugin-sdk:surface:check green.
  • pnpm tsgo, pnpm check:test-types, focused vitest (loader + bridges + contracts) all green; autoreview clean (0.97).

Production LOC: +112 (all deprecated bridge surface with named removal window — shipped-contract capability, not growth in canonical paths); tests +138.

…r upgrade

Same bug class as #124041: published plugin artifacts import SDK names at
module top level, so removing them from the barrel makes the installed
plugin fail to load (voice-call/matrix doctor contracts silently never run
their migrations; whatsapp and slack channels fail outright) after a core
upgrade. Verified against the actual npm tarballs (2026.7.2-beta.7):

- openclaw/plugin-sdk/runtime-doctor: voice-call + matrix doctor contracts
  import repair names (archiveLegacyStateSource, detect/repair state DB
  schema, plugin install-path repair, removePluginFromConfig,
  createPluginStateSyncKeyedStore) that moved to doctor-repair-runtime.
- openclaw/plugin-sdk/channel-feedback: whatsapp imports
  shouldAckReactionForWhatsApp (owner policy moved in-plugin by #121257).
- openclaw/plugin-sdk/channel-outbound: slack imports
  resolveChannelProgressDraftRender (render key retired by #122927).

Adds deprecated load-only bridges with named removal windows, bumps the
SDK surface budgets with comments, and locks behavior with unit tests
plus a loader fixture that fails without the bridges.
@clawsweeper

clawsweeper Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete
steipete marked this pull request as ready for review August 15, 2026 07:21
@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: M maintainer Maintainer-authored PR labels Aug 15, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. 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 15, 2026
@clawsweeper

clawsweeper Bot commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed August 15, 2026, 3:47 AM ET / 07:47 UTC.

ClawSweeper review

What this changes

The PR restores deprecated Plugin SDK exports so published voice-call, Matrix, WhatsApp, and Slack packages can load after an OpenClaw upgrade.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 5 items remain

Keep open: the compatibility bridges address a real upgrade break, but the proposed regression coverage misses the doctor-contract loader where the voice-call and Matrix failure occurs.

Priority: P1
Reviewed head: 7d35cf4b2d6f902282e77b239d12ae8fde459d30
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The bridge is narrowly scoped, but the reported doctor-contract boundary lacks direct regression coverage.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored SDK compatibility repair is exempt from the external-contributor proof gate; its focused loader and package-artifact claims remain useful supplemental evidence.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored SDK compatibility repair is exempt from the external-contributor proof gate; its focused loader and package-artifact claims remain useful supplemental evidence.
Evidence reviewed 6 items Current missing export surface: Current main exposes only migration helpers from the legacy runtime-doctor facade, while the PR adds the repair exports required by older published contracts.
Actual doctor-contract boundary: The dedicated test fixture evaluates dist/doctor-contract-api.js through the doctor-contract registry, which is the reported voice-call and Matrix failure path.
Changed fixture covers a different entry point: The new fixture places all legacy imports in dist/index.js and calls the ordinary plugin loader, so it does not exercise discovery of a doctor-contract module.
Findings 1 actionable finding [P2] Cover the doctor-contract loader path
Security None None.

How this fits together

Installed plugins resolve public Plugin SDK subpaths while their runtime and doctor-contract modules load. Those exports determine whether a plugin can register normally and whether its doctor migrations can be discovered.

flowchart LR
  A[Published plugin package] --> B[Plugin or doctor-contract loader]
  B --> C[Plugin SDK subpath]
  C --> D[Compatibility bridge]
  D --> E[Current SDK owner]
  E --> F[Plugin registration or doctor migration]
Loading

Decision needed

Question Recommendation
Should OpenClaw retain these deprecated public SDK exports until a documented reader sweep confirms that supported published official packages no longer import them? Retain with an observed reader condition: Keep the bridges and record the exact affected package versions plus a zero-reader published-package sweep as the removal condition.

Why: The bridge intentionally reverses recent SDK-surface removals for existing installed packages, and its safe removal point depends on the supported-package policy rather than a code-only condition.

Before merge

  • Cover the doctor-contract loader path (P2) - Late finding: this fixture is unchanged since the prior reviewed head. The reported voice-call/Matrix failure occurs while the doctor registry evaluates doctor-contract-api.js, but this new test places those imports in index.js and only calls the normal plugin loader. Extend the existing doctor-contract registry fixture with these repair imports so the migration-discovery boundary cannot regress while regular plugin loading still passes.
  • Resolve merge risk (P1) - The bridge deliberately makes legacy doctor-contract imports reach repair/state code that current source keeps lazy; retain it only until a recorded published-package reader sweep proves the affected official packages no longer import these names.
  • Resolve merge risk (P1) - The review environment could not independently reopen historical blobs or registry tarballs because outbound GitHub access failed; the precise published import contract therefore still needs the PR’s claimed package-artifact evidence to remain available to maintainers.
  • Complete next step (P2) - A maintainer must accept the public compatibility lifetime and ensure the protected PR adds regression coverage at the doctor-contract boundary.

Findings

  • [P2] Cover the doctor-contract loader path — src/plugins/loader.native-module-loader.test.ts:168-183
Agent review details

Security

None.

PR surface

Source +79, Tests +171, Other +14. Total +264 across 8 files.

View PR surface stats
Area Files Added Removed Net
Source 3 79 0 +79
Tests 4 176 5 +171
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 18 4 +14
Total 8 273 9 +264

Review metrics

Metric Value Why it matters
Production versus test delta production +79, tooling +14, tests +171 The production growth is a public compatibility surface; the test growth should prove each affected runtime boundary before merge.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/plugin-sdk/runtime-doctor.test.ts, migration/backfill/repair: src/plugin-sdk/runtime-doctor.ts, migration/backfill/repair: src/plugins/loader.native-module-loader.test.ts, serialized state: src/plugins/loader.native-module-loader.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Cover the doctor-contract loader (recommended)
    Extend the existing doctor-contract registry fixture with the voice-call and Matrix runtime-doctor import set, then rerun exact-head validation.
  2. Accept a bounded legacy bridge
    Maintain the bridge until a documented published-package reader sweep verifies that the affected imports have disappeared.

Technical review

Best possible solution:

Keep narrowly named load-only exports until a recorded official-package reader sweep is clean, and protect the actual doctor-contract loader path with a regression fixture.

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

No high-confidence live reproduction was run in this read-only review; source establishes the missing named exports and the dedicated doctor-contract loader boundary, but registry tarballs were not reachable from this environment.

Is this the best way to solve the issue?

Yes, preserving exact named exports is the source-compatible repair for installed packages, provided the doctor-contract registry path receives the missing regression coverage and the removal condition is made observable.

Full review comments:

  • [P2] Cover the doctor-contract loader path — src/plugins/loader.native-module-loader.test.ts:168-183
    Late finding: this fixture is unchanged since the prior reviewed head. The reported voice-call/Matrix failure occurs while the doctor registry evaluates doctor-contract-api.js, but this new test places those imports in index.js and only calls the normal plugin loader. Extend the existing doctor-contract registry fixture with these repair imports so the migration-discovery boundary cannot regress while regular plugin loading still passes.
    Confidence: 0.96
    Late finding: first raised on code an earlier review cycle already covered.

Overall correctness: patch is incorrect
Overall confidence: 0.92

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This maintainer-authored SDK compatibility repair is exempt from the external-contributor proof gate; its focused loader and package-artifact claims remain useful supplemental evidence.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.
  • remove status: 👀 ready for maintainer look: Current PR status label is status: ⏳ waiting on author.

Label justifications:

  • P1: Published plugins can fail to load or skip doctor migrations after operators upgrade core.
  • merge-risk: 🚨 compatibility: The PR restores deprecated public Plugin SDK exports for already-published external packages.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This maintainer-authored SDK compatibility repair is exempt from the external-contributor proof gate; its focused loader and package-artifact claims remain useful supplemental evidence.

Evidence

What I checked:

Likely related people:

  • steipete: Authored the merged channel-policy and progress-render refactors that removed the affected SDK exports, and authored this compatibility repair. (role: feature-history owner; confidence: high; commits: 0efd5b4bc9bb, 4d54c3f1a1d5; files: src/plugin-sdk/channel-feedback.ts, src/plugin-sdk/channel-outbound.ts, src/plugin-sdk/runtime-doctor.ts)
  • fuller-stack-dev: Authored the immediately preceding merged Plugin SDK compatibility repair for released package imports. (role: adjacent compatibility contributor; confidence: medium; commits: a02ed2cfda80; files: src/plugins/loader.native-module-loader.test.ts)

Rank-up moves

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

  • Add the published runtime-doctor import set to the doctor-contract registry fixture.
  • Refresh exact-head checks after the regression test is added.
  • Record the package-reader sweep that defines bridge removal.

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-15T07:30:02.146Z sha 437b2b3 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added 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. and removed 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 15, 2026
@steipete
steipete merged commit c83c3bc into main Aug 15, 2026
191 checks passed
@steipete
steipete deleted the codex/autoqa-sdk-shipped-exports branch August 15, 2026 08:05
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 16, 2026
…r upgrade (openclaw#124086)

* fix(plugin-sdk): keep published pre-split plugin imports loading after upgrade

Same bug class as openclaw#124041: published plugin artifacts import SDK names at
module top level, so removing them from the barrel makes the installed
plugin fail to load (voice-call/matrix doctor contracts silently never run
their migrations; whatsapp and slack channels fail outright) after a core
upgrade. Verified against the actual npm tarballs (2026.7.2-beta.7):

- openclaw/plugin-sdk/runtime-doctor: voice-call + matrix doctor contracts
  import repair names (archiveLegacyStateSource, detect/repair state DB
  schema, plugin install-path repair, removePluginFromConfig,
  createPluginStateSyncKeyedStore) that moved to doctor-repair-runtime.
- openclaw/plugin-sdk/channel-feedback: whatsapp imports
  shouldAckReactionForWhatsApp (owner policy moved in-plugin by openclaw#121257).
- openclaw/plugin-sdk/channel-outbound: slack imports
  resolveChannelProgressDraftRender (render key retired by openclaw#122927).

Adds deprecated load-only bridges with named removal windows, bumps the
SDK surface budgets with comments, and locks behavior with unit tests
plus a loader fixture that fails without the bridges.

* test(plugin-sdk): cover the repair bridge in the runtime-doctor facade surface lock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: M status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant