Lesstep
Azure DevOps Services and Server · REST API, pipelines and review tools · Checked October 24, 2026

Azure DevOps: "TF401181: The pull request cannot be edited due to its state."

TF401181 means the pull request is no longer active: it was completed or abandoned. Votes and changes such as abandoning it or editing its description are refused from then on. The usual cause is timing: someone else completed it, its auto-complete merged it when the last policy passed, or you closed it in another tab, after the page or the tool you are using loaded it.

The whole answer

As public reports from 2021 to August 2026 quote it, from the REST API, dependency-update pipelines and review tools:

HTTP/1.1 400 Bad Request

{"$id":"1","innerException":null,"message":"TF401181: The pull request cannot be edited due to its state.","typeName":"Microsoft.TeamFoundation.Git.Server.GitPullRequestNotEditableException, …"}

The reports name these requests:

Not reproduced here: the status code and the requests above come from those reports.

See who closed it, and when

What to do

  1. It was abandoned, and the work goes on: reactivate it. In the web, open it from the Abandoned tab and select Reactivate; with the Azure CLI, az repos pr update --id <id> --status active. Then vote or change it again. (Microsoft: abandon or reactivate a pull request)
  2. It was completed: the changes are already merged and the pull request stays closed. A vote no longer counts for anything. To add more, push to a branch and open a new pull request. To undo the merge, open the completed pull request and select Revert: it creates a branch that undoes the changes, for a new pull request. (Microsoft: revert a completed pull request)
  3. It was merged too early by auto-complete: auto-complete merges as soon as the required policies pass, so required reviewers are what holds it back. Revert as above if needed.
  4. In a pipeline or a script that changes pull requests it listed earlier, read the pull request again and skip it when status is not active, or treat TF401181 (or GitPullRequestNotEditableException) as "already closed" instead of failing the run. The report on the dependency-update pipeline asked for exactly that: skip pull requests that are already abandoned.

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.40, when Azure DevOps refuses a vote, a completion or an abandon with TF401181, it says that the pull request was completed or abandoned and by whom, and reloads the list. 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: TF401179: an active pull request already exists · TF401027: a missing Git permission · TF401398: the source or the target branch is missing · A completion refused by a branch policy · TF401180: the requested pull request was not found · TF401192: new commits came in before completing · 日本語