Skip to content

Chat hides code blocks on initial render #304116

Closed

Description

Type: Bug

Occasionally the chat ask functionality will fail to show code blocks.

For example, I asked the chat a question and received this response. Note the example code block shows correctly, but each of the bullet points should have code blocks as well.

Initial Render

Image

Second Render

This is shown when I click out of the chat (viewing all sessions) then re-enter the chat session.

Image

Extension version: 0.41.2026032301
VS Code version: Code - Insiders 1.113.0-insider (Universal) (2b44ec5, 2026-03-22T18:56:52-07:00)
OS version: Darwin arm64 25.3.0
Modes:

Logs
Debug: Finished handling auth change event.
Debug: Handling onDidChangeSession.
Debug: Handling onDidChangeSession.
Debug: Ado auth state changed, firing event. Had token before: true. Has token now: true.
Debug: Finished handling auth change event.
Debug: Ado auth state changed, firing event. Had token before: true. Has token now: true.
Debug: Finished handling auth change event.
Trace: [NES][Triggerer][onDidChangeTextDocument] Return: ignored document
Trace: [NES][Triggerer][onDidChangeTextDocument] Return: ignored document
Trace: [NES][Triggerer][onDidChangeTextDocument] Return: ignored document
Trace: [NES][Triggerer][onDidChangeTextDocument] Return: ignored document
Trace: [NES][Triggerer][onDidChangeTextDocument] Return: ignored document
Trace: [NES][Triggerer][onDidChangeTextDocument] Return: ignored document
Trace: [NES][Triggerer][onDidChangeTextDocument] Return: ignored document
Trace: [NES][Triggerer][onDidChangeTextDocument] Return: ignored document
Trace: [NES][Triggerer][onDidChangeTextDocument] Return: ignored document
Trace: [NES][Triggerer][onDidChangeTextDocument] Return: ignored document
Trace: [NES][Triggerer][onDidChangeTextDocument] Return: ignored document
Debug: Handling onDidChangeSession.
Debug: Handling onDidChangeSession.
Debug: Handling onDidChangeSession.
Debug: Ado auth state changed, firing event. Had token before: true. Has token now: true.
Debug: Ado auth state changed, firing event. Had token before: true. Has token now: true.
Debug: Finished handling auth change event.
Debug: Finished handling auth change event.
Debug: Ado auth state changed, firing event. Had token before: true. Has token now: true.
Debug: Finished handling auth change event.
Debug: Handling onDidChangeSession.
Debug: Handling onDidChangeSession.
Debug: Handling onDidChangeSession.
Debug: Ado auth state changed, firing event. Had token before: true. Has token now: true.
Debug: Ado auth state changed, firing event. Had token before: true. Has token now: true.
Debug: Finished handling auth change event.
Debug: Finished handling auth change event.
Debug: Ado auth state changed, firing event. Had token before: true. Has token now: true.
Debug: Finished handling auth change event.
Debug: [context keys] Window state change. Needs offline check: false, active: true, focused: false.
Debug: Handling onDidChangeSession.
Debug: [context keys] Window state change. Needs offline check: false, active: true, focused: true.
Debug: [CopilotCLI] Found 0 JSONL sessions and 0 legacy sessions
Debug: Handling onDidChangeSession.
Debug: Ado auth state changed, firing event. Had token before: true. Has token now: true.
Debug: Finished handling auth change event.
Debug: Ado auth state changed, firing event. Had token before: true. Has token now: true.
Debug: Finished handling auth change event.
Trace: RemoteEmbeddingsComputer::computeEmbeddings started
Debug: Handling onDidChangeSession.
Trace: RemoteEmbeddingsComputer::computeEmbeddings success. Elapsed 224.43779199942946
Debug: Related Information: Remote similarly request took 225ms
Debug: Related Information: Successfully Calculated, returning 231ms
Request IDs
bdbd6bc0-05f4-48a4-afeb-eb9a8aa18168
42b78d54-407d-4f92-8798-c6802d6edf47
ca3018f3-a188-4b70-a207-57145a18f41c
0e2c7818-fc78-44a3-84a5-dc2dfa45d75e
19857609-0bd5-4b8d-8109-8a6a2dbc51cd
3271a028-ca05-4158-addb-eed546f4e5d1
688cd2fb-d8ad-448e-8f3a-2e1b2daf181c
7c17800d-6279-44a3-b239-56b5cb8c3973
030a3a2b-25d8-422e-ab3d-65d03574428e
fd3efca7-c664-40d7-8c76-1534864cb19e
60dad913-437a-488c-8da6-cba84af6560d
c616cbe2-3483-48ad-bcf1-5b86211180cc
25410469-e2c7-4ded-8b0e-61e9f42ca931
374f6429-1955-4654-8ddd-c6f50ae3d865
3fcc797b-caf0-48f6-a209-30964d6d816d
4e440c4d-8455-4186-b2fe-ada466a6f1dc
75d58959-3337-44b5-91cf-c92e7b15fa67
ec9834f6-1be6-4dae-b2b4-60b3956857f2
166afd20-dd1b-4507-84f6-87a8b1cd19b0
59f3a3ef-0a64-4bdf-b3a6-1e901f41fc1d
1a2ae46e-ee2f-4f8e-8349-cea3983262fc
ae9ec394-436b-4a97-b561-1cd9b62ab2f2
2c54beaa-1d29-4154-a1eb-207d4e4f8691
3572af9d-09c2-4f94-84b2-3188c52daf19
9e01489d-8a09-4cc2-80f7-54923387b98d
efc86105-67ed-43d7-a795-163bc7018607
4c881b16-b954-42a8-b0c3-ee9b9683a823
335fefcc-3977-4fc1-90b6-bbdbf33fd464
3ec308fa-d73f-4206-b06e-bc190c5a4e73
81f3a0ec-c425-4618-92b8-71ac96ac51b6
59771ac0-dde0-4ef1-a5ea-33b61cdbc593
4206dc7e-9cef-4d62-acc2-e8883c44fc97
56618d18-d344-4def-aa04-8efe7ed39c7b
c2e3c671-4db9-4c21-b524-d0d274471052
4c790ba1-57fe-4a5f-81cc-b92e7e05d9da
db8a3d0e-bcb1-416e-bd98-a12ea7b39f86
d0967179-f013-48be-9b7b-65690104e17c
4c729c86-2b0c-48f5-9003-bf05312e086e
7b22d585-fdd7-4e8a-81a2-a21dcd976dd1
d7ca0fb9-dfba-4e08-bdb5-0189dc2629bd
a6001020-7a98-4413-ac14-5566be01b87e
aa4218f7-7224-4636-88d5-7784b83b84d9
49f743ec-dd9a-496b-ab87-21ed3c366861
ea7ffa5d-1f33-4838-bd01-25a0de822ec9
342e3586-811d-42c1-8126-9fcac8115b16
020f35f1-06b0-4b7c-8b5c-fc1eefa6a757
defb268a-f15b-4962-ab28-345606d9c31f
83b6f202-ea0d-4c29-bd10-a69c40ac85f8
df1523a4-f07d-4fae-852d-48bf3b874f78
System Info
Item Value
CPUs Apple M4 Pro (12 x 2400)
GPU Status 2d_canvas: enabled
GPU0: VENDOR= 0x106b [Google Inc. (Apple)], DEVICE=0x0000 [ANGLE (Apple, ANGLE Metal Renderer: Apple M4 Pro, Version 26.3.1 (a) (Build 25D771280a))], DRIVER_VENDOR=Apple, DRIVER_VERSION=26.3.1 ACTIVE
Machine model name: Mac
Machine model version: 16.8
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: enabled_on
trees_in_viz: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) 3, 4, 4
Memory (System) 24.00GB (0.08GB free)
Process Argv --log info --crash-reporter-id c44dbb81-faad-4a28-91b9-73596549599f
Screen Reader no
VM 0%
A/B Experiments
vsliv368:30146709
pythonvspyt551:31249597
nativeloc1:31118317
dwcopilot:31158714
dwoutputs:31242946
copilot_t_ci:31333650
g012b348:31231168
pythonrdcb7:31268811
pythonpcpt1cf:31399617
6518g693:31302842
6abeh943:31336334
envsactivate1:31349248
editstats-enabled:31346256
cloudbuttont:31366566
3efgi100_wstrepl:31403338
55ia6109:31457054
use-responses-api:31390341
je187915:31401257
cp_cls_t_966_ss:31454198
inlinechat_v2_hd992725:31445440
c0683394:31481635
c3h7c220:31478652
ge8j1254_inline_auto_hint_haiku:31426887
38bie571_auto:31478677
cp_cls_c_1081:31454833
conptydll_false:31480679
ia-use-proxy-models-svc:31446143
core-renderer-profiling-on:31440366
a43f0576c:31442820
e9c30283:31453065
test_treatment2:31471001
h_5b0j5247:31480642
idci7584:31454084
nes-ftch-ctrl:31458523
nes_chat_context_enabled:31451401
e3e4d672:31454087
showingstats:31457201
ei9d7968:31462942
534a6447:31478742
hg17d649:31455236
nes-extended-on:31455475
agentwelcome:31461166
quick_suggest_off_75197330:31462668
89g7j272:31480197
hhf17803:31462392
bg_compact_t:31477450
t-some:31466503
dfc2j404:31470440
cpptoolsoff-v2:31475362
c795h766_force_extended_thinking:31479458
i2gc6536:31472020
inline_hover_fd9bg283:31474549
h08i8180:31475367
23c7c724:31481452
client_tst_t:31481009
po_com_t:31475410
ddid_t:31478204
exec20_idhe7308:31480104
ahei0758:31480085

