Feature summary (what you would like to be able to do and where):
@Maintenance_bot should only consider the task history since the last comment before the latest addition of Patch-For-Review when determining whether to remove it. (@gerritbot adds a comment about a new patch, and then does it add the tag. This comment right before the addition of the tag should be considered, but nothing earlier.)
Use case(s) (list the steps that you performed to discover that problem, and describe the actual underlying problem which you want to solve. Do not describe only a solution):
Sometimes @Maintenance_bot gets confused and doesn’t remove the Patch-For-Review tag. In this case, humans need to remove the tag. This is unfortunate but unavoidable (e.g. if the patch is uploaded with an incorrect Bug: footer, which is later corrected, the incorrectly referenced task gets the comment about the uploading, but not the one about merging/abandoning the patch). However, if a new patch is uploaded for that task, and it gets the Patch-For-Review tag again, the bot will still not remove the tag once the new patch is merged, as it continues to consider the whole task history, including the confusing part. For example, I manually removed the tag at T313242#8741994, uploaded a new patch, and had to remove the tag manually again in T313242#8766497. This second removal could have been done by the bot if it skipped anything before T313242#8759182.
Benefits (why should this be implemented?):
Less need for manual fixes, less Patch-For-Review tags forgot on tasks, more useful tag.