github / github/copilot-cli

/chronicle: ingest VS Code Copilot Chat history alongside CLI sessions for a unified history

Ouverte
#3,816 0 commentaires 1 réaction 0 personnes assignées Voir sur GitHub
area:sessions
Langage dominant
Shell
Étoiles
11.2k
Forks
1.9k
Merge moyen
14 h 16 min
PR mergées (30 j)
6

Description

## Summary

Today `/chronicle` (and the underlying `session_store_sql`, `/resume`, `/research`, `/search`) only index sessions produced by the Copilot CLI itself — the local `~/.copilot/session-state/` store plus the cloud session store. Conversations conducted in **VS Code Copilot Chat** are invisible to `/chronicle`, even when they happen on the same machine, same user, and same repository.

Meanwhile the inverse direction already works: VS Code Copilot Chat enumerates Copilot CLI sessions via `CopilotCLIChatSessionContentProvider.listSessions` and surfaces them in the Chat Sessions view (see #3652, microsoft/vscode#318126, #311405, #310933, and #3740). Closing the loop would give users a single, unified history across both surfaces.

## Use case

I move fluidly between `copilot` in the terminal and Copilot Chat in VS Code on the same repo throughout the day. When I later ask `/chronicle` "what was I working on this week in repo X?" or use `session_store_sql` / `/research` to retrieve prior approaches, half of my actual history is missing because it lived in VS Code Chat.

## Proposal

Extend the `/chronicle` indexer (and the `session_store_sql` backend) to optionally ingest VS Code Copilot Chat transcripts in addition to the CLI's own sessions:

- Discover VS Code Copilot Chat session storage on disk (workspaceStorage / globalStorage chat transcript files; exact path/schema owned by `microsoft/vscode-copilot-release` — companion issue may be needed there to stabilize/document it).
- Normalize each VS Code chat session into the same row shape currently used in the session store (`sessions`, `turns`, `events`, `session_files`, `session_refs`, etc.), with a `source` column distinguishing `cli` vs `vscode-chat`.
- Make ingestion opt-in via a setting (e.g. `chronicle.sources = ["cli", "vscode-chat"]`) and respect any existing local-only / cloud sync preferences.
- Surface the new source in `/chronicle` insights, `/resume` pickers, `/research`, and `session_store_sql` query results.

## Why the CLI repo

`/chronicle`, the session-store schema, and the indexer all live in `github/copilot-cli`. The `@github/copilot` SDK doesn't own these surfaces, and VS Code Copilot Chat already reads CLI sessions — so the missing half of the integration is naturally a CLI-side change. A companion issue in `microsoft/vscode-copilot-release` to expose a stable on-disk transcript location may be useful but is secondary.

## Related issues

- #3652 — VS Code Copilot Chat already calls into CLI sessions via `CopilotCLIChatSessionContentProvider.listSessions`
- #1791 — Global session history registry / persistent cross-session stats
- #3811, #3777, #3775 — existing `/chronicle` indexer issues
- microsoft/vscode#318126, #311405, #310933 — VS Code-side handling of CLI sessions
- #3740 — Opening CLI chat from the VS Code Copilot Session pane

## Acceptance criteria

- A VS Code Copilot Chat session conducted on repo X appears in `/chronicle` insights for repo X.
- `session_store_sql` can `SELECT ... WHERE source = 'vscode-chat'` and join VS Code turns alongside CLI turns.
- Ingestion is opt-in and documented.
- No regression in CLI-only session performance (cf. #3652).

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par l’indexeur /chronicle et le backend session_store_sql, puis suivez la manière dont /resume, /research, /search et CopilotCLIChatSessionContentProvider.listSessions consomment les sessions. Confirmez l’emplacement et le schéma des transcriptions VS Code à partir du travail VS Code lié. Le travail est considéré comme terminé lorsqu’il y a une ingestion opt-in de vscode-chat, des requêtes et des surfaces tenant compte de la source, de la documentation et aucune régression de performances propre à la CLI.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
sql, vscode
Domaine
backend, cli, database
Type d'issue
Fonctionnalité
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
Calme
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.