Skip to content

Commit 3ab1342

Browse files
Copilotalexr00
andauthored
Fix: Use rawComment.body in applySuggestionWithCopilot to exclude AI warning suffix
When applying a suggestion using AI for Copilot Code Review comments, the rendered comment body included the "Copilot is powered by AI, so mistakes are possible" suffix. Use rawComment.body instead to get the original comment text without the display-only warning. Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com> Agent-Logs-Url: https://github.com/microsoft/vscode-pull-request-github/sessions/a47a6887-194e-4dd7-966a-3459c61cc24c
1 parent 0ca1c3c commit 3ab1342

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/commands.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1848,9 +1848,10 @@ ${contents}
18481848

18491849
const isThread = GHPRCommentThread.is(comment);
18501850
const commentThread = isThread ? comment : comment.parent;
1851-
const commentBody = isThread ? comment.comments[0].body : comment.body;
1851+
const firstComment = isThread ? comment.comments[0] : comment;
18521852
commentThread.collapsibleState = vscode.CommentThreadCollapsibleState.Collapsed;
1853-
const message = commentBody instanceof vscode.MarkdownString ? commentBody.value : commentBody;
1853+
const message = firstComment instanceof GHPRComment ? firstComment.rawComment.body
1854+
: (firstComment.body instanceof vscode.MarkdownString ? firstComment.body.value : firstComment.body);
18541855

18551856
if (isThread) {
18561857
// For threads, open the Chat view instead of inline chat

0 commit comments

Comments
 (0)