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
Severe Bug: GitHub Copilot deletes entire session with /compact (information loss) #299477
I was very excited that v1.110.0 contains a /compact command, because it's what I have been begging for in #284474 . Unfortunately the current implementation has a severe bug that irretrievably deletes the entire session and history!!
I have a conversation that has been running for around a week. It has important context.
I issued a prompt for the LLM to create two documents.
The LLM created Document 1.
VS Code started summarizing the conversation (now apparently called "compacting").
I canceled compacting, because I realized VS Code would lose context between documents, so .
I went to a prompt in the conversation history before the prompt to created a document, and selected "Restore Checkpoint", just to back the conversation up. Note that the context meter still showed red. (This is a separate bug in the compact meter—it seems to only get updated after the LLM response—not upon other actions which affect the context size, such as restoring a checkpoint.)
I selected the "Compact" button from the context meter popup window. (My goal was simple: preemptively compact the conversation before producing the two documents, so that compacting would not occur between the document generation.)
Expectation: Selecting "Compact" (or /compact) would merely compact (summarize) the running context in the background, as GitHub Copilot periodically does, leaving the entire conversation session in place. (After all, that's what the documentation says.)
Actual: GitHub Copilot deleted the conversation content of the entire history of the session! Now the week-long session merely display /compact and "Nothing to compact. Start a conversation first."
My entire previous conversation is gone! I can't get it back!
Looking at the VS Code Workspace Storage on the file system, inside chatSessions there seem to be .jsonl and .json files. There is a UUID .jsonl file modified today, which seems to represent this conversation that was cleared. Strangely the conversation seems to go back to the very beginning! And a recent addition to the file shows the /compact command. So why isn't it showing any of the conversation before the /compact command?
This bug is likely related to restoring to a checkpoint immediately before compacting.
For some reason (on a hunch) last night I actually backed up my entire VS Code Workspace Storage before trying out this new v1.110. Luckily I was able to restore this entire session by copying over the appropriate file from chatSessions and the appropriate subfolder from chatEditingSessions. Then:
I went to a prompt in the conversation history before the prompt to created a document, and selected "Restore Checkpoint", just to rewind the conversation.
Important: I issued another prompt.
I selected the "Compact" button from the context meter popup window.
This time compacting worked, without deleting the entire conversation.
I suspect that restoring to a checkpoint and then immediately compacting the conversation probably made VS Code get its wires crossed and somehow make it look as though the entire previous history of the conversation did not exist. I wouldn't be surprised if it's analogous to bad C pointer.
Logan Ramos (@lramos15) this appears to be an issue with the request sent over from the widget. The same scenario but invoking /compact works.
Investigated a bit more since I ran into this while testing some compaction issues.
The issue is a mismatch between how /compact gets submitted via the context widget vs typing it manually.
Context widget path:
The compact button in the context usage widget runs workbench.action.chat.open({ query: '/compact' }) which calls chatWidget.acceptInput() → _acceptInput() directly. In _acceptInput, the checkpoint cleanup block fires — it removes all blocked requests + the checkpoint request from the model. By the time /compact is sent to the extension, most/all of the history has been wiped. The extension gets an empty context.history and says "Nothing to compact."
Manual typing path (Enter key):
When the user types /compact and presses Enter, SubmitAction.run() runs first. It calls model.setCheckpoint(undefined) which clears the checkpoint and unblocks all requests without removing them. Then it calls acceptInput() → _acceptInput(), but now model.checkpoint is undefined so the cleanup block is skipped. All requests stay in the model, history is preserved, and /compact works.
The fix should be in chatWidget.ts_acceptInput — the checkpoint cleanup shouldn't remove requests when the intent is to compact. Or more broadly, the acceptInput codepath called from workbench.action.chat.open should match the SubmitAction behavior and just call setCheckpoint(undefined) to unblock requests instead of deleting them.
Relevant code:
chatWidget.ts ~L2413: checkpoint cleanup in _acceptInput
chatExecuteActions.ts ~L157: SubmitAction clears checkpoint without removing requests
Investigated a bit more since I ran into this while testing some compaction issues.
Bhavya U (@bhavyaus) thank you for the investigation!!! I'm super-excited you could find the problem.
I'd like to point out that I discovered this bug just a few hours after the v1.110 release, and I immediately filed a bug, clearly marking it as "severe", as it deleted information.
I'd like to respectfully say to the GitHub Copilot team that, as a customer paying a very significant amount of money for this product, I find it disappointing and unsettling that my report was completely ignored until one of the team happened to run into the bug themselves.
Bhavya U (@bhavyaus) I still can't reproduce this and am not sure your description matches what is going on here.
Did you validate this? As what it is doing in the submit action case is deleting just the history after the checkpoint which isn't a huge deal as we have restored to the checkpoint. It then runs compact on the remaining history
Activity
garretwilson commentedon Mar 5, 2026
Looking at the VS Code Workspace Storage on the file system, inside
chatSessionsthere seem to be.jsonland.jsonfiles. There is a UUID.jsonlfile modified today, which seems to represent this conversation that was cleared. Strangely the conversation seems to go back to the very beginning! And a recent addition to the file shows the/compactcommand. So why isn't it showing any of the conversation before the/compactcommand?garretwilson commentedon Mar 5, 2026
This bug is likely related to restoring to a checkpoint immediately before compacting.
For some reason (on a hunch) last night I actually backed up my entire VS Code Workspace Storage before trying out this new v1.110. Luckily I was able to restore this entire session by copying over the appropriate file from
chatSessionsand the appropriate subfolder fromchatEditingSessions. Then:This time compacting worked, without deleting the entire conversation.
I suspect that restoring to a checkpoint and then immediately compacting the conversation probably made VS Code get its wires crossed and somehow make it look as though the entire previous history of the conversation did not exist. I wouldn't be surprised if it's analogous to bad C pointer.
dunxuan commentedon Mar 15, 2026
同样的问题,第一步还原检查点,第二步/compact
bhavyaus commentedon Apr 4, 2026
Logan Ramos (@lramos15) this appears to be an issue with the request sent over from the widget. The same scenario but invoking
/compactworks.Investigated a bit more since I ran into this while testing some compaction issues.
The issue is a mismatch between how
/compactgets submitted via the context widget vs typing it manually.Context widget path:
The compact button in the context usage widget runs
workbench.action.chat.open({ query: '/compact' })which callschatWidget.acceptInput()→_acceptInput()directly. In_acceptInput, the checkpoint cleanup block fires — it removes all blocked requests + the checkpoint request from the model. By the time/compactis sent to the extension, most/all of the history has been wiped. The extension gets an emptycontext.historyand says "Nothing to compact."Manual typing path (Enter key):
When the user types
/compactand presses Enter,SubmitAction.run()runs first. It callsmodel.setCheckpoint(undefined)which clears the checkpoint and unblocks all requests without removing them. Then it callsacceptInput()→_acceptInput(), but nowmodel.checkpointisundefinedso the cleanup block is skipped. All requests stay in the model, history is preserved, and/compactworks.The fix should be in
chatWidget.ts_acceptInput— the checkpoint cleanup shouldn't remove requests when the intent is to compact. Or more broadly, theacceptInputcodepath called fromworkbench.action.chat.openshould match theSubmitActionbehavior and just callsetCheckpoint(undefined)to unblock requests instead of deleting them.Relevant code:
chatWidget.ts~L2413: checkpoint cleanup in_acceptInputchatExecuteActions.ts~L157:SubmitActionclears checkpoint without removing requestsconversationFeature.tsL229: compact button →workbench.action.chat.open({ query: '/compact' })2 remaining items
garretwilson commentedon Apr 4, 2026
Bhavya U (@bhavyaus) thank you for the investigation!!! I'm super-excited you could find the problem.
I'd like to point out that I discovered this bug just a few hours after the v1.110 release, and I immediately filed a bug, clearly marking it as "severe", as it deleted information.
I'd like to respectfully say to the GitHub Copilot team that, as a customer paying a very significant amount of money for this product, I find it disappointing and unsettling that my report was completely ignored until one of the team happened to run into the bug themselves.
lramos15 commentedon Apr 8, 2026
Bhavya U (@bhavyaus) I still can't reproduce this and am not sure your description matches what is going on here.
Did you validate this? As what it is doing in the submit action case is deleting just the history after the checkpoint which isn't a huge deal as we have restored to the checkpoint. It then runs compact on the remaining history
bhavyaus commentedon Apr 20, 2026
Logan Ramos (@lramos15) can't repro on insiders but can repro on 115. The below change fixes the issue:
https://github.com/microsoft/vscode/pull/307721/changes
bhavyaus commentedon Apr 20, 2026
This went out as a part of 116. Closing and marking as verified.