Invalid schema for function 'codex_app__automation_update' 报错 - CC Switch
Quick fix
Codex Desktop 内置工具 automation_update 的 schema 缺顶层 type,被 DeepSeek 拒绝,升级 CC Switch 到包含修复的版本即可。
Symptom
Section titled “Symptom”CC Switch local proxy failed while handling Codex endpoint /responses. Provider: DeepSeek; model: deepseek-v4-pro; 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'.Codex Desktop 会把内置工具(如 codex_app__automation_update)的 schema 注入到 /responses 请求里,其中 automation_update 的根层级使用 oneOf 但没有声明 "type": "object"。CC Switch 将 Codex Responses 格式转换为 OpenAI Chat Completions 格式时,未把 type 为 null 的 parameters 规范化为 {"type": "object", "properties": {}},DeepSeek 因此以 HTTP 400 拒绝。
该问题在 CC Switch 3.14.3、3.16.3、3.16.4 上均有报告。另有用户反馈 3.19.1 上遇到变体:normalize_function_parameters() 虽补上了 type,但仍保留顶层 oneOf,导致 Databricks/OpenAI 端报 schema must not have 'oneOf'/'anyOf'/'allOf'/'enum'/'const'/'not' at the top level。
将 CC Switch 升级到包含修复的版本(3.16.4 之后)。在设置里检查更新,或到 GitHub Releases 下载最新安装包。
升级后重启 Codex Desktop,让 CC Switch 的本地代理重新接管 /responses 路由。
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”本页汇总自 4 个真实 issue
- #3847Anthropic-OpenAI tool parameter schema: type becomes null
- #4705Codex Desktop使用DeepSeek provider,自动调用codex_app__automation_update 时出现 parameters schema type:null 导致 HTTP 400
- #4834cause: Invalid schema for function 'codex_app__automation_update': schema must be a JSON Schema of 'type: "object"', got 'type: null'.
- #6101[Bug] Databricks GPT-5.6: fresh Codex task fails when automation_update is flattened into Chat tools
- 为什么以前正常,装了几个 skills 之后就开始报错?
- Codex Desktop 的 automation_update 工具 schema 本身缺 type,平时不会触发;只有当请求里带上这个工具定义(例如 AI 主动调用)时才会被 DeepSeek 以 HTTP 400 拒绝。
- 升级到 3.19.1 后还会报错吗?
- 3.19.1 对 DeepSeek 的 type:null 场景已修复,但对 Databricks/OpenAI 这类更严格的 upstream 仍可能报顶层不能包含 oneOf/anyOf 等关键字,需要等后续版本处理。
这是一个非官方社区 wiki,与 cc-switch 作者及项目本身无隶属关系。内容整理自项目公开的 GitHub issues。本站不分发任何软件。