Skip to content

chat sessions are gone #331572

Open
Open

Agent suggestions

Public preview

Description

@rahbari

After a normal VS Code restart, two days’ worth of chat sessions are completely gone. I checked every filter—they weren’t hidden; they were deleted.

This isn’t an isolated issue either. I’ve had this happen several times, along with Copilot dropping file changes even after I click Keep, inconsistent edits when sessions error or retry, repeated parts inside an answer, and other reliability problems.

It’s genuinely frustrating. VS Code Chat still feels like an early beta product, and I’m seriously considering moving to something more reliable.

Version: 1.133.0

opus findings:

Chat history is silently lost when a window transitions between single-folder and multi-root workspace storage. On VS Code 1.133.0 (a5b5009, macOS arm64), adding a second folder to a single-folder window promotes it to an untitled workspace with a new workspaceStorage hash, and ChatSessionStore logs Workspace transition from to / Copied N chat session files … (originals preserved at old location). The transition copies the chatSessions/*.jsonl transcripts to the new storage folder but does not migrate the chat.ChatSessionStore.index key in state.vscdb. All subsequent sessions are indexed only under the new hash, so the moment you return to the plain folder the chat list is frozen at the timestamp of the transition — in my case it jumped straight from Aug 17 14:02 to Aug 19, hiding 22 sessions (13 of them from a full day's work) even though all 144 .jsonl files were sitting in the folder untouched. The loss is invisible: no error, no warning, and the history simply appears truncated. It is also effectively unrecoverable through the UI, because the untitled workspace's Code/Workspaces//workspace.json had already been cleaned up, leaving its 84-entry index reachable only by opening state.vscdb in sqlite3 by hand. Suggested fix: migrate the index entries alongside the transcript files during a workspace transition (or reconcile the index against the chatSessions/ directory on startup, which would repair the orphaned files automatically).

Activity

  1. rahbari commented on Sep 2, 2026

    @rahbari
    Author

    it happened again, i opened the project both as directory and workspace but several days of sessions are gone.

  2. typed-sigterm commented on Oct 2, 2026

    @typed-sigterm

    It also happens on my machine. The whole chat histroy is gone

  3. interconnectedMe commented on Oct 8, 2026

    @interconnectedMe

    Possibly related to the missing-session-list issue I just reported: #340573

    In my case, most existing Codex and Claude sessions are absent from the native Chat Sessions list despite both source filters being enabled. Resetting filters, Refresh, and Reload Window do not restore them. The local Codex database and VS Code's session-state store still contain the missing records. A trace snapshot resolved only three provider sessions while the state store contained 195 entries, including Codex and Claude resource URIs.

    Your report describes sessions hidden after a workspace transition and a stale index, so the cause may differ; I’m flagging the possible overlap in list discovery/persistence.

  4. interconnectedMe commented on Oct 8, 2026

    @interconnectedMe

    Follow-up to my earlier “possibly related” comment: we have verified a resolution for the Codex portion of #340573.

    "chat.editor.codex.preferAgentHost": false

    Setting this explicitly in the active profile restored Codex history and pinned chats immediately, before a window reload. They opened correctly in editor tabs and survived Developer Reload Window. Rolling back to 1.140.0 alone had not helped; we are now back on 1.141.0 with the setting retained and the Codex workflow working.

    Your report describes workspace-transition/index migration. Our Codex recovery required no workspace change, session-store deletion, or index rebuild, so this appears to be a distinct cause with a similar missing-list symptom.

    Details and scope clarification: #340573

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions