TECHNOLOGY

Aider edit-format errors separate proposed code from applied files

In this article
THE QUICK TAKE

Aider needs changes in its selected edit format; readable code in the assistant reply is not proof that the intended file was modified.

Separate proposal from application

Aider displays a plausible replacement function, yet the repository still contains the old code. This can be a patch-application failure rather than a misunderstanding of the algorithm. The editing-problems guide describes responses whose changes cannot be applied because they do not match the expected format. Inspect the application error and the actual file before asking the model to explain the same solution again.

Understand the whole-file protocol

The edit-format reference describes whole as returning a complete updated copy of each changed source file, identified by a path and fenced content. It can be simpler for a model to express, while requiring more output when a large file changes slightly. A complete file is necessary under that protocol; a sketch with omitted unchanged sections is not equivalent to the intended source replacement.

Understand the search-and-replace protocol

The diff format uses file paths and search/replace blocks specifying the old and new text. It reduces repeated output but requires a conforming instruction the application can match to the file. Related formats differ in fencing or protocol details. Do not treat arbitrary familiar-looking unified diff text as interchangeable with every selected format. Keep the current source version available, because a proposed search block based on stale text may not identify the intended location.

Check the configured format and context

The options reference provides --edit-format independently of model selection. The troubleshooting guide recommends inspecting the startup announcement and reducing unrelated context when diagnosing formatting failures. Treat old model examples as historical illustrations rather than a current ranking. Compare the selected protocol with what the response actually returned, then inspect the error; changing providers before locating that mismatch can obscure the original cause without establishing a usable patch.

Verify the resulting behavior after application

A successfully applied edit still needs diff review and the task’s relevant checks. The tool-observation guide distinguishes model output, file mutation, and process results. The task-contract guide defines the behavior the patch must satisfy. Keep those milestones separate in a handoff: proposed, applied, and verified. A syntactically acceptable editing instruction can modify the wrong behavior, just as a correct proposed algorithm can fail to modify any file.

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles