Skip to content

Severe Bug: GitHub Copilot deletes entire session with /compact (information loss) #299477

Closed

Description

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.

  1. I issued a prompt for the LLM to create two documents.
  2. The LLM created Document 1.
  3. VS Code started summarizing the conversation (now apparently called "compacting").
  4. I canceled compacting, because I realized VS Code would lose context between documents, so .
  5. 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.)
  6. 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."

Image

My entire previous conversation is gone! I can't get it back!

Version: 1.110.0 (user setup)
Commit: 0870c2a0c7c0564e7631bfed2675573a94ba4455
Date: 2026-03-04T01:20:28.863Z
Electron: 39.6.0
ElectronBuildId: 13330601
Chromium: 142.0.7444.265
Node.js: 22.22.0
V8: 14.2.231.22-electron.0
OS: Windows_NT x64 10.0.26200

Activity

  1. added
    chat-ext-issue
    on Mar 5, 2026
  2. removed
    chat-ext-issue
    on Mar 5, 2026
  3. garretwilson commented on Mar 5, 2026

    @garretwilson
    Author

    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?

  4. garretwilson commented on Mar 5, 2026

    @garretwilson
    Author

    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:

    1. 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.
    2. Important: I issued another prompt.
    3. 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.

  5. dunxuan commented on Mar 15, 2026

    @dunxuan

    同样的问题,第一步还原检查点,第二步/compact

  6. added
    bug
    on Apr 4, 2026
  7. added this to the 1.115.0 milestone on Apr 4, 2026
  8. bhavyaus commented on Apr 4, 2026

    @bhavyaus
    Collaborator

    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
    • Extension: conversationFeature.ts L229: compact button → workbench.action.chat.open({ query: '/compact' })
  9. 2 remaining items

  10. garretwilson commented on Apr 4, 2026

    @garretwilson
    Author

    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.

  11. lramos15 commented on Apr 8, 2026

    @lramos15
    Member

    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

  12. removed this from the 1.116.0 milestone on Apr 13, 2026
  13. bhavyaus commented on Apr 20, 2026

    @bhavyaus
    Collaborator
  14. added this to the 1.116.0 milestone on Apr 20, 2026
  15. added
    verified
    on Apr 20, 2026
  16. bhavyaus commented on Apr 20, 2026

    @bhavyaus
    Collaborator

    This went out as a part of 116. Closing and marking as verified.

  17. locked and limited conversation to collaborators on Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions