跳转到内容

Invalid schema for function — Codex

Quick fix

将 CC Switch 升级至包含 v3.18.0 修复的版本可解决 parameters.type:null 变体;其他 null schema 变体仍需跟踪原帖。

报错原文
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` 变体仍为开放报告,原帖只有提议补丁,尚未提供可验证的通用解法。

  1. 若报错明确包含 `codex_app__automation_update` 与 `type: null`,升级到包含 v3.18.0 修复的 CC Switch 版本后重新验证。该修复针对 Responses→Chat 路径的 `parameters:null`、`type:null` 和缺失参数。

  2. 若错误改为 `list_mcp_resources: null is not of type "array"`,或在 xAI OAuth 原生 Responses 路径仍出现 `mcp__codex_app__automation_update`,原帖尚未提供适用于全部场景的可验证解法;请按对应 source issue 跟踪维护者后续版本与验证结果。

ToolCodex
Version未知
PlatformsWindowsmacOS
这一个问题目前有解决方案吗?
`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。本站不分发任何软件。