跳转到内容

Codex DeepSeek HTTP 400 报错 - CC Switch

Quick fix

升级到 v3.18.0 修复工具 schema 400;多轮 tool_call_id 与 Responses 原生模式问题需按场景处理。

报错原文
CC Switch local proxy failed while handling Codex endpoint /responses. Provider: DeepSeek; model: deepseek-v4-flash; 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 经 CC Switch 接入 DeepSeek 时的 HTTP 400 问题。最常见的是 Codex 内置工具 codex_app__automation_update 在 Responses API 中的 parameters 字段为 JSON null,CC Switch 转换为 Chat Completions 格式后,DeepSeek 等严格校验上游拒绝并返回 400。此问题在 v3.18.0 通过 PR #4706 / #5315 修复,会把工具 parameters 归一为 {"type":"object"}。另有连续会话时缺少 messages.tool_call_id 的 400 报错,归并到 #4973 跟踪。还有 DeepSeek 不支持 image_url、上下文超限不自动压缩、模型名拼写错误、Responses 原生模式配置等独立问题。

  1. 将 CC Switch 升级到 v3.18.0 或更新版本,修复 codex_app__automation_update 工具 schema type:null 导致的 HTTP 400。

  2. 如果使用 DeepSeek 时遇到连续多轮对话后报缺少 messages.tool_call_id,请查看 issue #4973 的进展;当前集群中未给出已确认修复版本。

  3. 如果 DeepSeek 已支持 Responses API,可在 CC Switch 中将 DeepSeek provider 切换为 Responses 模式;有用户反馈切换后关闭路由可正常使用,无需手动改 config.toml。

  4. 检查模型名是否拼写正确,例如应使用 deepseek-v4-flash 或 deepseek-v4-pro,不要传入 deepseek-v4-falsh。

ToolCodex
Version3.16.1 - 3.17.0 受影响;v3.18.0 修复工具 schema type:null 问题
PlatformsWindowsmacOS
升级到 v3.18.0 后所有 DeepSeek 400 都会消失吗?
不一定。v3.18.0 明确修复的是 codex_app__automation_update 等工具 parameters 为 type:null 导致的 400。缺少 messages.tool_call_id、上下文超限、图片识别、模型名错误等是不同问题。
DeepSeek 能识别图片吗?
有 issue 显示 deepseek-v4-pro 无法识别 image_url,维护者表示 CC Switch 无法做到,需要 DeepSeek 模型本身支持多模态。
DeepSeek 支持 Responses API 后 config.toml 怎么写?
有用户反馈直接把 DeepSeek 设置切换到 Responses 模式并关闭路由即可正常使用,不需要手动修改 config.toml;但不同环境可能有差异。
上下文超过 256K 后为什么会报错?
有 issue 报告通过 CC Switch + Codex 时上下文超限会直接返回 400,不会自动压缩;该问题未在本集群中确认修复。

这是一个非官方社区 wiki,与 cc-switch 作者及项目本身无隶属关系。内容整理自项目公开的 GitHub issues。本站不分发任何软件。