[Bug] CLI returns success but applies no changes when LLM-generated diff has minor whitespace mismatches

Resolved 💬 2 comments Opened Nov 26, 2025 by shankarnagendrasabbella-cpu Closed Jan 31, 2026
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

0.63

What subscription do you have?

iam using gpt oss 120b which is deployed in ibm watson x

Which model were you using?

gpt oss 120b

What platform is your computer?

in vm which is linux based

What issue are you seeing?

I am using CodexCLI to automate updates to Ansible/YAML configuration files. I have observed that when the LLM generates a unified diff (patch), the CLI attempts to apply it but fails silently if there is a minor whitespace or indentation mismatch between the patch and the target file.

The process exits with code 0 (Success), but git diff shows "No uncommitted changes."

What steps can reproduce the bug?

Steps to Reproduce:

Have a target YAML file (e.g., common_vars.yml) with specific indentation.

Invoke codex exec with a prompt to update a variable in that file.

The Agent generates a diff where the context lines have slightly different spacing than the actual file (common with LLMs).

The CLI execution finishes without error.

Result: The file is unchanged on disk.

Observed Behavior: The tool fails to apply the patch due to strict context matching but does not report a failure or fallback to a fuzzy patch application. It creates a "silent failure" state.

Logs/Evidence: In my logs, I see the following behavior:

CodexCLI RAW OUTPUT:
Action: edit(path="common_vars.yml", ...)
'No uncommitted changes' count: 1
"Avoid strict context patches... Instead, output a sed command..."

What is the expected behavior?

Suggested Fix: Please implement "fuzzy patching" (ignoring whitespace) by default for YAML/Code files, or provide a flag (e.g., --fuzzy-patch) to allow the agent to apply changes even if indentation in context lines doesn't match perfectly.

Additional information

_No response_

View original on GitHub ↗

2 Comments

etraut-openai contributor · 9 months ago

Could you use the /feedback slash command to upload the session and post the thread ID here? That will help us investigate further.

Spacing and indentation is significant in some contexts (e.g. in Python, which uses spaces and tabs to delineate code blocks), so I don't know if fuzzy matching is appropriate here.

Most models that I've observed will recover from situations like this by emitting an updated patch. It's possible that the gpt-oss model isn't as persistent.

etraut-openai contributor · 6 months ago

Closing stale bug report. No response to questions.