Skip to content

[BUG] Grok 4.3 "Unable to apply diff" - Expected '=======' was not found. #186

@jcalfee

Description

@jcalfee

Problem (one or two sentences)

Grok 4.3 frequently generates malformed or truncated diffs that fail to apply in Zoo Code, producing the error: "Unable to apply diff to file: ... ERROR: Unexpected end of sequence: Expected '=======' was not found."

Context (who is affected and when)
Affects users editing files with Grok 4.3 in Zoo Code's diff/edit mode. Happens during normal code editing tasks.

Reproduction steps

  1. Use Grok 4.3 (or similar Grok coder variant) in Zoo Code.
  2. Ask it to make changes to a file via diff.
  3. The model outputs an incomplete diff missing the expected ======= separator.
  4. Zoo Code's apply_diff tool fails with the exact error shown in the attached screenshot.

Expected result
The diff should apply cleanly, or Zoo Code should gracefully handle/fallback on malformed output from the model.

Actual result
Edit fails with "Unable to apply diff" and the sequence error.

Variations tried (optional)

  • Retrying the same prompt (sometimes succeeds, often fails again).
  • More explicit prompts asking for clean unified diffs.

App Version
v3.54.1

API Provider
xAI / Grok

Model Used
Grok 4.3

Zoo Code Task Links (optional)
(none)

Relevant logs or errors (optional)

Unable to apply diff to file: /home/user/dev/ipall/apps/backup/ipfs-backup/lib/common.sh

<error_details>
ERROR: Unexpected end of sequence: Expected '=======' was not found.
</error_details>
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions