Skip to content

The apply_patch tool is unavailable with the Codex proxy on / unsupported call — cc-switch

Quick fix

Upgrade to cc-switch v3.16.2 or newer. On a relay, make sure the backend model matches what Codex expects or tool calls fail with routing on.

Error output
apply_patch 不在当前会话的工具列表中。我的可用工具只有上面列出的那 8 个。
English translation

apply_patch is not in the tool list of the current session. My available tools are only the 8 listed above.

Codex has dedicated model metadata and tool definitions for some built-in GPT/Codex models — the freeform apply_patch tool, for instance. Routed through the cc-switch proxy to DeepSeek or a third-party relay, missing metadata can leave Codex on the fallback prompt/tool configuration, producing a malformed tool call, a stuck execution, or an unsupported call.

cc-switch v3.16.0 tried generating a model catalog resembling gpt-5.5 so Codex would assemble the system prompt and tool metadata, but it did not cover advanced tool fidelity in the Codex Chat route. v3.16.1 added Codex tool context restoration covering tool_search, namespace tools, custom tools, and streamed custom tool input; v3.16.2 went further and fixed Codex Custom Tool Metadata Over Chat Routing, so the freeform apply_patch tool keeps its complete original definition (format and grammar metadata included) when written into the Chat function description, instead of becoming a generic placeholder.

Users also report that with some relays, an incomplete set of backend models means model matching is incomplete and returns 403 without routing on; with routing on, the Codex tool chain fails to match, tool calls fail, loops run forever, and tokens burn for nothing. Connecting to DeepSeek officially and directly usually works after upgrading, but some relays can still fail.

  1. Upgrade cc-switch to v3.16.2 or newer. Maintainers confirm v3.16.2 fixes apply_patch being downgraded or lost when Codex routes to a third-party or official DeepSeek through Chat Completions.

  2. After upgrading, restart cc-switch and Codex, then retest apply_patch or a file-editing task.

  3. If you use the official DeepSeek API, confirm the model name in the provider configuration is correct and the local proxy/routing is on as needed.

  4. If you use a third-party relay, confirm its backend models match what Codex expects. With an incomplete set of backend models, a relay may return 403 without routing on, and may break tool chain matching with routing on.

  5. If it still fails after upgrading, collect your cc-switch version, operating system, Codex version, current provider/routing configuration, reproduction steps, and the relevant logs, and file them or reply on the original issue.

ToolCodex
Version3.16.0 - 3.16.1
PlatformsWindowsmacOSLinux
Why does the official DeepSeek work while a relay fails?
Users report the official DeepSeek working correctly with routing on; some relays have backend models that do not match the official ones exactly, which can return 403 without routing on and break Codex tool chain matching with routing on. Confirm the relay backend model configuration is complete and matches what Codex expects.
Why does it still not work after upgrading to 3.16.1?
v3.16.1 restored part of the Codex tool context, but the freeform apply_patch tool being downgraded under Chat Completions routing was fixed in v3.16.2 through Codex Custom Tool Metadata Over Chat Routing — so you need v3.16.2 or newer.
The apply_patch tool shows only apply_patch, with no apply_patch_add_file / update_file sub-operations. Is that normal?
No. That is the problem before v3.16.2: freeform apply_patch was downgraded to a generic placeholder and lost its sub-operations. On v3.16.2 the complete tool definition should be preserved.
Can a failing tool call burn tokens for nothing?
Users report that with an incompletely matched relay model and routing on, tool calls fail, loop forever, and burn tokens for nothing. Confirm model matching is correct before using routing.

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.