-
-
Notifications
You must be signed in to change notification settings - Fork 69.5k
Windows: Feishu channel fails with 'Feishu runtime not initialized' #50251
Copy link
Copy link
Open
Description
Problem
On Windows, the Feishu channel fails to start with error 'Feishu runtime not initialized'.
Root Cause
When jiti loads the Feishu plugin, runtime.ts is loaded twice via different import paths:
- index.ts imports from ./src/runtime.js
- channel.ts imports from ./runtime
Even though these resolve to the same file, jiti caches them as separate module instances, creating two separate closures with different runtime stores. The setRuntime is called on one instance, but getRuntime reads from another.
Suggested Fix
Use a global variable to share the runtime store across all jiti module instances:
declare global {
var __feishuRuntimeStore: ReturnType<typeof createPluginRuntimeStore<PluginRuntime>> | undefined;
}
if (!globalThis.__feishuRuntimeStore) {
globalThis.__feishuRuntimeStore = createPluginRuntimeStore<PluginRuntime>('Feishu runtime not initialized');
}
const _store = globalThis.__feishuRuntimeStore;Environment
- OS: Windows
- Node.js version: 22+
- OpenClaw version: latest
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Fields
Give feedbackNo fields configured for issues without a type.