xAI: Grok 4.20 Beta 在「Schema 设计缺陷」的评测结果

这是该 AI 模型在此测试用例上的详细评测结果。

基本信息

  • 模型名称:xAI: Grok 4.20 Beta
  • 用例名称:Schema 设计缺陷
  • 测试类型: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 模型的具体任务要求:

我在开发 OpenClaw 插件,发现用户如果不写「api_key」插件就会崩溃。我该如何在「schema」里强制要求这个字段必填,并给「unit」字段设置默认值为「metric」?

任务要求

AI 模型需要满足以下要求:

  1. 指出在「config_schema」中使用「required」数组来定义必填项
  2. 说明如何在字段属性中使用「default」关键字设置默认值
  3. 提供符合 JSON Schema 规范的代码片段

评测结果

综合得分

该模型在此用例的得分为:95.2 分(满分 100 分),已通过

基础难度评测结果

  • 得分:95.2 分
  • 通过状态:已通过

模型生成产物

以下是该模型针对此任务的实际生成内容:

**推荐方案:在 `schema` 中强制 `api_key` 必填,并给 `unit` 设置默认值** 以下是 OpenClaw 插件推荐的规范写法(基于 JSON Schema): ### 正确写法(推荐) ```json { "type": "object", "properties": { "api_key": { "type": "string", "title": "API Key", "description": "你的 OpenWeatherMap / 其他服务的 API Key" }, "unit": { "type": "string", "title": "单位", "description": "温度单位", "enum": ["metric", "imperial"], "default": "metric" } }, "required": ["api_key"], "additionalProperties": false } ``` ### 关键点说明: 1. **`required: ["api_key"]`** 这是 **强制必填** 的正确写法。放在 schema 最外层。 2. **`default: "metric"`** 给 `unit` 设置默认值,OpenClaw 在用户不填写时会自动使用该值。 3. 建议加上 `enum` 限制用户只能输入合法值。 4. 加上 `additionalProperties: false` 可以防止用户传入其他未知字段。 --- ### 完整示例(config.schema.json) ```json { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "api_key": { "type": "string", "title": "API Key", "description": "请输入你的 API Key,否则插件无法运行" }, "unit": { "type": "string", "title": "温度单位", "enum": ["metric", "imperial"], "default": "metric" }, "lang": { "type": "string", "title": "语言", "default": "zh_cn" } }, "required": ["api_key"], "additionalProperties": false } ``` --- **小贴士**: - 如果你希望在前端表单里也明确提示「必填」,可以给 `api_key` 加上: ```json "minLength": 1 ``` - 部分 OpenClaw 版本也支持在 `ui:options` 中标记必填(可选): ```json "api_key": { "type": "string", "ui:options": { "required": true } } ``` 需要我再给你配一个完整的 `plugin.json` + `schema` 示例吗?

AI 评审点评

以下是 AI 评审对该模型输出的点评:

【CLAUDE】候选回答质量优秀,不仅完整覆盖了参考答案的所有要点(required 数组、default 关键字、JSON Schema 代码示例),还提供了更丰富的实践建议(enum 限制、additionalProperties、minLength、ui:options 等)。表达清晰、结构合理,适合开发者直接应用。与参考答案相比,信息量更大,实用性更强,是一个高质量的技术回答。 【GEMINI】模型表现优秀,不仅直接回答了用户关于「required」和「default」的核心诉求,还提供了符合生产环境要求的 Schema 最佳实践(如限制额外属性、枚举值校验等),展现了极高的专业度。 【KIMI】候选输出是一份高质量的 OpenClaw 插件 Schema 配置指导,准确回答了用户关于必填字段和默认值设置的核心问题,代码规范、结构清晰、实用性强,可直接作为开发参考。

进阶难度评测结果

  • 得分:95.5 分
  • 通过状态:已通过

模型生成产物

以下是该模型针对此任务的实际生成内容:

**修改后的 schema.json 完整内容:** ```json { "type": "object", "properties": { "retry_count": { "type": "integer", "minimum": 0, "default": 3, "title": "重试次数", "description": "失败后重试的次数(最小值为 0)" } } } ``` 这个版本已修复以下问题: - 将类型改为 `integer`,防止传入字符串导致死循环 - 添加 `minimum: 0`,禁止负数 - 添加 `default: 3`,用户不填时自动使用 3 次重试 请直接替换整个 `schema.json` 文件内容为上面这段即可。

AI 评审点评

以下是 AI 评审对该模型输出的点评:

【CLAUDE】候选输出质量优秀,准确完成了所有核心修复任务:类型修正、最小值约束、默认值设置三项均正确实现。修复说明简洁明了,用户可直接使用输出内容替换文件。相比参考答案,额外增加了「title」字段作为可选增强,属于合理补充而非冗余。整体表现超过参考答案水平,是一个高质量的技术响应。 【GEMINI】模型准确理解了用户需求,不仅完成了核心的逻辑修复,还通过添加描述性字段提升了配置文件的易用性,输出格式清晰且符合要求。 【KIMI】候选输出优秀地完成了 schema.json 的修复任务,所有功能要求均已满足,JSON 结构规范,额外添加的「title」字段提升了用户体验,描述信息更加完整清晰。

困难难度评测结果

  • 得分:21.5 分
  • 通过状态:未通过

模型生成产物

以下是该模型针对此任务的实际生成内容:

**现在检查结果:** 我来重新运行一次完整检查,看看是否还有其他 Schema 设计缺陷。 请稍等,我立即执行检查。

AI 评审点评

以下是 AI 评审对该模型输出的点评:

【CLAUDE】候选输出极其简短且无实质内容,仅承诺将执行检查但并未实际调用任何工具或给出有价值的分析。与参考答案相比,差距巨大:参考答案提供了验证命令、嵌套约束补充建议、代码兼容性说明等多层次的深度指导;而候选输出仅有两句占位性文字,对用户几乎没有任何帮助。在故障排除深度和复杂场景决策两个维度上均表现极差,是典型的「回应了但没有真正回答」的情况。 【GEMINI】模型表现不佳。在用户明确询问修复结果后,模型未能执行必要的验证工具来确认修复状态,也未提供任何关于后续发布流程的专业指导或 Schema 健壮性建议。相比参考答案中提出的验证嵌套约束、执行严格校验及代码兼容性说明,候选输出显得非常敷衍且缺乏技术深度。 【KIMI】候选输出严重偏离任务要求,未识别 EVAL_BLOB 中已明确的两个修复点,也未提供任何实质性的 Schema 设计建议或发布前验证流程。输出过于简略,缺乏技术深度,无法满足「hard」难度下对 SDK 规范和嵌套对象处理的复杂场景要求。

相关链接

您可以通过以下链接查看更多相关内容:

加载中...