Activity

  1. roblourens commented on Mar 23, 2026

    @roblourens
    Member

    Do you see any errors in the Window output channel when they are missing?

  2. added
    info-needed
    on Mar 23, 2026
  3. yamachu commented on Mar 24, 2026

    @yamachu
    Contributor

    I'm having the same issue.

    On my environment, it has no errors.

    2026-03-24 16:39:01.583 [info] [Window] ChatService#cancelCurrentRequestForSession: No pending request was found for session vscode-chat-session://local/NmE5MTFmNWQtYWY1Zi00NGNkLTkzMzItZTYxODU2M2IwOGU2. requestInProgress=false, pendingRequests=0
    2026-03-24 16:39:01.629 [info] [Window] [ChatSuspendThrottlingHandler] background throttling suspended
    2026-03-24 16:39:05.471 [info] [Window] [ChatSuspendThrottlingHandler] background throttling resumed
    

    Of course, Agent response has code blocks.

    Details

    --- Response ---
    Some messages....

    For example, ~~~:

    jq 'keys'

    Other case, ~~~:

    jq -r 'keys[]'

    And, ~~~:

    jq -r 'paths | map(tostring) | join(".")'

    In this case, ~~~:

    jq -r '.[0].record | keys[]'

    In the above case, only the following code blocks will be displayed.

    jq -r '.[0].record | keys[]'
  4. kh4f commented on Mar 25, 2026

    @kh4f

    Same here. Only the last code block (or none at all) is displayed in the response.

    This was caused by PR #303620

    Image Image
  5. justschen commented on Mar 25, 2026

    @justschen
    Collaborator

    sorry about that - cc Matt Bierner (@mjbvz) on #303620

  6. rianquinn commented on Mar 25, 2026

    @rianquinn

    Can you show me, in 3 different code blocks, each command, to get the current dir, then get the first 20 lines of the first file in the dir, and then echo hello workd

    Image

    This is happening to me constantly.

  7. justschen commented on Mar 25, 2026

    @justschen
    Collaborator
    Screen.Recording.2026-03-25.at.10.25.44.AM.mov

    looks like we're eagerly disposing of the reference there. above PR should fix, double checking if it has any implication on #303547

  8. added this to the 1.114.0 milestone on Mar 25, 2026
  9. garretwilson commented on Mar 25, 2026

    @garretwilson

    This may be the bug I just filed as #304902. Note that in one case restarting VS Code made the blocks appear.

    The behavior is distinct from #280071, though. I can't say for sure, but it may in fact be a more severe regression of #280071, because sometimes the block appears and goes blank before it disappears altogether.

  10. jbaart37 commented on Mar 25, 2026

    @jbaart37

    looks like you are on it ... if additional evidence helps:
    When using Chat in VS Code (Copilot Chat / Agent Chat), responses that contain multiple fenced code blocks render correctly initially, but earlier code blocks are removed from the chat UI after streaming completes. Only the final fenced code block remains visible - either in ASK or AGENT mode.

    Observation:

    • The first code block appears briefly
    • After the response finishes streaming, earlier code blocks disappear
    • Only the last fenced code block remains

    In Chat Debug View

    • The full response (including missing blocks) is present (under debug->response)
      Earlier fenced code blocks are removed from the chat UI after streaming completes; only the final code block is rendered.

    • Chat Debug view shows the full assistant response

    • Chat UI drops earlier code blocks after render

    • Reloading the VS Code window (or VS Code restart) restores the missing blocks temporarily - but eventually disappear again.

    • Clearing %APPDATA%\Code\User\globalStorage\globalStorage\github.copilot-chat did not resolve issue

    Version: 1.113.0
    Date: 2026-03-24T15:07:18+01:00
    Electron: 39.8.3
    ElectronBuildId: 13620978
    Chromium: 142.0.7444.265
    Node.js: 22.22.1
    V8: 14.2.231.22-electron.0
    OS: Windows_NT x64 10.0.26200

  11. added
    unreleased
    on Mar 26, 2026
  12. 15 remaining items

  13. stevenh commented on Mar 31, 2026

    @stevenh

    As this basically breaks copilot for any code responses, I'm hoping a release will be prioritised 🙏

  14. TCPsoftware commented on Mar 31, 2026

    @TCPsoftware

    Thanks for the quick fix!

    But this is not fixed, and it's not scheduled to be released until v1.114.0 on 2026-03-29, according to this ticket.

    I've found a workaround: one can invoke Developer: Reload Window, which is almost as brute-force as restarting the application. It quickly gets in the way of normal work if I have to essentially reload everything after every single LLM response.

    It seems that there is a insider version binary(1.114.0) on the official site: https://code.visualstudio.com/insiders

    It may have solved the problem, but it might also have created more issues.

  15. stevenh commented on Mar 31, 2026

    @stevenh

    I found that "Move Chat into Editor Area" and "Move Chat to New Window" also fixes, still far from ideal, needs a hotfix release IMO.

  16. mwchatten commented on Mar 31, 2026

    @mwchatten

    Going back to Sessions tab, then back into your active chat, also brings back the missing code windows. But yeah needs hotfix.

    Edit: however this seems to only work for the most recent message in the chat.

  17. kh4f commented on Mar 31, 2026

    @kh4f

    How did this even ship to stable if the bug was already known in Insiders?

  18. smietanka commented on Mar 31, 2026

    @smietanka

    why its closed as it still exists? :P

  19. ryancabanas commented on Mar 31, 2026

    @ryancabanas

    why its closed as it still exists? :P

    The PR has been merged, but I'm guess until they get all of these milestone issues resolved, the won't release.

  20. garretwilson commented on Apr 1, 2026

    @garretwilson

    Now with the release of vGitHub Copilot 0.42.2 coupled with VSCode 1.114.0, GitHub no longer collapses the code blocks. However instead it sometimes blanks them out:

    Image

    Basically it's #280071 all over again (which was never fully fixed in the first place).

    Version: 1.114.0 (user setup)
    Commit: e7fb5e96c0730b9deb70b33781f98e2f35975036
    Date: 2026-04-01T09:27:11Z
    Electron: 39.8.3
    ElectronBuildId: 13658728
    Chromium: 142.0.7444.265
    Node.js: 22.22.1
    V8: 14.2.231.22-electron.0
    OS: Windows_NT x64 10.0.26200
    
  21. locked and limited conversation to collaborators on May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugchatinsiders-releasedverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions