Skip to content

Mark PR review comments as converted when added to agent feedback#303168

Merged
benibenj merged 1 commit intomainfrom
besimmonds/mark-converted-pr-review-comments
Mar 19, 2026
Merged

Mark PR review comments as converted when added to agent feedback#303168
benibenj merged 1 commit intomainfrom
besimmonds/mark-converted-pr-review-comments

Conversation

@benibenj
Copy link
Contributor

Summary

When a PR review comment is converted to agent feedback in the agent sessions editor widget, it now gets locally marked as "converted" and immediately hides from the feedback widget. This marking survives PR poll refreshes so the comment stays hidden.

Additionally, the attachment variable entry now carries the source PR review comment thread ID, and the stringified value sent to the LLM mentions that the feedback originated from a PR comment with its thread ID so it can be resolved when addressed.

Changes

File Change
codeReviewService.ts Added markPRReviewCommentConverted() — tracks converted IDs per session, filters from PR review observable state, and filters during poll rebuilds. Cleans up on session dispose.
agentFeedbackService.ts Added optional sourcePRReviewCommentId to IAgentFeedback interface and addFeedback()/addFeedbackAndSubmit() methods
chatVariableEntries.ts Extended IAgentFeedbackVariableEntry.feedbackItems with optional sourcePRReviewCommentId
agentFeedbackEditorWidgetContribution.ts On convert from PRReview source: calls markPRReviewCommentConverted and passes source thread ID to addFeedback
agentFeedbackAttachment.ts Passes sourcePRReviewCommentId through to variable entry; enriches stringified LLM value with PR comment origin and thread ID

Testing

  • TypeScript compilation passes (compile-check-ts-native)
  • Hygiene pre-commit hook passes

When a PR review comment is converted to agent feedback in the editor
widget, it is now locally marked as converted so it hides from the
feedback widget. The converted state survives PR poll refreshes.

Changes:
- CodeReviewService: track converted PR comment IDs per session, filter
  them from the PR review observable state and poll rebuilds
- AgentFeedbackService: add optional sourcePRReviewCommentId to
  IAgentFeedback and addFeedback()
- IAgentFeedbackVariableEntry: carry sourcePRReviewCommentId through
  to the chat attachment
- AgentFeedbackEditorWidget: on convert, call
  markPRReviewCommentConverted and pass the source thread ID
- AgentFeedbackAttachment: include PR comment origin (thread ID) in
  the stringified value sent to the LLM

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 19, 2026 12:01
@vs-code-engineering vs-code-engineering bot added this to the 1.113.0 milestone Mar 19, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Agent Sessions “PR review → agent feedback” conversion flow so that converted PR review threads are immediately hidden from the PR review/feedback UI and stay hidden across PR poll refreshes, while also threading the originating PR review thread id through feedback attachments so the LLM can reference/resolve it.

Changes:

  • Track “converted” PR review thread ids per session in CodeReviewService and filter them out of PR review observable state (including during poll refresh rebuilds).
  • Extend agent feedback data + chat variable entry payloads to optionally carry the source PR review thread id.
  • Enrich the agent feedback attachment’s stringified value with PR-review origin metadata (thread id) for downstream resolution.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/vs/workbench/contrib/chat/common/attachments/chatVariableEntries.ts Extends the agent feedback variable entry contract to carry an optional PR review source id.
src/vs/sessions/contrib/codeReview/browser/codeReviewService.ts Adds per-session tracking/filtering of converted PR review thread ids and cleans up on session disposal.
src/vs/sessions/contrib/agentFeedback/browser/agentFeedbackService.ts Adds an optional sourcePRReviewCommentId field to feedback items and plumbs it through add APIs.
src/vs/sessions/contrib/agentFeedback/browser/agentFeedbackEditorWidgetContribution.ts When converting from PR review, passes through the PR thread id and marks it converted in code review state.
src/vs/sessions/contrib/agentFeedback/browser/agentFeedbackAttachment.ts Includes the source PR thread id in variable entries and adds PR-origin context to the LLM string value.

You can also share your feedback on Copilot code review. Take the survey.

@benibenj benibenj merged commit 70bc868 into main Mar 19, 2026
23 checks passed
@benibenj benibenj deleted the besimmonds/mark-converted-pr-review-comments branch March 19, 2026 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants