Invalid schema: codex_app__automation_update - Codex
Quick fix
升级 CC Switch 至 v3.18.0 或更高版本,以修复 Codex 转换 DeepSeek 协议时因 type: null 导致的 400 报错。
Symptom
Section titled “Symptom”Invalid schema for function 'codex_app__automation_update': schema must be a JSON Schema of 'type: "object"', got 'type: null'.Codex 的内置工具(如 codex_app__automation_update)在生成 schema 时,部分可空字段的参数被设为 type: null 或直接为空。OpenAI 官方接口对此容忍度较高,但 DeepSeek 等严格校验的模型提供商会直接拒绝并返回 HTTP 400 错误。
当 CC Switch 将 Codex 的 Responses API 转换为 Chat Completions 协议转发给 DeepSeek 时,早期版本未对这种病态 schema 进行清理,导致 type: null 被原样透传。该问题已在 v3.18.0 中通过代理层的 schema 归一化修复。
将 CC Switch 升级到 v3.18.0 或更高版本。新版本在 Responses 到 Chat 的转换桥中内置了 schema 清理逻辑,会自动将 parameters 归一为合法的 {"type": "object"} schema。
Affected Versions
Section titled “Affected Versions”ToolCodex
Version未知
PlatformsmacOSWindows
Source Issues
Section titled “Source Issues”本页汇总自 2 个真实 issue
- Azure OpenAI 也会遇到这个问题吗?
- 是的,Azure OpenAI 等其他严格校验 schema 的提供商也可能触发此问题。升级到 v3.18.0 后,代理层会将所有缺失或为 null 的 type 归一化为 object,从而解决该问题。
- 如何手动修改代理层来移除 type: null?
- 无需手动修改。官方已在 v3.18.0 版本的 Responses 到 Chat 转换桥中内置了 schema sanitization,自动将 parameters 归一为合法的 type: "object" schema。直接升级即可。
这是一个非官方社区 wiki,与 cc-switch 作者及项目本身无隶属关系。内容整理自项目公开的 GitHub issues。本站不分发任何软件。