aitoearn 插件与 OpenClaw 2026.5.26 兼容性问题报告
Self Checks
- I have read the Contributing Guide.
- I have searched for existing issues search for existing issues, including closed ones.
- I can provide the report in English if needed to help more contributors participate in the discussion.
- Please do not modify this template :) and fill in all the required fields.
Aitoearn version
1.0.23
Please select your platform
Windows
Steps to reproduce
aitoearn 插件与 OpenClaw 2026.5.26 兼容性问题报告
环境信息
| 项目 | 值 |
|---|---|
| OpenClaw 版本 | 2026.5.26 (10ad3aa) |
| aitoearn 插件版本 | @aitoearn/[email protected] |
| Node.js | v24.6.0 (Windows) |
| 安装方式 | npx -y @aitoearn/openclaw-plugin-cli |
问题现象
插件安装时能正常连接并发现 109 个工具(Connected! Found 109 tools.),但重启 OpenClaw 网关后,aitoearn 的工具完全不出现,AI Agent 无法看到 getAiToEarnEnvironment、listTaskMarket 等工具。
网关启动日志始终显示 7 个已加载插件(不含 aitoearn):
http server listening (7 plugins: canvas, device-pair, file-transfer, memory-core, openclaw-qqbot, phone-control, talk-voice)根因分析
1. 缺少 preload.cjs 入口
OpenClaw 2026.5.26 的插件自动发现机制通过扫描 ~\.openclaw\npm\node_modules\ 下的 preload.cjs 文件来发现和加载非内置插件。
- qqbot 插件(正常工作):
@tencent-connect/openclaw-qqbot在根目录提供了preload.cjs,package.json中openclaw.extensions指向"./preload.cjs" - aitoearn 插件(无法加载):只有
package.json中openclaw.extensions指向"./dist/runtime/index.js"(ESM 模块),没有preload.cjs
2. openclaw 列为 devDependencies 而非 dependencies
插件的 package.json 中 openclaw 被声明为 devDependencies:
"devDependencies": {
"openclaw": ">=2026.3.24"
}但 dist/runtime/src/tool-discovery-worker.js 在运行时需要 import from openclaw。由于插件安装到用户目录 ~\.openclaw\npm\ 时不会安装 devDependencies,导致 Worker 线程报错:
Cannot find package 'openclaw' imported from ...tool-discovery-worker.jsqqbot 插件通过在 preload.cjs 中调用 scripts/link-sdk-core.cjs,使用 fs.symlinkSync(openclawRoot, linkTarget, "junction") 创建 Windows junction 来解决此问题。aitoearn 插件缺少这一机制。
建议修复方案
方案一(推荐):添加 preload.cjs
在插件根目录创建 preload.cjs:
"use strict";
// Preload entry for aitoearn plugin.
// Node 22+ supports CJS require() of ESM modules.
const _pluginModule = require("./dist/runtime/index.js");
const _default = _pluginModule.default;
const merged = Object.assign({}, _pluginModule);
if (_default && typeof _default === "object") {
for (const key of Object.keys(_default)) {
if (!(key in merged)) {
merged[key] = _default[key];
}
}
}
module.exports = merged;然后修改 package.json:
"openclaw": {
"id": "aitoearn",
"extensions": [
"./preload.cjs"
],
...
}同时在 preload.cjs 中增加 openclaw symlink 创建逻辑(参考 qqbot 的 scripts/link-sdk-core.cjs),确保 tool-discovery-worker.js 能找到 openclaw 包。
方案二:将 openclaw 改为 dependencies
将 openclaw 从 devDependencies 移到 dependencies:
"dependencies": {
"openclaw": ">=2026.3.24"
}但仅此一项不够,还需要方案一中的 preload.cjs 才能使插件被 OpenClaw 自动发现。
参考:qqbot 插件的关键文件
preload.cjs— CJS 入口,负责加载 ESM 模块并创建 openclaw junctionscripts/link-sdk-core.cjs— 创建node_modules/openclaw的 Windows junctionpackage.json中"openclaw.extensions": ["./preload.cjs"]— 声明扩展入口
临时手动修复(供最终用户参考)
在等待官方修复期间,用户可以执行以下步骤手动修复(均在 Windows 环境下操作):
创建 preload.cjs:在
%USERPROFILE%\.openclaw\npm\node_modules\@aitoearn\openclaw-plugin\下创建上述preload.cjs创建 openclaw junction(用 Node.js 执行):
const fs = require('fs');
const path = require('path');
const pluginRoot = path.join(process.env.USERPROFILE, '.openclaw', 'npm', 'node_modules', '@aitoearn', 'openclaw-plugin');
const linkTarget = path.join(pluginRoot, 'node_modules', 'openclaw');
const openclawRoot = path.join(process.env.USERPROFILE, 'AppData', 'Roaming', 'npm', 'node_modules', 'openclaw');
// 或: 'D:\\Program Files\\nvm\\v24.6.0\\node_modules\\openclaw'
fs.mkdirSync(path.join(pluginRoot, 'node_modules'), { recursive: true });
try { fs.rmSync(linkTarget, { recursive: true, force: true }); } catch(e) {}
fs.symlinkSync(openclawRoot, linkTarget, 'junction');修改 package.json:将
openclaw.extensions改为["./preload.cjs"]刷新并重启:
openclaw plugins registry --refresh
openclaw gateway restart✔️ Expected Behavior
aitoearn 插件与 OpenClaw 2026.5.26 兼容性问题报告
环境信息
| 项目 | 值 |
|---|---|
| OpenClaw 版本 | 2026.5.26 (10ad3aa) |
| aitoearn 插件版本 | @aitoearn/[email protected] |
| Node.js | v24.6.0 (Windows) |
| 安装方式 | npx -y @aitoearn/openclaw-plugin-cli |
问题现象
插件安装时能正常连接并发现 109 个工具(Connected! Found 109 tools.),但重启 OpenClaw 网关后,aitoearn 的工具完全不出现,AI Agent 无法看到 getAiToEarnEnvironment、listTaskMarket 等工具。
网关启动日志始终显示 7 个已加载插件(不含 aitoearn):
http server listening (7 plugins: canvas, device-pair, file-transfer, memory-core, openclaw-qqbot, phone-control, talk-voice)根因分析
1. 缺少 preload.cjs 入口
OpenClaw 2026.5.26 的插件自动发现机制通过扫描 ~\.openclaw\npm\node_modules\ 下的 preload.cjs 文件来发现和加载非内置插件。
- qqbot 插件(正常工作):
@tencent-connect/openclaw-qqbot在根目录提供了preload.cjs,package.json中openclaw.extensions指向"./preload.cjs" - aitoearn 插件(无法加载):只有
package.json中openclaw.extensions指向"./dist/runtime/index.js"(ESM 模块),没有preload.cjs
2. openclaw 列为 devDependencies 而非 dependencies
插件的 package.json 中 openclaw 被声明为 devDependencies:
"devDependencies": {
"openclaw": ">=2026.3.24"
}但 dist/runtime/src/tool-discovery-worker.js 在运行时需要 import from openclaw。由于插件安装到用户目录 ~\.openclaw\npm\ 时不会安装 devDependencies,导致 Worker 线程报错:
Cannot find package 'openclaw' imported from ...tool-discovery-worker.jsqqbot 插件通过在 preload.cjs 中调用 scripts/link-sdk-core.cjs,使用 fs.symlinkSync(openclawRoot, linkTarget, "junction") 创建 Windows junction 来解决此问题。aitoearn 插件缺少这一机制。
建议修复方案
方案一(推荐):添加 preload.cjs
在插件根目录创建 preload.cjs:
"use strict";
// Preload entry for aitoearn plugin.
// Node 22+ supports CJS require() of ESM modules.
const _pluginModule = require("./dist/runtime/index.js");
const _default = _pluginModule.default;
const merged = Object.assign({}, _pluginModule);
if (_default && typeof _default === "object") {
for (const key of Object.keys(_default)) {
if (!(key in merged)) {
merged[key] = _default[key];
}
}
}
module.exports = merged;然后修改 package.json:
"openclaw": {
"id": "aitoearn",
"extensions": [
"./preload.cjs"
],
...
}同时在 preload.cjs 中增加 openclaw symlink 创建逻辑(参考 qqbot 的 scripts/link-sdk-core.cjs),确保 tool-discovery-worker.js 能找到 openclaw 包。
方案二:将 openclaw 改为 dependencies
将 openclaw 从 devDependencies 移到 dependencies:
"dependencies": {
"openclaw": ">=2026.3.24"
}但仅此一项不够,还需要方案一中的 preload.cjs 才能使插件被 OpenClaw 自动发现。
参考:qqbot 插件的关键文件
preload.cjs— CJS 入口,负责加载 ESM 模块并创建 openclaw junctionscripts/link-sdk-core.cjs— 创建node_modules/openclaw的 Windows junctionpackage.json中"openclaw.extensions": ["./preload.cjs"]— 声明扩展入口
临时手动修复(供最终用户参考)
在等待官方修复期间,用户可以执行以下步骤手动修复(均在 Windows 环境下操作):
创建 preload.cjs:在
%USERPROFILE%\.openclaw\npm\node_modules\@aitoearn\openclaw-plugin\下创建上述preload.cjs创建 openclaw junction(用 Node.js 执行):
const fs = require('fs');
const path = require('path');
const pluginRoot = path.join(process.env.USERPROFILE, '.openclaw', 'npm', 'node_modules', '@aitoearn', 'openclaw-plugin');
const linkTarget = path.join(pluginRoot, 'node_modules', 'openclaw');
const openclawRoot = path.join(process.env.USERPROFILE, 'AppData', 'Roaming', 'npm', 'node_modules', 'openclaw');
// 或: 'D:\\Program Files\\nvm\\v24.6.0\\node_modules\\openclaw'
fs.mkdirSync(path.join(pluginRoot, 'node_modules'), { recursive: true });
try { fs.rmSync(linkTarget, { recursive: true, force: true }); } catch(e) {}
fs.symlinkSync(openclawRoot, linkTarget, 'junction');修改 package.json:将
openclaw.extensions改为["./preload.cjs"]刷新并重启:
openclaw plugins registry --refresh
openclaw gateway restart❌ Actual Behavior
aitoearn 插件与 OpenClaw 2026.5.26 兼容性问题报告
环境信息
| 项目 | 值 |
|---|---|
| OpenClaw 版本 | 2026.5.26 (10ad3aa) |
| aitoearn 插件版本 | @aitoearn/[email protected] |
| Node.js | v24.6.0 (Windows) |
| 安装方式 | npx -y @aitoearn/openclaw-plugin-cli |
问题现象
插件安装时能正常连接并发现 109 个工具(Connected! Found 109 tools.),但重启 OpenClaw 网关后,aitoearn 的工具完全不出现,AI Agent 无法看到 getAiToEarnEnvironment、listTaskMarket 等工具。
网关启动日志始终显示 7 个已加载插件(不含 aitoearn):
http server listening (7 plugins: canvas, device-pair, file-transfer, memory-core, openclaw-qqbot, phone-control, talk-voice)根因分析
1. 缺少 preload.cjs 入口
OpenClaw 2026.5.26 的插件自动发现机制通过扫描 ~\.openclaw\npm\node_modules\ 下的 preload.cjs 文件来发现和加载非内置插件。
- qqbot 插件(正常工作):
@tencent-connect/openclaw-qqbot在根目录提供了preload.cjs,package.json中openclaw.extensions指向"./preload.cjs" - aitoearn 插件(无法加载):只有
package.json中openclaw.extensions指向"./dist/runtime/index.js"(ESM 模块),没有preload.cjs
2. openclaw 列为 devDependencies 而非 dependencies
插件的 package.json 中 openclaw 被声明为 devDependencies:
"devDependencies": {
"openclaw": ">=2026.3.24"
}但 dist/runtime/src/tool-discovery-worker.js 在运行时需要 import from openclaw。由于插件安装到用户目录 ~\.openclaw\npm\ 时不会安装 devDependencies,导致 Worker 线程报错:
Cannot find package 'openclaw' imported from ...tool-discovery-worker.jsqqbot 插件通过在 preload.cjs 中调用 scripts/link-sdk-core.cjs,使用 fs.symlinkSync(openclawRoot, linkTarget, "junction") 创建 Windows junction 来解决此问题。aitoearn 插件缺少这一机制。
建议修复方案
方案一(推荐):添加 preload.cjs
在插件根目录创建 preload.cjs:
"use strict";
// Preload entry for aitoearn plugin.
// Node 22+ supports CJS require() of ESM modules.
const _pluginModule = require("./dist/runtime/index.js");
const _default = _pluginModule.default;
const merged = Object.assign({}, _pluginModule);
if (_default && typeof _default === "object") {
for (const key of Object.keys(_default)) {
if (!(key in merged)) {
merged[key] = _default[key];
}
}
}
module.exports = merged;然后修改 package.json:
"openclaw": {
"id": "aitoearn",
"extensions": [
"./preload.cjs"
],
...
}同时在 preload.cjs 中增加 openclaw symlink 创建逻辑(参考 qqbot 的 scripts/link-sdk-core.cjs),确保 tool-discovery-worker.js 能找到 openclaw 包。
方案二:将 openclaw 改为 dependencies
将 openclaw 从 devDependencies 移到 dependencies:
"dependencies": {
"openclaw": ">=2026.3.24"
}但仅此一项不够,还需要方案一中的 preload.cjs 才能使插件被 OpenClaw 自动发现。
参考:qqbot 插件的关键文件
preload.cjs— CJS 入口,负责加载 ESM 模块并创建 openclaw junctionscripts/link-sdk-core.cjs— 创建node_modules/openclaw的 Windows junctionpackage.json中"openclaw.extensions": ["./preload.cjs"]— 声明扩展入口
临时手动修复(供最终用户参考)
在等待官方修复期间,用户可以执行以下步骤手动修复(均在 Windows 环境下操作):
创建 preload.cjs:在
%USERPROFILE%\.openclaw\npm\node_modules\@aitoearn\openclaw-plugin\下创建上述preload.cjs创建 openclaw junction(用 Node.js 执行):
const fs = require('fs');
const path = require('path');
const pluginRoot = path.join(process.env.USERPROFILE, '.openclaw', 'npm', 'node_modules', '@aitoearn', 'openclaw-plugin');
const linkTarget = path.join(pluginRoot, 'node_modules', 'openclaw');
const openclawRoot = path.join(process.env.USERPROFILE, 'AppData', 'Roaming', 'npm', 'node_modules', 'openclaw');
// 或: 'D:\\Program Files\\nvm\\v24.6.0\\node_modules\\openclaw'
fs.mkdirSync(path.join(pluginRoot, 'node_modules'), { recursive: true });
try { fs.rmSync(linkTarget, { recursive: true, force: true }); } catch(e) {}
fs.symlinkSync(openclawRoot, linkTarget, 'junction');修改 package.json:将
openclaw.extensions改为["./preload.cjs"]刷新并重启:
openclaw plugins registry --refresh
openclaw gateway restartSource: yikart/AiToEarn