Invalid schema for function 'codex_app__automation_update' - CC Switch
Quick fix
Upgrade cc-switch to v3.18.0+ to fix upstream HTTP 400 errors caused by missing type: object in Codex tool parameters.
Symptom
Section titled “Symptom”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'.When Codex calls built-in tools (e.g., `codex_app__automation_update`), the generated JSON Schema's `parameters` field may be `null`, or top-level `oneOf`/`anyOf` types lack an explicit `type: "object"`. During conversion from Codex Responses API to Chat Completions format for providers like DeepSeek and Kimi, if these non-standard schemas are not defaulted, the upstream provider returns HTTP 400 due to strict validation. Previous versions (e.g., v3.17.0) did not cover cases with `type: null` or top-level union types lacking `type`. This was fixed in v3.18.0 via PR #5315 / #4706; the proxy layer now normalizes such tool parameters to standard schemas containing `type: "object"`.
Check your current cc-switch version; if below v3.18.0, upgrade to the latest version.
Restart cc-switch service and the Codex client to apply the new schema conversion logic.
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 5 real issues
- #4741CC Switch local proxy failed while handling Codex endpoint /responses. Provider: DeepSeek; model: gpt-5.5; upstream_status: HTTP 400; cause: Messages with role 'tool' must be a response to a preceding message with 'tool_calls'
- #4864用codex连cc switch时报错,只能换其他中转,应该是deepseek的规则变了,需要尽快更新一下
- #5046Codex桌面端通过CC Switch接入Kimi K2.7报400
- #5590codex使用deepseek时报错
- #5809CC API 都一直报错如何解决啊
- Why does only codex_app__automation_update error while other tools work?
- Codex generated a special union type or omitted the type declaration for this specific tool's schema, whereas the schemas for other common tools follow standard structures. Thus, only this tool triggered the upstream strict validation failure.
- What should I do if errors persist after upgrading to v3.18.0?
- Ensure you fully restarted both cc-switch and Codex. If issues remain, check logs for other tools or different error codes, which may indicate separate issues (such as issue #6385 regarding model name mismatch).
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.