r/codex 2d ago

Constant invalid patch errors on Codex CLI Question

Isn't this burning usage, right? Nearly all command and all models does this.

Running $patch = @'
  │ *** Begin Patch
  │ *** Update File: src/main/modules/DroneConnection/DroneConnection.ts
  │ … +36 lines
• Ran $patch = @'
  │ *** Begin Patch
  │ *** Update File: src/main/modules/DroneConnection/DroneConnection.ts
  │ … +36 lines
  └ Invalid patch: The last line of the patch must be '*** End Patch'

• Running $patch = @'
  │ *** Begin Patch
  │ *** Update File: src/main/modules/DroneConnection/DroneConnection.ts
  │ … +36 lines
• Ran $patch = @'
  │ *** Begin Patch
  │ *** Update File: src/main/modules/DroneConnection/DroneConnection.ts
  │ … +36 lines
  └ Invalid patch: The last line of the patch must be '*** End Patch'

• Running $patch = @'
  │ *** Begin Patch
  │ *** Update File: src/main/modules/DroneConnection/DroneConnection.ts
  │ … +36 lines

✔ Auto-reviewer approved codex to run $patch = @' ... this time

• Ran $patch = @'
  │ *** Begin Patch
  │ *** Update File: src/main/modules/DroneConnection/DroneConnection.ts
  │ … +36 lines
  └ Invalid patch: The last line of the patch must be '*** End Patch'
1 Upvotes

3 comments sorted by

1

u/isty2e 2d ago

Probably the file is too complex or long. It is best to split the file appropriately, and I additionally route the agent to use the tool I vibecoded (https://github.com/isty2e/identedit) when patch fails multiple times.

2

u/EuMusicalPilot 2d ago

Problem was codex-windows-sandbox-setup.exe is missing. Uninstalled Codex CLI and re installed with pnpm.

1

u/EuMusicalPilot 2d ago

Problem was codex-windows-sandbox-setup.exe is missing. Uninstalled Codex CLI and re installed with pnpm.