Repository navigation
Closed
Labels
vouch:trustedAuthor is trusted by repo permissions or the VOUCHED list.
Description
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
- 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.
- Open the pull request Summary tab beside a chat composer.
- Use Add to chat on the review summary.
- 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
Metadata
Metadata
Assignees
Labels
vouch:trustedAuthor is trusted by repo permissions or the VOUCHED list.
Activity