Skip to content

[Bug]: Adding a review summary to chat loses which side its line comments refer to #38275

Closed

Description

@StiensWout

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/web

Steps to reproduce

  1. Open a GitHub pull request with a submitted review containing a summary and a line comment on the old, deleted side of a changed file.
  2. Open the pull request Summary tab beside a chat composer.
  3. Use Add to chat on the review summary.
  4. Send a question about that review to the agent.

Expected behavior

The attached review identifies comments on the old version of a file as referring to the before side of the diff.

Actual behavior

The attached review gives only the file and line number. A comment on the old line is indistinguishable from a comment on the new line with the same number.

Impact

Major degradation or frequent failure. Anyone adding a GitHub review summary containing comments on deleted lines gives the agent ambiguous locations each time, which can direct its explanation or fix to the wrong code.

Version or commit

main at 38f7761148. The cause is at apps/web/src/components/pullRequest/pullRequestDetail.logic.ts:1343.

Environment

Linux x64, the repository's own tests.

Logs or stack traces

to contain '`src/main.rs` line 12 (before)'
Automated repro

Fails in 2 of 2 runs on main: apply the patch with git apply, then run the command.

diff --git a/apps/web/src/components/pullRequest/pullRequestDetail.logic.test.ts b/apps/web/src/components/pullRequest/pullRequestDetail.logic.test.ts
index 1f348f57af..4f25b26f32 100644
--- a/apps/web/src/components/pullRequest/pullRequestDetail.logic.test.ts
+++ b/apps/web/src/components/pullRequest/pullRequestDetail.logic.test.ts
@@ -1215,6 +1215,21 @@ describe("adding a remark to the chat", () => {
       ].join("\n\n"),
     );
 
+    const beforeContext = buildPullRequestCommentContext(
+      {
+        ...pullRequest,
+        reviewThreads: reviewThreads.map((thread) => ({ ...thread, side: "left" as const })),
+        reviewThreadsTruncated: false,
+      },
+      { kind: "comment", comment: review },
+    )!;
+    const beforeRecord = reviewCommentContextRecord(beforeContext);
+    const beforePrompt = projectComposerContextForProvider({
+      text: formatComposerContextReference(beforeRecord),
+      records: [beforeRecord],
+    });
+    expect(beforePrompt).toContain("`src/main.rs` line 12 (before)");
+
     const sent = reviewCommentContextRecord(
       buildPullRequestCommentContext(
         { ...pullRequest, reviewThreads, reviewThreadsTruncated: false },
cd apps/web && pnpm exec vp test run src/components/pullRequest/pullRequestDetail.logic.test.ts -t 'gives a GitHub review summary'

Workaround

No response

Activity

  1. added
    vouch:trusted
    on Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    vouch:trusted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions