Skip to content

bug: config.schema.json 缺少 agents 属性导致校验失败 #159

@BlueOcean223

Description

@BlueOcean223

问题描述

安装 jsonschema 后,install.py 对含有 agents 字段的模块(如 omodo)校验失败。

根因

commit ebd795c("feat(install): per-module agent merge and documentation overhaul")在 config.jsoninstall.py 中添加了 agents 支持,但没有同步更新 config.schema.json

config.schema.json 中的 module 定义($defs/module)设置了 additionalProperties: false,且仅声明了 enableddescriptionoperations 三个属性,缺少 agents。导致 install.py:406jsonschema.validate() 拒绝所有包含 agents 的模块。

复现步骤

pip install jsonschema
python3 install.py --status --install-dir ~/.claude

预期: 正常输出状态报告,无校验错误。
实际:

Error loading config: Config validation failed: Additional properties are not allowed ('agents' was unexpected)

修复建议

$defs/module/properties 中添加可选的 agents 属性:

"agents": {
  "type": "object",
  "description": "Agent configurations merged into ~/.codeagent/models.json",
  "patternProperties": {
    "^[a-zA-Z0-9_-]+$": {
      "type": "object",
      "required": ["backend", "model"],
      "properties": {
        "backend": { "type": "string" },
        "model": { "type": "string" },
        "reasoning": { "type": "string" },
        "yolo": { "type": "boolean" }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}

环境

  • Python 3.13 + jsonschema 4.23.0
  • 当前 master 分支 (c00d5bc)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions