Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Losing chat history in empty windows #1309

Closed
theReynald opened this issue Jun 15, 2024 · 9 comments · Fixed by microsoft/vscode#224430
Closed

Losing chat history in empty windows #1309

theReynald opened this issue Jun 15, 2024 · 9 comments · Fixed by microsoft/vscode#224430
Assignees
Labels
feature-request Request for new features or functionality panel-chat Chat conversation sidepanel verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@theReynald
Copy link

  • Copilot Chat Extension Version: v0.16.1
  • VS Code Version: 1.90.1
  • OS Version: macOS Sonoma
  • Logs:

Watch video of issue here:

Steps to Reproduce:

  1. Open VS Code
  2. Click 'Show Chats' button

Image:
Screenshot 2024-06-15 at 1 03 03 PM

@github-actions github-actions bot added the triage-needed Issues needing to be assigned to the prospective feature owner label Jun 15, 2024
@aiday-mar aiday-mar assigned roblourens and unassigned aiday-mar Jun 17, 2024
@github-actions github-actions bot removed the triage-needed Issues needing to be assigned to the prospective feature owner label Jun 17, 2024
@roblourens
Copy link
Member

Chats are per-workspace. Do you have previous chats in that workspace?

@roblourens roblourens added the info-needed Issue requires more information from poster label Jun 19, 2024
@znorris
Copy link

znorris commented Jul 12, 2024

In my opinion, non-workspace chat history needs a home, too. For example, I just opened a new VS Code window and began by talking with the copilot. I spent time writing up just what I wanted, and the response looked really good. I then created a new folder for the project, and of course, VSCode opened a new project window and closed my old one. But I didn't think that it would do that. So now I have a new project, but my history is completely gone, and I feel crushed that I have to find all the right words to get a good response again.

@roblourens
Copy link
Member

I see that chats in empty windows don't get saved.

@bpasero I use a workspace-scoped Memento from getMemento(StorageScope.WORKSPACE, StorageTarget.MACHINE). If I close the empty window and open a new one, then I don't get my stored data back. That's probably right for UI state in general, but for something that represents user data, I'd like to keep it around in the next empty window. Is there a way to do that? I could keep it in global storage myself?

It probably gets a little weird when you open multiple empty windows, since they would be overwriting each others' state, but I'm ok with that.

@roblourens roblourens added bug Issue identified by VS Code Team member as probable bug panel-chat Chat conversation sidepanel and removed info-needed Issue requires more information from poster labels Jul 21, 2024
@roblourens roblourens added this to the Backlog milestone Jul 21, 2024
@bpasero
Copy link
Member

bpasero commented Jul 26, 2024

Yes in that case you would have to use global storage. For empty windows we invent a fake workspace identifier (which is actually derived from the backup path for "hot exit" in that window) and so as long as that window restores, that state comes back. But any new empty window will have a different workspace identifier that is only valid for as long as the window restores (e.g. because of unsaved files).

@roblourens
Copy link
Member

Is there any way to hook into how it works for hot exit, so that having chats in that window would also cause it to use the same workspace identifier and get the chat data back? Or does that not make sense for chat?

@bpasero
Copy link
Member

bpasero commented Jul 27, 2024

You should be able to get that ID via IWorkspaceContextService.getWorkspace().id.

If you want to participate in hot exit in general, its more complex: you would have to start using working copies and participate in working copy lifecycle. We introduced working copies to have a way for notebooks and custom editors to have parity with text file models. I am not sure its a good fit though because our assumption is that a working copy can always be shown as editor and if its dirty, the dirty indication shows.

@roblourens
Copy link
Member

Thanks. I should probably just keep these chats in global storage, and do my best to merge them between windows.

@roblourens roblourens changed the title GitHub Copilot Chat History Not Showing Losing chat history in empty windows Jul 31, 2024
roblourens added a commit to microsoft/vscode that referenced this issue Jul 31, 2024
@roblourens roblourens modified the milestones: Backlog, August 2024 Jul 31, 2024
@roblourens
Copy link
Member

This can't be perfect, but it should be good enough to avoid losing data in normal cases!

@roblourens roblourens added feature-request Request for new features or functionality and removed bug Issue identified by VS Code Team member as probable bug labels Jul 31, 2024
@Gladskih
Copy link

Gladskih commented Aug 12, 2024

Is it possible to find a file which contains history of a "chat without workspace"? I ahve just lost a couple of hours of hard work with unexpected history wipe exactly like described above- #1309 (comment)
I do not even know English enough to express my frustration.

Version: 1.92.1 (user setup)
Commit: eaa41d57266683296de7d118f574d0c2652e1fc4
Date: 2024-08-07T20:16:39.455Z (4 days ago)
Electron: 30.1.2
ElectronBuildId: 9870757
Chromium: 124.0.6367.243
Node.js: 20.14.0
V8: 12.4.254.20-electron.0
OS: Windows_NT x64 10.0.22631

@roblourens roblourens added the verification-needed Verification of issue is requested label Aug 26, 2024
@mjbvz mjbvz added the verified Verification succeeded label Aug 27, 2024
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Sep 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality panel-chat Chat conversation sidepanel verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants