Skip to content

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.

Error output
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"`.

  1. Check your current cc-switch version; if below v3.18.0, upgrade to the latest version.

  2. Restart cc-switch service and the Codex client to apply the new schema conversion logic.

ToolCodex
Versioncc-switch < 3.18.0
PlatformsWindowsmacOS
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).

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.