Aider-AI/aider · error · DiffError
Move to action missing path.
Error message
Move to action missing path.
What it means
Raised by PatchCoder._parse_patch_text when an optional '*** Move to:' line following an '*** Update File:' header is present but its target path is empty after stripping. Move-to is only valid with a concrete destination path.
Source
Thrown at aider/coders/patch_coder.py:322
if norm_line == "*** End Patch":
index += 1
break # Successfully reached end
# ---------- UPDATE ---------- #
if norm_line.startswith("*** Update File: "):
path = norm_line[len("*** Update File: ") :].strip()
index += 1
if not path:
raise DiffError("Update File action missing path.")
# Optional move target
move_to = None
if index < len(lines) and _norm(lines[index]).startswith("*** Move to: "):
move_to = _norm(lines[index])[len("*** Move to: ") :].strip()
index += 1
if not move_to:
raise DiffError("Move to action missing path.")
if path not in current_files:
raise DiffError(f"Update File Error - missing file content for: {path}")
file_content = current_files[path]
existing_action = patch.actions.get(path)
if existing_action is not None:
# Merge additional UPDATE block into the existing one
if existing_action.type != ActionType.UPDATE:
raise DiffError(f"Conflicting actions for file: {path}")
new_action, index, fuzz = self._parse_update_file_sections(
lines, index, file_content
)
existing_action.chunks.extend(new_action.chunks)
if move_to:View on GitHub (pinned to 5dc9490bb3)
Solutions
- Supply the destination: '*** Move to: new/path/file.py'.
- Remove the '*** Move to:' line entirely if no rename is intended.
- Re-check truncation if the line looks cut off.
- Feed the error back to the LLM for a corrected patch.
Example fix
# before *** Update File: old.py *** Move to: @@ context *** End Patch # after *** Update File: old.py *** Move to: new.py @@ context *** End Patch
Defensive patterns
Strategy: validation
Validate before calling
import re
def empty_move_targets(patch_text: str) -> list[str]:
return [l for l in patch_text.splitlines() if re.fullmatch(r"\*\*\* Move to:\s*", l)]
# non-empty → fill the destination or delete the line before get_edits() Try / catch
try:
coder.get_edits(patch_text)
except ValueError as e:
if "Move to action missing path" in str(e):
patch_text = fix_or_drop_empty_moves(patch_text)
coder.get_edits(patch_text)
else:
raise Prevention
- Only emit '*** Move to:' with a concrete destination path; omit it when not renaming.
- Check patches for placeholder markers before applying.
- Remember Move-to is a rename directive, not an annotation.
When it happens
Trigger: A patch containing '*** Move to:' with no value (or whitespace only) directly after an update header — the parser consumed the line, found the path empty, and raised before parsing hunks.
Common situations: Models emitting the move marker as a placeholder without filling the destination; truncated output; misunderstanding that '*** Move to:' renames the file rather than annotating it.
Related errors
- Conflicting move targets for file: {path}
- Invalid patch line found in update section: {line}
- Invalid line prefix in update section: {line}
- Empty patch section found.
- Error parsing patch content: {e}
AI-assisted analysis of Aider-AI/aider@5dc9490bb3 (2026-08-15).
Data as JSON: /api/errors/126de4b7a97498d7.
Report an issue: GitHub.