Lesstep
Azure DevOps Services · REST API, Azure CLI and review tools · Checked October 29, 2026

Azure DevOps: TF401192 when completing a pull request

TF401192 refuses a completion because the pull request has moved on: its source branch got new commits after the page, the tool or the script that completes it read the pull request. Azure DevOps answers with HTTP 409 Conflict instead of merging commits that whoever completes it may not have seen. Nothing was merged: read the pull request again, look at the new commits, and complete it again.

The answer

A completion is a PATCH of the pull request with "status": "completed" and lastMergeSourceCommit, the source commit the caller read. When that commit is no longer the head of the source branch, Azure DevOps answers:

HTTP/1.1 409 Conflict

{"message":"TF401192: …","typeKey":"GitPullRequestStaleException", …}

Public reports from 2026 show it. Four tools that complete pull requests on Azure DevOps sent an old source commit on purpose against real repositories in September and October and got 409 TF401192; a tool that seeds test repositories got it in January after force-pushing a source branch and completing at once. The wording after "TF401192:" differs between the reports, so it is not quoted here.

Not reproduced here: the status code, the code and the typeKey come from those reports. Not checked on Azure DevOps Server.

Where the new commits come from

What to do

  1. In the web: reload the pull request. The new pushes are on its Updates tab and the commits on Commits. Look at them, then select Complete again.
  2. If the approvals are gone: a branch policy can reset votes when new changes are pushed, and then the completion waits for the approvals again. See minimum number of reviewers for the options.
  3. In a script: send the commit you reviewed or tested, not one read again just before completing:
    PATCH https://dev.azure.com/<organization>/<project>/_apis/git/repositories/<repository>/pullrequests/<id>?api-version=7.1
    
    {"status": "completed",
     "lastMergeSourceCommit": {"commitId": "<the commit you reviewed>"},
     "completionOptions": {"mergeStrategy": "squash"}}
    Treat 409 with TF401192 (or GitPullRequestStaleException) as "new commits came in", not as a failure to retry blindly. Read the pull request again and decide: if the new commits need a review or a new build, stop there; retry at once only if the script means to merge whatever is on the branch.

Azure DevOps pull requests in IntelliJ IDEA and Rider

Azure DevOps Pull Requests, a plugin by Lesstep for JetBrains IDEs 2024.1 or later and Android Studio, reads the organization, project and repository from your git remote and lists the pull requests that wait for your review in an IDE tool window, on Azure DevOps Services and on Azure DevOps Server. You can vote, comment and complete without leaving the IDE. From version 1.0.43, Complete merges the version of the pull request you have open: it sends the source commit whose changes are on your screen. When Azure DevOps refuses with TF401192, the plugin says that new commits came in after you opened it at that commit, and reloads the pull request with them so you can look at them and complete again. The review inbox is free; voting, commenting, completing and creating are Pro, with a 30-day trial.

Get it on JetBrains Marketplace

Azure DevOps is a trademark of Microsoft Corporation; IntelliJ IDEA and Rider are trademarks of JetBrains s.r.o. This page is not affiliated with or endorsed by Microsoft or JetBrains.

More: TF401181: the pull request was completed or abandoned · A completion refused by a branch policy · TF401398: the source or the target branch is missing · The merge types · 日本語