问题描述
安装 jsonschema 后,install.py 对含有 agents 字段的模块(如 omo、do)校验失败。
根因
commit ebd795c("feat(install): per-module agent merge and documentation overhaul")在 config.json 和 install.py 中添加了 agents 支持,但没有同步更新 config.schema.json。
config.schema.json 中的 module 定义($defs/module)设置了 additionalProperties: false,且仅声明了 enabled、description、operations 三个属性,缺少 agents。导致 install.py:406 的 jsonschema.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)
问题描述
安装
jsonschema后,install.py对含有agents字段的模块(如omo、do)校验失败。根因
commit
ebd795c("feat(install): per-module agent merge and documentation overhaul")在config.json和install.py中添加了agents支持,但没有同步更新config.schema.json。config.schema.json中的 module 定义($defs/module)设置了additionalProperties: false,且仅声明了enabled、description、operations三个属性,缺少agents。导致install.py:406的jsonschema.validate()拒绝所有包含agents的模块。复现步骤
pip install jsonschema python3 install.py --status --install-dir ~/.claude预期: 正常输出状态报告,无校验错误。
实际:
修复建议
在
$defs/module/properties中添加可选的agents属性:环境
c00d5bc)