Bot comment can be posted on an incorrect line
Background
As mentioned in #455208 (comment 2118762361), it is possible that the comment of the bot will be posted on an incorrect line when reviewing diff files.
Proposed solution
- We derive the line numbers ourselves instead of asking the model to do it.
- e.g. by asking the model to return line contents, so we can grep for them: #492104 (comment 2139696042)
- We provide the diff lines along with old/new line numbers and instruct the model on how to parse it (e.g. XML format)
Edited by François Rosé