#3464·pr-agent

Azure DevOps renames lose the original path and content

Author: oleksii-tumanovCreated Sep 17, 2026Updated Sep 18, 2026

Git provider

Azure

System Info

PR-Agent main at f7da79cf; Azure provider unit fixture using azure-devops 7.1.0b4. No live Azure tenant was used.

Bug details

Azure rename changes are currently treated like added files. get_diff_files() reads the head content from the new path, but it does not retain the old path or read the base content from it. As a result, a pure rename can appear as a full-file addition, and rename-with-edit patches include unchanged content instead of only the real edits.

A controlled rename from /old/name.py to /new/name.py returns a FilePatchInfo with old_filename=None and an empty base_file, even when Azure includes the old path in originalPath or sourceServerItem.

Expected behavior:

  • retain the old path as old_filename;
  • read base content from the old path at the merge-target commit, or at the last-seen commit for incremental reviews;
  • keep the new path for head content and suggestion anchors;
  • preserve the current empty-base fallback if Azure does not return usable rename metadata.