Invalid schema for function — Codex
Quick fix
将 CC Switch 升级至包含 v3.18.0 修复的版本可解决 parameters.type:null 变体;其他 null schema 变体仍需跟踪原帖。
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 在 `/responses` 请求中携带的 `codex_app__automation_update` 工具参数可能为 `null`、`type:null`,或以缺少根级 `type:"object"` 的 `oneOf`/`anyOf` 表示。CC Switch 的 Responses→Chat Completions 转换路径曾将这些 schema 原样转发,DeepSeek 等严格校验上游因此返回 HTTP 400。维护者确认此 `type:null` 路径已在 v3.18.0 修复,归一化为 object 参数 schema;不要仅凭 issue 已关闭就推断所有变体均已修复。
本组还包含不同的后续变体:v3.20.0 的 xAI 原生 Responses 路径中,`mcp__codex_app__automation_update` 的根级联合类型曾被拒绝,维护者称修复已合入 main、将在下个版本发布;`list_mcp_resources` 的 `required:null` 变体仍为开放报告,原帖只有提议补丁,尚未提供可验证的通用解法。
若报错明确包含 `codex_app__automation_update` 与 `type: null`,升级到包含 v3.18.0 修复的 CC Switch 版本后重新验证。该修复针对 Responses→Chat 路径的 `parameters:null`、`type:null` 和缺失参数。
若错误改为 `list_mcp_resources: null is not of type "array"`,或在 xAI OAuth 原生 Responses 路径仍出现 `mcp__codex_app__automation_update`,原帖尚未提供适用于全部场景的可验证解法;请按对应 source issue 跟踪维护者后续版本与验证结果。
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”本页汇总自 13 个真实 issue
- #4360HTTP 400; cause: Invalid schema for function 'list_mcp_resources': null is not of type
- #4961deepseek-v4-pro 返回 400:工具 schema 中 type: null 不兼容
- #4992Codex: codex_app__automation_update tool schema breaks DeepSeek routing (HTTP 400)
- #5113CC Switch local proxy failed while handling Codex endpoint /responses
- #5192[Codex] DeepSeek 400 错误:codex_app__automation_update 工具 schema 中 type 为 null
- #5263Codex /responses 端点代理到 DeepSeek 时报 schema 错误
- #5264codex通过ccswitch连接deepseek老出问题
- #5300[Codex] function codex_app__automation_update with parameters: null causes DeepSeek HTTP 400 — "Invalid schema for function"
- #5332codex使用cc Switch接入deepseek报错
- #5349Bug: `type: null` in tool schema causes HTTP 400 on Codex Responses→Chat transform (DeepSeek and other strict-schema providers)
- #5490Codex Chat 路由下 function tool 偶发 HTTP 400:function/parameters 缺失导致 schema 无效
- #6815[Bug] v3.20.0 xAI (Grok) OAuth + Codex: mcp__codex_app__automation_update 仍被拒绝 (root oneOf/anyOf with non-object branch)
- #7019fix(proxy): sanitize null \required` in Codex tool parameters for strict upstreams`
- 这一个问题目前有解决方案吗?
- `codex_app__automation_update` 的 `parameters.type:null` 变体,维护者称已在 v3.18.0 修复;xAI 与 `required:null` 等后续变体需分别查看原帖状态。
- 这个该如何解决呢?
- 先确认错误是否为 `type: null` 变体;若是,升级到包含 v3.18.0 修复的版本。若错误为 `list_mcp_resources` 的 `null is not of type "array"`,原帖尚未给出可验证解法。
这是一个非官方社区 wiki,与 cc-switch 作者及项目本身无隶属关系。内容整理自项目公开的 GitHub issues。本站不分发任何软件。