diff --git a/pilot/ai_review.py b/pilot/ai_review.py index 0200f18..0f07535 100644 --- a/pilot/ai_review.py +++ b/pilot/ai_review.py @@ -626,15 +626,20 @@ def post_inline_review( ) -> None: """Post a review with a summary body AND positional inline comments. - Each anchored finding becomes one entry in `comments`: - {path, side:"RIGHT", line, body}. The body carries the ```suggestion - fence when the model produced replacement code. + Each anchored finding becomes one entry in `comments`. Gitea 1.26.x anchors + inline review comments with `new_position` (the line in the POST-change file) + + `old_position: 0` — the `line`/`side` fields used by newer Gitea are NOT + honored here and silently leave the comment unpositioned (Gitea then renders + a file-level comment on EVERY diff line of the file, which is the flood we + hit). `f["line"]` is already a validated post-change (RIGHT-side) line from + `split_findings`, so it maps directly to `new_position`. The body carries the + ```suggestion fence when the model produced replacement code. """ comments = [ { "path": f["path"], - "side": "RIGHT", - "line": f["line"], + "new_position": f["line"], + "old_position": 0, "body": inline_comment_body(f), } for f in anchored