Repository navigation
fix(plugin-sdk): published plugins fail to load after private SDK facade exports were removed - #173777
Conversation
…ade exports were removed Restore the runtime named exports that published external plugins import from JavaScript-only openclaw/plugin-sdk facades, which #164816 removed while the subpaths still ship. Each restored name is deprecated and tracked by the plugin-sdk-private-runtime-shipped-exports compat record (removeAfter 2027-01-15); a contract test keeps every recorded surface exported. Fixes #173386
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesRestores 29 deprecated named exports across 14 shipped Plugin SDK runtime subpaths. Example: Load [email protected] on a 2026.10.5 beta.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR repairs a verified plugin-loading regression that remains on main, with no blocking findings. Priority: P1 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Plugin SDK connects installed plugin imports to core runtime owners; missing named exports fail module linking before plugin registration. flowchart LR
A[Installed plugin] --> B[Package subpath exports]
B --> C[SDK runtime facade]
C --> D[Existing implementation owner]
C --> E[Plugin module linking]
E --> F[Plugin registration]
Technical reviewBest possible solution: Restore the demonstrated shipped imports through existing owners and retain the documented deprecation window. Do we have a high-confidence way to reproduce the issue? Stable source exports the reported name, the reviewed removal deletes it, and current main still omits it; the reporter supplies the corresponding runtime linking error. Is this the best way to solve the issue? The focused restoration preserves existing owners and the lazy auth boundary while giving demonstrated external consumers a dated migration window. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7a3cfbf8def9. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +180, Tests +65, Docs +14, Other +1. Total +260 across 21 files. Added test files: 1. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReviewed October 16, 2026, 12:40 AM ET / 04:40 UTC (Revision 3). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
…ade exports were removed (#173777) * fix(plugin-sdk): published plugins fail to load after private SDK facade exports were removed Restore the runtime named exports that published external plugins import from JavaScript-only openclaw/plugin-sdk facades, which #164816 removed while the subpaths still ship. Each restored name is deprecated and tracked by the plugin-sdk-private-runtime-shipped-exports compat record (removeAfter 2027-01-15); a contract test keeps every recorded surface exported. Fixes #173386 * fix(plugin-sdk): include private runtime export record in PR wrapper inventory (cherry picked from commit 970fc2f)
…ade exports were removed (#173777) * fix(plugin-sdk): published plugins fail to load after private SDK facade exports were removed Restore the runtime named exports that published external plugins import from JavaScript-only openclaw/plugin-sdk facades, which #164816 removed while the subpaths still ship. Each restored name is deprecated and tracked by the plugin-sdk-private-runtime-shipped-exports compat record (removeAfter 2027-01-15); a contract test keeps every recorded surface exported. Fixes #173386 * fix(plugin-sdk): include private runtime export record in PR wrapper inventory (cherry picked from commit 970fc2f)
…ade exports were removed (openclaw#173777) * fix(plugin-sdk): published plugins fail to load after private SDK facade exports were removed Restore the runtime named exports that published external plugins import from JavaScript-only openclaw/plugin-sdk facades, which openclaw#164816 removed while the subpaths still ship. Each restored name is deprecated and tracked by the plugin-sdk-private-runtime-shipped-exports compat record (removeAfter 2027-01-15); a contract test keeps every recorded surface exported. Fixes openclaw#173386 * fix(plugin-sdk): include private runtime export record in PR wrapper inventory
Fixes #173386
What Problem This Solves
Fixes: published plugins fail to load on 2026.10.5 betas when they import a named helper that #164816 dropped from a JavaScript-only
openclaw/plugin-sdk/*subpath. The subpath still ships inpackage.jsonexports, so subpath-level compatibility checks pass, but ESM linking fails on the missing name and the whole plugin (for example the community Zulip channel) stops loading.User Impact
Plugins built against 2026.10.4 and earlier that import these names load again. The restored names are deprecated through 2027-01-15 (
plugin-sdk-private-runtime-shipped-exports), so plugin authors have a migration window instead of a silent break.Why This Change Was Made
#164816 ("deslop private runtime exports") removed 222 runtime names from 54 shipped subpaths compared with 2026.10.4 (npm tarball export diff). The typed-subpath removals already have dated compat records and the shipped-surface guard covers them. The rest come from JavaScript-only facades (no
typescondition), which the repo classes as not a typed third-party contract, so no guard caught them.Restoring all ~200 would undo deliberate cleanup and bring back deleted internals. Instead, I searched GitHub code for each removed name with its subpath and kept only names that standalone external plugins actually import, plus the reported one. Each restored name is a re-export of a live owner, marked
@deprecatedand listed in one compat record. Two implementations come back verbatim from403b0ced4f6^:createRateLimitRetryRunnerand the lazyresolveApiKeyForProvider.Restored (29 names, 14 subpaths), with example external importers:
approval-reaction-runtimereadApprovalReactionDeliveryMetadataacp-runtimegetAcpRuntimeBackendfetch-runtimehasEnvHttpProxyConfiguredimage-generation-coreresolveApiKeyForProvider,resolveAgentModelPrimaryValuememory-core-host-engine-embeddingsfetchRemoteEmbeddingVectors,listMemoryEmbeddingProvidersmemory-core-host-engine-storagechunkMarkdown,ensureDirmemory-core-host-runtime-fileslistMemoryFiles,normalizeExtraMemoryPathspoll-runtimeresolvePollMaxSelectionsprovider-streamcreateOpenRouterSystemCacheWrapper,resolveMoonshotThinkingTypeprovider-web-fetchenablePluginInConfig,jsonResult,withTrustedWebToolsEndpoint,wrapExternalContent,wrapWebContentprovider-web-searchDEFAULT_TIMEOUT_SECONDS,markdownToText,setScopedCredentialValue,setTopLevelCredentialValueretry-runtimecreateRateLimitRetryRunnerspeechreadResponseTextLimited,truncateErrorDetailthread-bindings-runtimeresolveThreadBindingConversationIdFromBindingId,resolveThreadBindingFarewellText,resolveThreadBindingLifecycleRelease-note material: still removed in 2026.10.5. I found no standalone external importer for these runtime names, so they stay removed:
acp-runtime__testing,requireAcpRuntimeBackendapproval-reaction-runtimeinsertApprovalReactionHintNearIdHeaderbrowser-configdefaults and resolverschannel-config-writes,channel-route,channel-targetshelperscontext-visibility-runtime,directory-config-runtime,global-singleton.createScopedExpiringIdCacheimage-generation-core,memory-core-host-*,provider-stream(-family),realtime-voice(-activation),sandbox,speechandsession-key-runtimehelpersprovider-auth-api-key.upsertAuthProfile(used by zero-token forks) is also intentionally not restored. It is a synchronous credential writer that the SQLite worker ratchet rejects. UseupsertAuthProfileWithLockfrom the same subpath instead. The typed-subpath removals already haveremovedcompat records. To regenerate the full per-name list, diff thedist/plugin-sdk/*.jsexport names ofnpm pack [email protected]against[email protected].Evidence
src/plugin-sdk/private-runtime-shipped-exports.test.ts: checks that every surface in the compat record is a packaged private runtime subpath and still exports the name. It also importsreadApprovalReactionDeliveryMetadatafromopenclaw/plugin-sdk/approval-reaction-runtimeand exercises it. With the re-export removed, both tests fail (readApprovalReactionDeliveryMetadata is not a function, plus the missing surface). With the fix they pass.pnpm test src/plugin-sdk/private-runtime-shipped-exports.test.ts --maxWorkers=1: tests take 13 ms; wall time about 25 s, mostly cold transform.Real plugin-loader proof (
openclaw plugins doctor, which imports plugin modules). The test plugin is a synthetic external one built fromopenclaw plugins init, with a plain JSdist/index.jsthat named-imports all 29 restored exports from theiropenclaw/plugin-sdk/*package specifiers. It was installed withopenclaw plugins install --linkinto an isolatedOPENCLAW_STATE_DIR/OPENCLAW_CONFIG_PATH, andnode_modules/openclawwas linked to this branch's built package:Packaged proof against the published affected plugin, using the built
distof this branch (pnpm build). The script reads every namedopenclaw/plugin-sdk/*runtime import out of the published[email protected]dist withes-module-lexer(no plugin code runs). It then links exactly those names against this build'spackage.jsonexport targets:The same dist link check covers every surface in the compat record:
pnpm check:changed: all lanes this change touches pass: typecheck core/extensions, Plugin SDK package exports, surface budget, deprecated JSDoc/API usage, line-cap, SQLite worker ratchet and lint. Lanes still red are in files this PR does not touch, fromorigin/mainadvancing past the merge base:model-request-body.test.tsTS2540, thechat-message.test.tsxmax-lines suppression, and unused exports inlazy-view-error.ts/restart-resume.ts.src/plugins/compat/registry.test.tspasses.