{"record":{"id":"126de4b7a97498d7","repo":"Aider-AI/aider","slug":"move-to-action-missing-path","errorCode":null,"errorMessage":"Move to action missing path.","messagePattern":"Move to action missing path\\.","errorType":"exception","errorClass":"DiffError","httpStatus":null,"severity":"error","filePath":"aider/coders/patch_coder.py","lineNumber":322,"sourceCode":"\n            if norm_line == \"*** End Patch\":\n                index += 1\n                break  # Successfully reached end\n\n            # ---------- UPDATE ---------- #\n            if norm_line.startswith(\"*** Update File: \"):\n                path = norm_line[len(\"*** Update File: \") :].strip()\n                index += 1\n                if not path:\n                    raise DiffError(\"Update File action missing path.\")\n\n                # Optional move target\n                move_to = None\n                if index < len(lines) and _norm(lines[index]).startswith(\"*** Move to: \"):\n                    move_to = _norm(lines[index])[len(\"*** Move to: \") :].strip()\n                    index += 1\n                    if not move_to:\n                        raise DiffError(\"Move to action missing path.\")\n\n                if path not in current_files:\n                    raise DiffError(f\"Update File Error - missing file content for: {path}\")\n\n                file_content = current_files[path]\n\n                existing_action = patch.actions.get(path)\n                if existing_action is not None:\n                    # Merge additional UPDATE block into the existing one\n                    if existing_action.type != ActionType.UPDATE:\n                        raise DiffError(f\"Conflicting actions for file: {path}\")\n\n                    new_action, index, fuzz = self._parse_update_file_sections(\n                        lines, index, file_content\n                    )\n                    existing_action.chunks.extend(new_action.chunks)\n\n                    if move_to:","sourceCodeStart":304,"sourceCodeEnd":340,"githubUrl":"https://github.com/Aider-AI/aider/blob/5dc9490bb35f9729ef2c95d00a19ccd30c26339c/aider/coders/patch_coder.py#L304-L340","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"# before\n*** Update File: old.py\n*** Move to:\n@@\n context\n*** End Patch\n\n# after\n*** Update File: old.py\n*** Move to: new.py\n@@\n context\n*** End Patch","handlingStrategy":"validation","validationCode":"import re\n\ndef empty_move_targets(patch_text: str) -> list[str]:\n    return [l for l in patch_text.splitlines() if re.fullmatch(r\"\\*\\*\\* Move to:\\s*\", l)]\n# non-empty → fill the destination or delete the line before get_edits()","typeGuard":null,"tryCatchPattern":"try:\n    coder.get_edits(patch_text)\nexcept ValueError as e:\n    if \"Move to action missing path\" in str(e):\n        patch_text = fix_or_drop_empty_moves(patch_text)\n        coder.get_edits(patch_text)\n    else:\n        raise","preventionTips":["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."],"tags":["aider","patch-format","parsing","rename"],"backgroundTag":null,"analyzedSha":"5dc9490bb35f9729ef2c95d00a19ccd30c26339c","analyzedAt":"2026-08-15T05:40:10.498Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}