fix(extensions): use dist/ import paths for bundled extensions#20415
Closed
88plug wants to merge 1 commit intoopenclaw:mainfrom
Closed
fix(extensions): use dist/ import paths for bundled extensions#2041588plug wants to merge 1 commit intoopenclaw:mainfrom
88plug wants to merge 1 commit intoopenclaw:mainfrom
Conversation
…dled extensions Bundled extensions (twitch, llm-task) imported runtime values from src/ paths that don't exist in npm/brew-installed builds. This caused module-not-found errors for all non-source-checkout users. - twitch/token.ts: import DEFAULT_ACCOUNT_ID/normalizeAccountId from dist/plugin-sdk/index.js instead of src/routing/session-key.js - llm-task/llm-task-tool.ts: fallback import of runEmbeddedPiAgent from dist/extensionAPI.js instead of duplicate src/ path (copy-paste bug) Type-only imports (import type) are unchanged — they are erased at compile time and cause no runtime errors.
47fefe7 to
f3e9abf
Compare
Author
|
@obviyus Would you mind taking a look? Tiny fix (+14/-6) — two bundled extensions have broken runtime imports that crash on npm/brew installs. Addresses Greptile's feedback and closes 3 open issues. |
18 tasks
3 tasks
|
+1 — this has been broken for us across three gateways since 2026.2.21. Local patch on line 28 confirms the fix works. Would love to see this merged. |
|
This pull request has been automatically marked as stale due to inactivity. |
|
Closing due to inactivity. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
twitchandllm-task) import runtime values from../../../src/paths that don't exist in npm/brew-installed builds, causingCannot find moduleerrorsopenclaw/plugin-sdk/account-idalias for twitch,dist/extensionAPI.jsdynamic fallback for llm-task)import typestatements still point tosrc/— these are erased at compile time and cause no runtime errors. No behavior, config, or API changes.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
llm-tasktool works on npm/brew installs (was failing with "Cannot find module")Security Impact (required)
NoNoNoNoNoRepro + Verification
Environment
Steps
npm install -g openclaw@latestllm-tasktoolCannot find module '../../../src/routing/session-key.js'(twitch) orCannot find module '../../../src/agents/pi-embedded-runner.js'(llm-task)Expected
Actual
Evidence
Error logs from issues #19053, #18846, #16182 all show identical
Cannot find moduleerrors. After fix: both extensions load without errors.Root cause in
llm-task-tool.ts— the "fallback" import path (line 28) is identical to the primary path (line 17). Both try../../../src/agents/pi-embedded-runner.js. This is a copy-paste bug. The correct fallback isdist/extensionAPI.jswhich exportsrunEmbeddedPiAgent.Root cause in
token.ts— static import from../../../src/routing/session-key.jswhich doesn't exist in production builds. Theopenclaw/plugin-sdk/account-idalias re-exports the same symbols and resolves correctly in both dev and production.Human Verification (required)
dist/plugin-sdk/index.jsexportsDEFAULT_ACCOUNT_IDandnormalizeAccountId; confirmeddist/extensionAPI.jsexportsrunEmbeddedPiAgent; confirmedimport typestatements are erased at compile time. Both extensions load and initialize successfully after the fix.openclaw/plugin-sdk/account-idalias resolves via package.json exports at runtime and tsconfig paths at type-check timeCompatibility / Migration
YesNoNoFailure Recovery (if this breaks)
git revert <commit>extensions/twitch/src/token.ts,extensions/llm-task/src/llm-task-tool.tsplugin-sdk/account-idordist/extensionAPIRisks and Mitigations
openclaw/plugin-sdk/account-idalias ordist/extensionAPI.jscould be renamed in a future refactorNote: The same
src/-import pattern may affect other extensions (see #15686 which reports memory-core, telegram, voice-call, whatsapp). A follow-up lint rule to flag non-type imports fromsrc/inextensions/could prevent recurrence.AI-assisted
This PR was AI-assisted. The code is understood, tested, and verified against the live codebase.