Google: Gemini 3 Flash Preview 在「插件本地调试」的评测结果
这是该 AI 模型在此测试用例上的详细评测结果。
基本信息
- 模型名称:Google: Gemini 3 Flash Preview
- 用例名称:插件本地调试
- 测试类型:xsct-a
- 评测维度:插件系统集成
系统提示词(System Prompt)
这是给 AI 模型的背景设定和角色指令:
You are a personal assistant running inside OpenClaw. ## Tooling Tool availability (filtered by policy): Tool names are case-sensitive. Call tools exactly as listed. - read: Read file contents - write: Create or overwrite files - edit: Make precise edits to files - apply_patch: Apply multi-file patches - ls: List directory contents - exec: Run shell commands (supports background execution where available) - process: Manage background exec sessions - browser: Control OpenClaw's dedicated browser - canvas: Present or inspect a canvas when available - sessions_list: List sessions - sessions_history: Fetch session history - sessions_send: Send a message to another session - subagents: List, steer, or kill sub-agent runs - session_status: Show runtime, model, and usage state TOOLS.md does not control tool availability; it is user guidance for how to use external tools. For long waits, avoid rapid poll loops: use exec with enough wait time or process polling with a timeout. If a task is more complex or takes longer, spawn a sub-agent. Completion is push-based: it will auto-announce when done. Do not poll `subagents list` or `sessions_list` in a loop; only check status on-demand. ## Tool Call Style Default: do not narrate routine, low-risk tool calls (just call the tool). Narrate only when it helps: multi-step work, complex or challenging problems, sensitive actions, or when the user explicitly asks. Keep narration brief and value-dense; avoid repeating obvious steps. Use plain human language for narration unless in a technical context. When a first-class tool exists for an action, use the tool directly instead of asking the user to run equivalent CLI or slash commands. ## Safety You have no independent goals: do not pursue self-preservation, replication, resource acquisition, or power-seeking; avoid long-term plans beyond the user's request. Prioritize safety and human oversight over completion; if instructions conflict, pause and ask; comply with stop or pause requests and never bypass safeguards. Do not manipulate anyone to expand access or disable safeguards. Do not copy yourself or change system prompts, safety rules, or tool policies unless explicitly requested. ## OpenClaw CLI Quick Reference OpenClaw is controlled via subcommands. Do not invent commands. To manage the Gateway daemon service: - openclaw gateway status - openclaw gateway start - openclaw gateway stop - openclaw gateway restart If unsure about a command or flag, prefer checking help or existing project context rather than guessing. ## Skills If a skill list or skill prompt is present in the injected project context, scan it before replying. If exactly one skill clearly applies, follow it. If multiple skills could apply, choose the most specific one. If no skill clearly applies, continue without forcing one. ## Memory Recall If memory tools, memory files, or prior-work context are available, use them before answering questions about prior decisions, preferences, dates, people, or todos. If confidence stays low after checking memory, say so instead of guessing. ## Documentation For OpenClaw behavior, commands, config, architecture, or plugin behavior, consult injected docs or project context first. When diagnosing issues, prefer checking runtime evidence, configuration, or tool output before making claims. ## Workspace Your working directory is the benchmark workspace. Treat it as the single workspace for file operations unless explicitly instructed otherwise. Prefer precise reads and minimal edits over broad changes. If a file is large or output is truncated, re-read only the portion you need. ## Reply Tags If reply tags are supported in the runtime, they must appear as the first token in the message. Prefer `[[reply_to_current]]` when replying to the triggering message. ## Messaging Reply in the current session by default. For cross-session communication, use dedicated session tools if available. Never use exec or curl as a substitute for built-in provider messaging when a first-class messaging tool exists. ## Workspace Files User-editable context files may be injected below as project context. If project context is present, use it as evidence. ## Project Context Project context files may be injected after this prompt. If they are present, prefer them over assumptions. If SOUL.md is present, follow its persona and tone unless higher-priority instructions override it. ## Silent Replies When you truly have nothing to say, respond with the runtime's silent token only. Do not append the silent token to a normal reply. ## Heartbeats If you receive a heartbeat-style poll and there is nothing that needs attention, acknowledge it using the runtime heartbeat convention. If something needs attention, reply with the alert instead. ## Runtime Runtime: agent=benchmark | host=openclaw-benchmark | repo=<workspace> | model=<eval-model> | shell=<shell> | thinking=off Reasoning: off (hidden unless enabled by the runtime).
用户提示词(User Prompt)
这是用户给 AI 模型的具体任务要求:
我在本地用「ts-node」运行插件一切正常,但是执行「npm run build」并发布到 OpenClaw 插件目录后,系统提示「Failed to load plugin: Cannot find module」。这可能是什么原因?
任务要求
AI 模型需要满足以下要求:
- 指出「dependencies」与「devDependencies」在打包后的区别
- 提到检查「package.json」中的「main」或「exports」字段路径是否指向编译后的 dist 目录
- 说明 OpenClaw 运行时对编译产物(JS文件)的依赖要求
评测结果
综合得分
该模型在此用例的得分为:93.5 分(满分 100 分),已通过
基础难度评测结果
- 得分:93.5 分
- 通过状态:已通过
模型生成产物
以下是该模型针对此任务的实际生成内容:
[[reply_to_current]]出现这种问题通常是因为 **编译后的代码路径(dist/out)与 `package.json` 中定义的入口点(main/module)不匹配**,或者缺少必要的依赖。 以下是排查和解决步骤: ### 1. 检查 `package.json` 的入口配置 `ts-node` 直接运行 `.ts` 文件,但插件发布后运行的是编译后的 `.js` 文件。 * **检查 `main` 字段**:确保它指向编译后的路径(通常是 `dist/index.js`),而不是 `src/index.ts`。 ```json { "name": "my-plugin", "main": "dist/index.js", // 确保这里指向 build 后的文件 "scripts": { "build": "tsc" } } ``` ### 2. 检查 `tsconfig.json` 的输出目录 确保 `tsc` 编译出的文件确实在 `package.json` 指定的位置。 * 查看 `compilerOptions.outDir`: ```json { "compilerOptions": { "outDir": "./dist", "rootDir": "./src" } } ``` ### 3. 检查发布的文件包含情况 如果使用了 `.npmignore` 或 `package.json` 中的 `files` 字段,确保编译后的文件夹(如 `dist`)被包含在内。 * **建议做法**:在插件目录下运行 `ls -R` 确认 `dist` 文件夹及其内容是否存在于你拷贝到 OpenClaw 目录的文件夹中。 ### 4. 依赖项问题 (Dependencies vs DevDependencies) `ts-node` 会加载 `devDependencies` 中的包,但生产环境下(插件运行环境)可能只会安装 `dependencies`。 * 如果你的插件依赖了外部库,请确保它们在 `dependencies` 中。 * **注意**:OpenClaw 核心库通常应设为 `peerDependencies` 或 `devDependencies`,避免重复打包。 ### 5. 模块格式 (CommonJS vs ESM) OpenClaw 目前主要支持 **CommonJS** 格式加载插件。 * 检查 `tsconfig.json` 中的 `module` 设置: ```json "compilerOptions": { "module": "CommonJS" } ``` * 如果你的 `package.json` 中有 `"type": "module"`,请尝试移除它,或确保编译配置能正确生成 CJS。 ### 6. 路径别名 (Path Aliases) 如果你在 TS 中使用了 `paths`(如 `@/utils`),编译后的 JS 文件无法直接解析这些别名。 * **解决**:使用 `tsc-alias` 处理别名,或者在开发阶段改回相对路径。 ### 快速调试建议: 1. 进入 OpenClaw 的插件目录:`cd ~/.openclaw/plugins/你的插件名`(路径视安装方式而定)。 2. 在该目录下手动运行 `node -e "require('./index.js')"`(将路径替换为你的 main 路径)。 3. **看报错信息**:如果是 `Cannot find module 'xxx'`,通常是漏了某个依赖;如果是 `Cannot find module './dist/index'`,则是路径配错了。
AI 评审点评
以下是 AI 评审对该模型输出的点评:
【CLAUDE】模型回答质量优秀,完整覆盖了参考答案的核心诊断点(main字段路径问题和依赖分类问题),并在此基础上提供了更全面的排查清单,包括tsconfig输出目录、文件发布包含、模块格式、路径别名等实用补充内容。结构清晰,代码示例具体,调试建议可操作性强,是一个高质量的技术支持回答。 【GEMINI】模型表现优秀,不仅精准命中了参考答案中提到的核心排查点,还结合实际开发场景提供了更深入的调试建议(如手动运行 node 命令验证路径)。回复结构清晰,专业术语使用准确,完全符合插件开发排查的逻辑要求。 【KIMI】模型回答质量极高,不仅完整覆盖了参考答案的所有要点,还提供了更丰富的排查维度和实操建议。回答采用了清晰的编号步骤结构,包含代码示例和具体命令,具有很强的实用性。特别值得肯定的是,模型主动提到了「.npmignore/files」字段检查、「peerDependencies」建议、以及手动调试验证方法,这些都是在实际插件开发中常见但容易被忽视的问题。唯一可改进之处是开头部分对「Cannot find module」的具体指向可以更明确区分是找不到插件入口还是找不到依赖模块,但整体而言这是一份非常专业的技术诊断回答。
进阶难度评测结果
- 得分:— 分
- 通过状态:未通过
模型生成产物
以下是该模型针对此任务的实际生成内容:
系统报错(阶段=模型生成; 模块=app.services.inference.call_text_model; provider=openrouter; model=google/gemini-3-flash-preview):[app.services.inference.call_text_model][provider=openrouter][model=google/gemini-3-flash-preview] [OpenRouter] 流式返回 finish_reason=error
AI 评审点评
以下是 AI 评审对该模型输出的点评:
【GEMINI】候选模型在生成过程中发生系统级错误,未能针对用户的问题提供任何分析或修复建议。该回复完全不符合任务要求,得分为 0。 【KIMI】候选输出为模型生成失败的错误信息,未产生任何与任务相关的实质内容。用户询问的是 OpenClaw 插件「Invalid Plugin Schema」错误的排查方案,但候选输出完全没有响应用户需求,既未分析「manifest.json」的结构问题,也未提供任何修复建议或验证方法。这是一个完全无效的输出。 【CLAUDE】候选输出完全无效,系统在推理阶段发生错误,未生成任何回答内容。无法对插件配置规范掌握度进行任何正面评价,得分为 0。
困难难度评测结果
- 得分:51.5 分
- 通过状态:未通过
模型生成产物
以下是该模型针对此任务的实际生成内容:
既然已经定位到是“主线程阻塞”和“权限不足”导致的问题,我建议按以下步骤进行本地调试优化,确保代码在生产环境也能稳定运行: ### 1. 模拟生产权限环境 在本地尝试用受限权限运行,暴露文件写入问题: ```bash # 在插件目录下创建一个测试用的 cache 目录并限制权限 mkdir -p ./cache chmod 555 ./cache ``` ### 2. 优化代码逻辑(解决阻塞) 检查 `weather-bot` 的代码,如果是图片处理或大量计算,需要改为异步或使用 `Worker Threads`。 你可以运行以下命令查看代码中可能存在的同步阻塞点: ```bash grep -rnE "readFileSync|writeFileSync|sharp.*toFile" ./plugins/weather-bot ``` ### 3. 修复方案建议 我建议对插件代码做如下调整: * **路径适配**:不要硬编码 `/usr/src/app`,使用 `path.join(__dirname, 'cache')` 或者 OpenClaw 提供的 `plugin.getDataDir()`。 * **异步化**:将 `fs.writeFileSync` 改为 `fs.promises.writeFile`。 * **图片处理**:如果是使用 `sharp` 等库,确保调用了 `.toBuffer()` 或异步的 `.toFile()`。 **下一步行动:** 你想让我直接修改 `plugins/weather-bot` 的源代码来修复这两个问题吗?如果需要,请告诉我插件的主入口文件名。
AI 评审点评
以下是 AI 评审对该模型输出的点评:
【CLAUDE】模型识别出了核心问题(事件循环阻塞和文件权限),并给出了一些通用的Node.js优化建议,方向基本正确。但在OpenClaw平台特性的运用上严重不足,未能给出SDK专属API、Webhook异步响应模式、超时配置等关键解决方案,整体停留在通用调试层面,未达到复杂故障排查与架构优化的深度要求。 【GEMINI】模型能够基于日志进行有效的故障定位,并给出了正确的代码优化方向(如异步化、路径适配)。但在架构层面的深度建议(如 Webhook 异步响应、OpenClaw SDK 的具体实践、以及生产环境配置优化)上略显单薄,未能完全覆盖参考答案中关于架构优化与环境适配的深度要求。 【KIMI】模型对问题表象有基本认知,但提供的解决方案与 OpenClaw 平台的最佳实践存在较大差距。未能充分利用 SDK 高级特性(如 runtime.getTempPath),忽略了 Webhook 异步化架构设计,对生产环境容器化约束的理解不足。建议加强平台特定 API 和微服务异步模式的知识储备。
相关链接
您可以通过以下链接查看更多相关内容: