Select text in a chat response, add an optional comment and images, and attach it to the chat input as a chip, similar to "Add Selection to Chat".
Usage
Select text inside a chat response. A Comment button appears.
Click Comment to open the "Add an optional comment..." box.
Type a comment. Add images by pasting (Ctrl+V) or with the paperclip button, which accepts several images.
Press Enter or click the arrow button. Shift+Enter adds a new line, Esc or a click outside closes the box.
The selection and your comment go into one chip named Selected response <time>. Images become separate image chips, and the comment chip lists their names so the model can tell which images belong to which comment.
Setup
Install the .vsix.
Run Chat Selection Comment: Enable from the Command Palette, then reload the window.
To remove it, run Chat Selection Comment: Disable and reload.
How it works
VS Code has no extension API for adding buttons to chat responses. This extension copies a script next to workbench.html in the VS Code install folder and adds a <script> tag. A backup is saved as workbench.html.before-chat-actions.bak.
Limitations
VS Code may show an "installation appears to be corrupt" warning.
A VS Code update restores workbench.html and removes the script. The extension offers to enable it again on the next start.
The install folder must be writable. A per-user install under AppData works; a system-wide install may need elevated rights.
Image chips depend on the chat's built-in paste handling, which needs an extension that provides chatReferenceBinaryData. Without it, images may not become chips.
The script relies on internal class names of the chat UI, which can change between VS Code versions.
Only images are supported. Other file types are not.
The setting chat.pasteAsAttachmentThreshold affects every paste into the chat input. A low value turns ordinary pastes into chips.
Not tested in Remote or WSL windows.
Manual restore
Close VS Code, then copy workbench.html.before-chat-actions.bak over workbench.html in the same folder and delete chat-selection-actions.js.