Client or integration
Codex App
Provider or upstream service
DeepSeek (deepseek/deepseek-v4-flash)
OpenCodex version
2.13.0
Endpoint or capability
Routed Responses / CodeModeOnly tool calls / file editing
Current behaviour
In a fresh Codex App conversation routed through OpenCodex to DeepSeek V4 Flash, the model can emit a top-level apply_patch call even though apply_patch is not present in the top-level tool schema for the request.
That call fails with only:
In the same conversation, patching works through the intended Code Mode path:
exec -> tools.apply_patch(...) -> {}
The file is created, verified, and deleted successfully.
The exposed top-level tools reported for the request include exec, wait, request_user_input, search, and related tools, but not apply_patch.
Expected behaviour
For routed code_mode_only models, tool guidance and accepted tool calls should match the tool schema actually exposed to the model.
If patching is available only through Code Mode, the model should use:
exec -> tools.apply_patch(...)
OpenCodex should not encourage or restore an undeclared top-level apply_patch call. If such a call is nevertheless received, it should produce an actionable compatibility error rather than a bare aborted result.
Minimal redacted request or reproduction
Client: Codex App
OpenCodex: 2.13.0
Provider/model: DeepSeek / deepseek-v4-flash
Conversation: fresh
1. Direct path
tool: apply_patch
result: aborted
2. Code Mode path in the same conversation
tool: exec
inner tool: tools.apply_patch
result: {}
file created, verified, deleted
3. Tool surface
top-level apply_patch: absent
The direct failure was reproduced in another fresh DeepSeek conversation.
Actual response or error
apply_patch -> aborted
exec -> tools.apply_patch(...) -> {}
There is no patch syntax or filesystem error on the failed path. The nested Code Mode path works in the same environment.
Upstream documentation
DeepSeek Tool Calls documentation:
https://api-docs.deepseek.com/guides/tool_calls
Possibly related upstream Codex issue:
openai/codex#30648
Relevant OpenCodex Code Mode work:
#1361
Suggested mapping or implementation notes
The working nested path strongly suggests the patch runtime itself is healthy. The likely failure is a mismatch between the routed CodeModeOnly tool contract and a direct apply_patch call being generated or restored somewhere in the request/response path.
Please inspect:
- CodeModeOnly instructions/guidance for references to direct
apply_patch when that tool is not exposed.
- DeepSeek Responses conversion/restoration for legacy or undeclared custom-tool calls.
- Whether undeclared top-level patch calls should be rejected with a clear diagnostic or mapped to the supported Code Mode path.
Additional context
Controls:
Checks
Client or integration
Codex App
Provider or upstream service
DeepSeek (
deepseek/deepseek-v4-flash)OpenCodex version
2.13.0Endpoint or capability
Routed Responses / CodeModeOnly tool calls / file editing
Current behaviour
In a fresh Codex App conversation routed through OpenCodex to DeepSeek V4 Flash, the model can emit a top-level
apply_patchcall even thoughapply_patchis not present in the top-level tool schema for the request.That call fails with only:
In the same conversation, patching works through the intended Code Mode path:
The file is created, verified, and deleted successfully.
The exposed top-level tools reported for the request include
exec,wait,request_user_input,search, and related tools, but notapply_patch.Expected behaviour
For routed
code_mode_onlymodels, tool guidance and accepted tool calls should match the tool schema actually exposed to the model.If patching is available only through Code Mode, the model should use:
OpenCodex should not encourage or restore an undeclared top-level
apply_patchcall. If such a call is nevertheless received, it should produce an actionable compatibility error rather than a bareabortedresult.Minimal redacted request or reproduction
The direct failure was reproduced in another fresh DeepSeek conversation.
Actual response or error
There is no patch syntax or filesystem error on the failed path. The nested Code Mode path works in the same environment.
Upstream documentation
DeepSeek Tool Calls documentation:
https://api-docs.deepseek.com/guides/tool_calls
Possibly related upstream Codex issue:
openai/codex#30648
Relevant OpenCodex Code Mode work:
#1361
Suggested mapping or implementation notes
The working nested path strongly suggests the patch runtime itself is healthy. The likely failure is a mismatch between the routed CodeModeOnly tool contract and a direct
apply_patchcall being generated or restored somewhere in the request/response path.Please inspect:
apply_patchwhen that tool is not exposed.Additional context
Controls:
exec -> tools.apply_patchsucceeds in the same environment, ruling out the patch engine and filesystem permissions as the primary failure.exec -> tools.apply_patch.Checks
exec -> tools.apply_patchcontrol.