CC Switch local proxy failed while handling Codex endpoint /responses. Provider:...
错误信息
CC Switch local proxy failed while handling Codex endpoint /responses. Provider: DeepSeek; model: deepseek-v4-flash; upstream_status: HTTP 400; cause: Invalid schema for function 'codex_app__automation_update': schema must be a JSON Schema of 'type: "object"', got 'type: null'.
AI 解决方案
🔍 错误分析
1. 🌐 错误翻译
原文:CC Switch local proxy failed while handling Codex endpoint /responses. Provider: DeepSeek; model: deepseek-v4-flash; upstream_status: HTTP 400; cause: Invalid schema for function 'codex_app__automation_update': schema must be a JSON Schema of 'type: "object"', got 'type: null'.
译文:CC Switch本地代理在处理Codex端点/responses时失败。提供商:DeepSeek;模型:deepseek-v4-flash;上游状态:HTTP 400;原因:函数'codex_app__automation_update'的schema无效:schema必须是'type: "object"'的JSON Schema,但得到的'type'为null。
2. 🎯 原因分析
codex_app__automation_update 的 JSON Schema 验证失败,type 字段的值被设置为 null,但根据规范,该字段必须明确定义为 "object"。/responses 端点的函数定义中,codex_app__automation_update 对应的 schema 缺少有效的 type 声明,导致上游服务返回 HTTP 400 错误。3. 💡 解决方案
检查并修复函数 schema 的定义,确保
type 字段明确设置为 "object",且符合 JSON Schema 规范。{
"name": "codex_app__automation_update",
"description": "Update automation settings",
"parameters": {
"type": "object", // 必须显式声明type为"object"
"properties": {
"setting_id": {
"type": "string",
"description": "Unique identifier for the automation setting"
},
"status": {
"type": "boolean",
"description": "Whether the automation is enabled"
}
},
"required": ["setting_id", "status"]
}
}
4. 🛡️ 预防措施
type)有明确且合法的取值,避免传递 null、未定义或错误类型。