Skip to content

fix: “View in Chat Panel” with Claude not understanding review comments#295331

Open
1Ninad wants to merge 4 commits intomicrosoft:mainfrom
1Ninad:fix/view-in-chat-panel-claude-context
Open

fix: “View in Chat Panel” with Claude not understanding review comments#295331
1Ninad wants to merge 4 commits intomicrosoft:mainfrom
1Ninad:fix/view-in-chat-panel-claude-context

Conversation

@1Ninad
Copy link

@1Ninad 1Ninad commented Feb 14, 2026

Fixes #292892

Problem

When using Code Review with Copilot and then switching the session to Claude, clicking “View in Chat Panel” and asking something like “Explain your comment” does not work.
Claude cannot understand the original review comment.

Root Cause

The review comment is added to chat as a completed request.
If it was generated by a different agent (Copilot) and the active agent is Claude, Claude does not receive that comment in usable context.

Fix

When sending a message:

  • If the last request was added via “View in Chat Panel” and came from a different agent:
    • Extract its response text.
    • Truncate to 8000 characters (append if needed).
    • Build a new message that:
      • States the comment was added by another participant.
      • Includes the comment inside a --- block.
      • Asks the agent to explain it.
    • Send this instead of the raw user message.

Otherwise, behavior remains unchanged.

Only the outbound request message is modified. No changes to session history, SCM, or other chat logic.

File

  • src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.ts

How to Test

  1. Make local changes.
  2. Run Code Review.
  3. Click “View in Chat Panel” on a comment.
  4. Switch to Claude (Set Session Target) and hit enter.

Before: Claude has no context.
After: Claude correctly explains the review comment.

@1Ninad
Copy link
Author

1Ninad commented Feb 14, 2026

@microsoft-github-policy-service agree

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.

Code Review - doesn't well work with Claude

2 participants