GLM-5.1 在「插件本地调试」的评测结果
这是该 AI 模型在此测试用例上的详细评测结果。
基本信息
- 模型名称:GLM-5.1
- 用例名称:插件本地调试
- 测试类型: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文件)的依赖要求
评测结果
综合得分
该模型在此用例的得分为:94.0 分(满分 100 分),已通过
基础难度评测结果
- 得分:94.0 分
- 通过状态:已通过
模型生成产物
以下是该模型针对此任务的实际生成内容:
ls find . -name "*.md" -maxdepth 3 | head -20 find . -path "*/docs/*" -name "*.md" | head -20 find . -name "package.json" -maxdepth 2 | head -10 find . -name "tsconfig*" -maxdepth 3 | head -10 find . -name "openclaw*" -o -name ".openclaw*" | head -20 cat package.json 2>/dev/null || echo "No root package.json" find . -name "MANIFEST*" -o -name "manifest*" -o -name "plugin.yaml" -o -name "plugin.yml" | head -10 find . -type f -name "*.ts" | head -20 ls -la find . -maxdepth 1 -type f | sort find . -maxdepth 2 -type f | sort cat README.md 2>/dev/null | head -80 find . -name "openclaw" -type d 2>/dev/null | head -5 find . -name "gateway" -type d 2>/dev/null | head -5 find . -path "*/openclaw*" | head -20 cat docs/plugin-guide.md 2>/dev/null | head -100 cat docs/plugins.md 2>/dev/null | head -100 find . -name "*.md" -exec grep -li "plugin" {} \; 2>/dev/null | head -10 cat docs/architecture.md 2>/dev/null | head -200 find . -name "*.md" -exec grep -li "Cannot find module" {} \; 2>/dev/null | head -5 find . -name "*.md" -exec grep -li "ts-node\|tsconfig\|build\|compile" {} \; 2>/dev/null | head -10 cat docs/architecture.md 2>/dev/null cat docs/plugin-development.md 2>/dev/null find . -name "*.md" -exec grep -li "main\|entry\|exports" {} \; 2>/dev/null | head -10 cat docs/README.md 2>/dev/null find . -name "SOUL.md" | head -5 find . -name "TOOLS.md" | head -5 [[reply_to_current]] 这是一个非常典型的 TypeScript 插件构建/发布问题。根据症状——`ts-node` 本地跑没问题,`npm run build` 后发布却报 `Cannot find module`——最常见的原因有以下几类: --- ## 1. 🔴 `package.json` 的 `main` / `exports` 指向了源文件而非产物 这是**最常见的原因**。`ts-node` 会直接运行 `.ts` 源码,所以本地没问题;但构建后 OpenClaw 加载的是编译产物,入口必须指向 `dist/` 下的 `.js` 文件。 ```jsonc // ❌ 错误:指向了源码 { "main": "src/index.ts" } // ✅ 正确:指向编译产物 { "main": "dist/index.js" } ``` 同时检查 `exports` 字段(如果有的话): ```jsonc // ❌ 错误 { "exports": { ".": "./src/index.ts" } } // ✅ 正确 { "exports": { ".": "./dist/index.js" } } ``` --- ## 2. 🔴 `tsconfig.json` 的 `outDir` 与 `package.json` 的 `main` 不一致 确认两者对齐: ```jsonc //...
AI 评审点评
以下是 AI 评审对该模型输出的点评:
【GEMINI】模型在诊断技术问题方面表现出色。它通过结构化的方式清晰地列出了可能导致故障的几种常见场景,解释了 TypeScript 源码运行(ts-node)与编译后运行在环境和依赖处理上的本质差异。回答内容详实,不仅解决了当前问题,还提供了预防和验证的手段,极具实用价值。 【KIMI】整体而言,候选人对TypeScript插件打包和OpenClaw插件运行机制有较好的理解,能够准确诊断问题并给出详细的排查步骤和解决方案。输出内容详尽,条理清晰,对用户排查问题很有帮助。但在CommonJS/ESM导出路径方面略显不足,如果能够进一步解释相关概念,诊断将更加全面。
进阶难度评测结果
- 得分:82.0 分
- 通过状态:已通过
模型生成产物
以下是该模型针对此任务的实际生成内容:
{"name":"read","arguments":{"path":"./plugins/weather-bot/manifest.json"}} { "name": "weather-bot", "version": "1.0.0", "description": "A weather query plugin", "entry": "index.js", "permissions": ["http", "storage"], "hooks": { "onMessage": "handleMessage" } } {"name":"read","arguments":{"path":"./plugins/weather-bot/index.js"}} module.exports = { handleMessage: async (ctx, msg) => { // weather logic here } } 根据目录结构和配置文件内容,我找到了导致 **「Invalid Plugin Schema」** 的几个问题: --- ## 问题诊断 ### 1. `package.json` 缺少 `openclaw` 字段(主要原因) OpenClaw 通过 `package.json` 中的 `openclaw` 字段识别插件元数据,当前 `package.json` 只有标准的 npm 字段,缺少必需的 OpenClaw 声明: ```json { "name": "weather-bot", "version": "1.0.0", "main": "index.js" // ❌ 缺少 "openclaw" 字段 } ``` ### 2. `manifest.json` 中 `entry` 不是合法字段 OpenClaw 插件 schema 使用 `main` 而非 `entry` 来指定入口文件。当前写法: ```json "entry": "index.js" // ❌ 无效字段 ``` 应改为: ```json "main": "index.js" // ✅ 正确字段 ``` ### 3. `hooks.onMessage` 格式不规范 `hooks` 中的值应为对象描述而非字符串函数名,字符串形式不在 schema 定义中。 ### 4. `permissions` 值可能不在允许范围内 `"http"` 和 `"storage"` 需要确认是否为 OpenClaw 支持的权限标识(常见为 `"network"`, `"fs"` 等),具体取决于运行时版本。 --- ## 修复方案 将 `package.json` 和 `manifest.json` 合并规范,修改如下: **`package.json`**: ```json { "name": "weather-bot", "version": "1.0.0", "main": "index.js", "openclaw": { "name": "weather-bot", "version": "1.0.0", "description": "A weather query plugin", "permissions": ["network", "fs"], "hooks": { "onMessage": { "handler": "handleMessage" } } } } ``` **`manifest.json`**(如果仍需保留,需与 `package.json` 一致): ```json { "name": "weather-bot", "version": "1.0.0", "description": "A weather query plugin", "main": "index.js", "permissions": ["network", "fs"], "hooks": { "onMessage": { "handler": "handleMessage" } } } ``` --- ## 修改摘要 | 问题 | 原值 | 修正 | |------|------|------| | `package.json` 缺少 `openclaw` | 无 | 添加 `openclaw` 元数据块 | | `entry` 无效字段 | `"entry": "index.js"` | 改为 `"main": "index.js"` | | `hooks` 值格式 | `"onMessage": "handleMessage"` | `"onMessage": { "handler": "handleMessage" }` | |...
AI 评审点评
以下是 AI 评审对该模型输出的点评:
【GEMINI】模型在技术诊断方面表现出色,能够结合代码上下文发现逻辑错误(如 hook 格式和字段名错误),其分析深度超过了基础的参考答案。然而,模型未能覆盖评分标准中明确要求的‘本地验证工具使用’这一项,且遗漏了插件标识符(id)这一核心元数据。整体而言,是一个高质量的技术支持回答,但对特定评测指标的覆盖不够全面。 【KIMI】整体而言,回答提供了较为全面的问题分析和修复方案,但在细节上存在一些不准确之处,需要进一步精确化以完全符合 OpenClaw 的插件开发规范。
困难难度评测结果
- 得分:64.0 分
- 通过状态:已通过
模型生成产物
以下是该模型针对此任务的实际生成内容:
两个问题都定位了,现在动手修。先看插件代码结构,再逐个修复。 {"name": "ls", "arguments": {"path": "."}}
AI 评审点评
以下是 AI 评审对该模型输出的点评:
【GEMINI】模型在接收到任务后,虽然能够衔接上下文并开始对代码结构进行探索,但在‘硬核’的技术架构建议上表现缺失。在处理此类复杂故障时,直接调用工具而不在回复中阐述修复思路(特别是涉及 SDK 特性和 Node.js 性能优化的核心点),无法体现其作为专业 AI 专家的深度。建议在行动前或行动中明确优化方向,以符合‘复杂故障排查与架构优化’的评测要求。 【KIMI】整体而言,候选人表现出了对复杂故障排查和架构优化的基本理解,能够识别出问题并有意向进行修复。但是,输出中缺少了一些关键的优化建议和配置说明,这些是评分时考虑的重要因素。因此,虽然有一定的表现,但在提供全面解决方案方面还有提升空间。
相关链接
您可以通过以下链接查看更多相关内容: