Environment
- OpenCodex: 2.10.0
- Provider: Cursor
- Model: cursor/grok-4.5
- Codex Desktop: 0.146.0
- OS: Linux
- Current config: nativeLocalExec is enabled
- The same behavior was previously observed with nativeLocalExec disabled as well
Problem
When using cursor/grok-4.5 through OpenCodex with Codex Desktop, file edits repeatedly produce malformed Codex apply_patch calls.
Observed failures include:
- Add-file lines missing the required + prefix
- Invalid hunk/context formatting
- Patch-like text that is not valid Codex freeform patch syntax
Codex then rejects the call locally with errors such as:
apply_patch verification failed: invalid hunk
The OpenCodex request itself completes with HTTP 200, so this does not look like a transport or filesystem failure. The failure appears to occur at the Cursor adapter/model tool-contract boundary.
Expected behavior
The Cursor adapter should either:
- preserve apply_patch as a native custom/freeform tool;
- expose a provider-compatible structured edit tool; or
- clearly report that this model/provider combination cannot reliably execute Codex apply_patch.
A model producing patch-like text that is rejected on every edit attempt makes the Cursor route effectively unusable for repository changes.
Related
I can provide a redacted session capture with the malformed tool arguments and local rejection results if needed.
Environment
Problem
When using cursor/grok-4.5 through OpenCodex with Codex Desktop, file edits repeatedly produce malformed Codex apply_patch calls.
Observed failures include:
Codex then rejects the call locally with errors such as:
The OpenCodex request itself completes with HTTP 200, so this does not look like a transport or filesystem failure. The failure appears to occur at the Cursor adapter/model tool-contract boundary.
Expected behavior
The Cursor adapter should either:
A model producing patch-like text that is rejected on every edit attempt makes the Cursor route effectively unusable for repository changes.
Related
I can provide a redacted session capture with the malformed tool arguments and local rejection results if needed.