Invalid schema for function — Codex
Quick fix
Upgrade CC Switch to a version including the v3.18.0 fix for parameters.type:null; track the original issues for other null schema variants.
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'.Early reports showed that Codex could send `codex_app__automation_update` tool parameters in `/responses` requests as `null`, `type:null`, or `oneOf`/`anyOf` without a root-level `type:"object"`. CC Switch previously forwarded these schemas unchanged through its Responses-to-Chat Completions conversion path, so strictly validating upstreams such as DeepSeek returned HTTP 400. Maintainers confirmed that this `type:null` path was fixed in v3.18.0 by normalizing it to an object parameter schema. Do not assume all variants are fixed solely because an issue is closed.
This group also includes later variants: in the v3.20.0 xAI native Responses path, a root-level union type for `mcp__codex_app__automation_update` was rejected. Maintainers said a fix was merged into main and would ship in the next release. The `list_mcp_resources` `required:null` variant remains an open report; its original issue contains only a proposed patch and no verified general solution.
If the error explicitly includes `codex_app__automation_update` and `type: null`, upgrade to a CC Switch version that includes the v3.18.0 fix, then verify again. This fix covers `parameters:null`, `type:null`, and missing parameters in the Responses-to-Chat path.
If the error changes to `list_mcp_resources: null is not of type "array"`, or `mcp__codex_app__automation_update` still appears in the xAI OAuth native Responses path, the original issues do not provide a verified fix for every scenario. Track the relevant source issue for maintainer releases and verification results.
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 13 real issues
- #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`
- Is there currently a solution for this issue?
- For the `codex_app__automation_update` `parameters.type:null` variant, maintainers said it was fixed in v3.18.0. Check the original issue status separately for later variants such as xAI and `required:null`.
- How should this be fixed?
- First confirm whether this is the `type: null` variant. If so, upgrade to a version that includes the v3.18.0 fix. If the error is `null is not of type "array"` for `list_mcp_resources`, the original issue does not yet provide a verified solution.
Related problems
Section titled “Related problems”This is an unofficial community wiki with no affiliation to the cc-switch authors or the project itself. Its content is compiled from the project's public GitHub issues. This site distributes no software.