You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Copy button for code snippets only works after AI finishes streaming response #255290
bugIssue identified by VS Code Team member as probable bughelp wantedIssues identified as good community contribution opportunitiesinsiders-releasedPatch has been released in VS Code Insiderspanel-chatverifiedVerification succeeded
Description:
When GitHub Copilot Chat streams code snippets as part of its response, the “Copy” button next to each snippet is disabled or unresponsive until the AI has fully completed its answer. If you try to click “Copy” while the snippet is still rendering, nothing happens. You must wait for the response to finish before copying.
Steps to Reproduce:
Open VS Code with the GitHub Copilot Chat extension enabled.
Ask a question that generates multi‑line code (e.g., “Show me a Node.js HTTP server example.”).
As the AI streams its answer, hover over the partially rendered code block.
Click the “Copy” button beside the snippet before the AI finishes streaming.
Observe that nothing is copied to the clipboard.
Wait for the AI to finish its response, then click “Copy” again—this time it works.
Expected Behavior:
The “Copy” button should work at any point once the code block has begun rendering. Users shouldn’t have to wait for the entire answer to complete before copying.
Actual Behavior:
The “Copy” button only becomes active after the AI completes the full response and finalizes the code block.
Reproducibility:
Consistent – the copy button is unresponsive until the end of every streamed code response.
Additional Context:
This delay interrupts developer workflow when reviewing or reusing code as it is generated.
Possible Areas to Investigate:
Enable copy functionality on partially rendered code blocks
Decouple copy action from stream completion event
Update UI state as soon as any snippet content is available
This seems to be partially fixed in the latest insider builds. I was able to copy the code both while the whole response was streaming and while the individual code block was streaming in
However the copy button flashes if you hover over it during streaming and doesn't always seem to copy correctly
The root cause appears to be the fact that codeBlockParts are being reset and reinitialized during streaming causing toolbar to be recreated - hence the flickering and actions not working. One solution is to reuse codeBlockParts that are unchanged, but that's a large change... Matt Bierner (@mjbvz) FYI
Dmitriy Vasyura (@dmitrivMS) , do you have steps to verify the component while streaming? the original steps from the issue are not working since the js files are generated into files directly and I don't get a chance to see it streaming.
bugIssue identified by VS Code Team member as probable bughelp wantedIssues identified as good community contribution opportunitiesinsiders-releasedPatch has been released in VS Code Insiderspanel-chatverifiedVerification succeeded
Activity
Fix copy button not working during AI streaming in chat
mjbvz commentedon Oct 2, 2025
This seems to be partially fixed in the latest insider builds. I was able to copy the code both while the whole response was streaming and while the individual code block was streaming in
However the copy button flashes if you hover over it during streaming and doesn't always seem to copy correctly
dmitrivMS commentedon Dec 21, 2025
There are several issues here currently:
dmitrivMS commentedon Dec 21, 2025
The root cause appears to be the fact that codeBlockParts are being reset and reinitialized during streaming causing toolbar to be recreated - hence the flickering and actions not working. One solution is to reuse codeBlockParts that are unchanged, but that's a large change... Matt Bierner (@mjbvz) FYI
2 remaining items
fix: preserve code block toolbar visibility during chat streaming (#3…
bryanchen-d commentedon Apr 13, 2026
Dmitriy Vasyura (@dmitrivMS) , do you have steps to verify the component while streaming? the original steps from the issue are not working since the js files are generated into files directly and I don't get a chance to see it streaming.
bryanchen-d commentedon Apr 13, 2026
verified by asking for "generate a long code block"