microsoft / microsoft/vscode

Copilot Chat history item silently fails to load when chatSessions JSONL is missing but session-store.db has transcript

Open
#324,662 0 comments 0 reactions 1 assignee Claimed by @roblourens View on GitHub
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

## Summary

A Copilot Chat history item is visible in the Chat tab, but clicking it does nothing. The session is not empty and its transcript still exists in Copilot Chat's global `session-store.db`, but the per-workspace `chatSessions/.jsonl` backing file is missing. The UI appears to keep showing the stale history metadata entry and then silently fails to hydrate the session.

## Environment

- VS Code: 1.127.0
- GitHub Copilot Chat extension: 0.55.0
- OS: Windows
- Chat mode: Agent

## Observed behavior

A session titled `Deploying web app with ADO token` appears in Chat history. Clicking the item produces no visible error and does not load the conversation.

Local evidence for the affected session:

- The workspace `state.vscdb`/`state.vscdb.backup` contains the chat history metadata entry:
- `sessionId`: `ee557062-4786-4e71-9150-d2b26caecdfa`
- `title`: `Deploying web app with ADO token`
- `isEmpty`: `false`
- `lastResponseState`: `1`
- The expected workspace session file is missing:
- `%APPDATA%/Code/User/workspaceStorage//chatSessions/ee557062-4786-4e71-9150-d2b26caecdfa.jsonl`
- The Copilot debug log exists but only contains `session_start`:
- `%APPDATA%/Code/User/workspaceStorage//GitHub.copilot-chat/debug-logs/ee557062-4786-4e71-9150-d2b26caecdfa/main.jsonl`
- The global Copilot Chat SQLite store still has the session content:
- `%APPDATA%/Code/User/globalStorage/github.copilot-chat/session-store.db`
- tables `sessions`, `turns`, and `session_files` all contain rows for `ee557062-4786-4e71-9150-d2b26caecdfa`

I was able to recover the conversation by copying `session-store.db`/WAL with shared-read access and querying the copied SQLite database directly. The recovered rows contained the full session metadata and all 3 turns.

## Expected behavior

One of these would be much better than a silent no-op:

1. Load the session from `session-store.db` when the top-level `chatSessions/.jsonl` file is missing.
2. Show a visible error explaining that the local session payload is missing/corrupt and offer to remove or recover the history item.
3. Prune history entries whose required backing payload is unavailable.

## Why this looks like a product bug

The Chat history item is rendered from persisted metadata in workspace state, but the click path appears to depend on a separate workspace JSONL payload. When that JSONL file is missing, the UI does not appear to fall back to the global Copilot Chat session store, even though that store still contains the transcript. It also fails silently from the user's point of view.

## Workaround used

I copied the locked SQLite database and WAL from `%APPDATA%/Code/User/globalStorage/github.copilot-chat/`, queried the copy with `sqlite3`, and exported the `sessions`, `turns`, and `session_files` rows for the affected `sessionId` to markdown.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.