Include mermaid tool output when copying chat responses#292772
Draft
Include mermaid tool output when copying chat responses#292772
Conversation
Co-authored-by: pierceboggan <1091304+pierceboggan@users.noreply.github.com>
Co-authored-by: pierceboggan <1091304+pierceboggan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix issue with diagrams not copying from Chat
Include mermaid tool output when copying chat responses
Feb 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Copying chat responses omitted rendered mermaid diagrams when the output came from renderMermaidDiagram tool invocations. This update ensures mermaid tool output is serialized into the copied response text as a proper fenced mermaid block.
text/vnd.mermaidto emit fenced mermaid markdown for copy.Original prompt
This section details on the original issue you should resolve
<issue_title>Copy Chat doesn't copy diagrams when using renderMermaidDiagram </issue_title>
<issue_description>
Type: Bug
Copy Chat doesn't copy diagrams when using renderMermaidDiagram
1- Ask to create diagrams using renderMermaidDiagrams
2- Right click and copy response
3- paste in a markdown file - Note no mermaid diagrams <-
Extension version: 0.37.2026020404
VS Code version: Code - Insiders 1.109.0-insider (Universal) (bdd88df, 2026-02-04T02:00:40.203Z)
OS version: Darwin arm64 25.2.0
Modes:
Logs
Trace: choice {"delta":{"content":""},"finish_reason":null} Trace: [NES][NextEditProvider][f842][_getNextEdit][fetchNextEdit][_executeNewNextEditRequest][XtabProvider][doGetNextEditWithSelection][streamEditsWithFiltering][streamEdits] starting to diff stream against edit window lines with latency 281.1888750000071 ms Trace: choice {"delta":{"content":"\n\n"},"finish_reason":null} Trace: [NES][NextEditProvider][f842][_getNextEdit][fetchNextEdit][_executeNewNextEditRequest][XtabProvider][doGetNextEditWithSelection][streamEditsWithFiltering][streamEdits] Line 0 emitted with latency 281.65779199999815 ms Trace: choice {"delta":{"content":"Here"},"finish_reason":null} Trace: [NES][NextEditProvider][f842][_getNextEdit][fetchNextEdit][_executeNewNextEditRequest][XtabProvider][doGetNextEditWithSelection][streamEditsWithFiltering][streamEdits] Line 1 emitted with latency 281.68758300000627 ms Trace: choice {"delta":{"content":"’s"},"finish_reason":null} Trace: choice {"delta":{"content":" an"},"finish_reason":null} Trace: choice {"delta":{"content":" example"},"finish_reason":null} Trace: choice {"delta":{"content":" Mermaid"},"finish_reason":null} Trace: choice {"delta":{"content":" diagram"},"finish_reason":null} Trace: choice {"delta":{"content":" rendered"},"finish_reason":null} Trace: choice {"delta":{"content":"."},"finish_reason":null} Trace: choice {"delta":{"content":" Want"},"finish_reason":null} Trace: choice {"delta":{"content":" a"},"finish_reason":null} Trace: choice {"delta":{"content":" different"},"finish_reason":null} Trace: choice {"delta":{"content":" style"},"finish_reason":null} Trace: choice {"delta":{"content":" ("},"finish_reason":null} Trace: choice {"delta":{"content":"sequence"},"finish_reason":null} Trace: choice {"delta":{"content":","},"finish_reason":null} Trace: choice {"delta":{"content":" class"},"finish_reason":null} Trace: choice {"delta":{"content":","},"finish_reason":null} Trace: choice {"delta":{"content":" G"},"finish_reason":null} Trace: choice {"delta":{"content":"antt"},"finish_reason":null} Trace: choice {"delta":{"content":")"},"finish_reason":null} Trace: choice {"delta":{"content":" or"},"finish_reason":null} Trace: choice {"delta":{"content":" theme"},"finish_reason":null} Trace: choice {"delta":{"content":"?"},"finish_reason":null} Trace: choice {"delta":{"content":""},"finish_reason":"stop"} Info: message 0 returned. finish reason: [stop] Debug: message 0 details: finishOffset: [undefined] completionId: [{}] created: [{1770184114}] Info: request done: requestId: [17d96803-ebf1-4c9e-99df-f663f5cae2d7] model deployment ID: [] Info: ccreq:2b187fe6.copilotmd | success | copilot-nes-oct | 490ms | [XtabProvider] Trace: [NES][NextEditProvider][f842][_getNextEdit][fetchNextEdit][_executeNewNextEditRequest][XtabProvider][doGetNextEditWithSelection][streamEditsWithFiltering][streamEdits] Line 2 emitted with latency 492.47849999999744 ms Trace: [NES][NextEditProvider][f842][_getNextEdit][fetchNextEdit][_executeNewNextEditRequest][pushEdit] processing edit microsoft/vscode#0 (starts at 0) Trace: [NES][NextEditProvider][f842][_getNextEdit][fetchNextEdit][_executeNewNextEditRequest][pushEdit] resetting shouldExpandEditWindow to false due to NoSuggestions Trace: [NES][NextEditProvider][f842][_getNextEdit][fetchNextEdit][_executeNewNextEditRequest][pushEdit] no edit, reason: noSuggestions Trace: [NES][NextEditProvider][f842][_getNextEdit] resolved firstEdit promise Trace: [NES][NextEditProvider][f842][_getNextEdit] First edit latency: 2601 ms Trace: [NES][NextEditProvider][f842][_getNextEdit] failed to fetch next edit noSuggestions Trace: [NES][NextEditProvider][f842][_getNextEdit] had no edit Trace: [NES][Provider][provideInlineCompletionItems][f842] giving some more time to diagnostics provider Trace: [NES][DiagnosticsNextEditProvider] DiagnosticsInlineCompletionProvider runUntilNextEdit complete (cancelled) Trace: [NES][Provider][provideInlineCompletionItems][f842] no next edit suggestion Info: ccreq:2c450338.copilotmd | markdown Trace: [NES][Provider][handleListEndOfLifetime][f842] List icr-f842b294-24ff-447b-99e1-22dc724a79e9 disposed, reason: Empty Error: Error: Failed to fetch custom instructi...💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.