Skip to content

Chronicle - local and remote#308602

Merged
vijayupadya merged 27 commits intomainfrom
vscode-copilot-chat/migrate-5049
Apr 16, 2026
Merged

Chronicle - local and remote#308602
vijayupadya merged 27 commits intomainfrom
vscode-copilot-chat/migrate-5049

Conversation

@vijayupadya
Copy link
Copy Markdown
Contributor

@vijayupadya vijayupadya commented Apr 8, 2026

Chronicle — Session Search (local and cloud)

Overview

Chronicle enables agent to learn from your past coding sessions. It tracks session data locally, optionally syncs to cloud, and provides /chronicle commands for standups, tips, and freeform queries.

Architecture

┌─────────────────────────────────────────────────────────────────────┐
│                        VS Code Extension                            │
│                                                                     │
│                    ┌──────────────┐                                 │
│                    │  OTel Spans   │                                 │
│                    │  (chat turns, │                                 │
│                    │   tool calls) │                                 │
│                    └──────┬───────┘                                 │
│                           │                                         │
│              ┌────────────┴────────────┐                            │
│              │                         │                            │
│              ▼                         ▼                            │
│  ┌──────────────────┐    ┌──────────────────┐                      │
│  │ SessionStore      │    │ RemoteSession     │                      │
│  │ Tracker           │    │ Exporter          │                      │
│  │ (writes batched   │    │ (batched 500ms,   │                      │
│  │  every 3s)        │    │  circuit breaker) │                      │
│  └────────┬─────────┘    └────────┬─────────┘                      │
│           │                       │                                 │
│           ▼                       ▼                                 │
│  ┌──────────────────┐    ┌──────────────────┐                      │
│  │ Local SQLite DB   │                      │     │                      │
│  │ (sessions, turns, │    │ Cloud (DB)      │                      │
│  │  files, refs)     │    │                 │                      │
│  └──────────────────┘    └──────────────────┘                      │
│                                                                     │
│  ┌──────────────────────────────────────────────────────────────┐  │
│  │                    /chronicle Commands                        │  │
│  │                                                               │  │
│  │  ┌─────────┐   ┌─────────┐   ┌───────────┐                  │  │
│  │  │ standup  │  │  tips   │   │ free-form │                  │  │
│  │  │(pre-fetch│  │(tool-   │   │(tool-     │                  │  │
│  │  │ + LLM)  │   │ calling)│   │ calling)  │                  │  │
│  │  └────┬────┘   └────┬────┘   └─────┬─────┘                  │  │
│  │       │              │              │                         │  │
│  │       ▼              ▼              ▼                         │  │
│  │  Local SQLite   session_store_sql tool                       │  │
│  │  + Cloud API    (routes to local or cloud                    │  │
│  │  (merged,        based on consent)                           │  │
│  │   deduped)                                                    │  │
│  └──────────────────────────────────────────────────────────────┘  │
└─────────────────────────────────────────────────────────────────────┘

ChronicleIntent — /chronicle Commands

/chronicle standup
    │
    ├── Check SessionSearchLocalIndexEnabled (ExP) ──▶ No ──▶ return
    │
    ├── Query local SQLite (last 24h)
    │
    ├── Query cloud DB (last 24h, if hasCloudConsent)
    │
    ├── Merge + dedupe sessions by ID
    │
    └── Send to LLM with standup prompt template

**Telemetry**: `chronicle` event with subcommand, querySource, session counts.

/chronicle tips
    │
    ├── Check SessionSearchLocalIndexEnabled (ExP) ──▶ No ──▶ return
    │
    ├── Set system prompt with schema description
    │
    └── Delegate to DefaultIntentRequestHandler
         │
         ├── disableToolSearch = true (bypass server-side tool search)
         │
         └── getAvailableTools() → [session_store_sql] only
              │
              └── Model writes SQL ──▶ session_store_sql tool executes
                   │
                   ├── hasCloudConsent? ──▶ Yes ──▶ Query cloud DB
                   │
                   └── No ──▶ Query local SQLite

Data Flow — Session Lifecycle

User sends chat message
         │
         ▼
   VS Code creates OTel span (invoke_agent)
         │
         ├───────────────────────────────────────────┐
         │                                           │
         ▼                                           ▼
   SessionStoreTracker                    RemoteSessionExporter
         │                                           │
         ▼                                           ▼
   Buffer session row                     Translate to cloud events
   Buffer turn rows                       Buffer events
   Buffer file/ref rows                           │
         │                                           ▼
         ▼                                  Flush to Cloud
   Flush to SQLite (3s)                   POST /agents/sessions/{id}/events
         │                                  (500ms batches, circuit breaker)
         ▼                                           │
   Local session store                               ▼
   (workspaceStorage/                        Cloud session store
    GitHub.copilot-chat/                     (DB on backend)
    session-store.db)
         │                                           │
         └──────────────┬────────────────────────────┘
                        │
                        ▼
              /chronicle standup
              (queries both, merges, dedupes)

Copilot AI review requested due to automatic review settings April 8, 2026 20:21
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Introduces a new “Chronicle” session history subsystem in the Copilot extension, backed by a local SQLite store and populated from chat/OTel session activity, and wires it into a new /chronicle intent plus a chronicle_standup tool for generating standup summaries.

Changes:

  • Adds a SQLite-backed SessionStore (+ schema, FTS index, and tests) for sessions/turns/files/refs/checkpoints.
  • Adds tracking (SessionStoreTracker) to populate the store from completed OTel spans and chat session lifecycle.
  • Adds new user entry points: /chronicle standup intent and a chronicle_standup tool, plus prompt/query helpers and tests.

Copilot's findings

  • Files reviewed: 18/18 changed files
  • Comments generated: 8

Comment thread extensions/copilot/src/platform/chronicle/node/sessionStore.ts Outdated
Comment thread extensions/copilot/src/platform/chronicle/node/sessionStore.ts
Comment thread extensions/copilot/src/extension/chronicle/vscode-node/sessionStoreTracker.ts Outdated
Comment thread extensions/copilot/src/extension/intents/node/chronicleIntent.ts Outdated
Comment thread extensions/copilot/src/extension/chronicle/common/standupPrompt.ts Outdated
Comment thread extensions/copilot/src/extension/tools/node/standupTool.tsx Outdated
Comment thread extensions/copilot/src/extension/intents/node/allIntents.ts Outdated
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 9, 2026

Screenshot Changes

Base: ca3b9bfb Current: 27532f6f

Changed (6)

chat/aiCustomizations/aiCustomizationManagementEditor/McpBrowseMode/Dark
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/McpBrowseMode/Light
Before After
before after
editor/inlineCompletions/other/JumpToHint/Dark
Before After
before after
editor/inlineCompletions/other/JumpToHint/Light
Before After
before after
agentSessionsViewer/WithMarkdownBadge/Dark
Before After
before after
agentSessionsViewer/WithMarkdownBadge/Light
Before After
before after

@vijayupadya vijayupadya changed the title chronicle Chronicle - local and remote Apr 9, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new “Chronicle” capability to Copilot Chat to persist session activity locally (SQLite/FTS) and optionally export session events to a remote backend, enabling a standup-style summary experience gated behind a team-internal setting.

Changes:

  • Introduces a SQLite-backed session store (schema, FTS indexing, read-only querying) plus unit tests.
  • Adds tracking/export plumbing: OTel span translation, local store population, remote event batching with circuit breaker + secret filtering, and consent flow scaffolding.
  • Registers a new /chronicle intent and a chronicle_standup tool, plus related context keys and contributions.

Copilot's findings

  • Files reviewed: 32/32 changed files
  • Comments generated: 8

Comment thread extensions/copilot/src/platform/chronicle/node/sessionStore.ts
Comment thread extensions/copilot/src/platform/chronicle/node/sessionStore.ts
Comment thread extensions/copilot/package.json Outdated
Comment thread extensions/copilot/src/extension/conversation/vscode-node/chatParticipants.ts Outdated
Comment thread extensions/copilot/src/extension/chronicle/common/sessionIndexingPreference.ts Outdated
Comment thread extensions/copilot/src/extension/intents/node/chronicleIntent.ts Outdated
Comment thread extensions/copilot/src/extension/chronicle/vscode-node/remoteSessionExporter.ts Outdated
Comment thread extensions/copilot/src/extension/chronicle/vscode-node/remoteSessionExporter.ts Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds “Chronicle” session-history support with local SQLite indexing plus optional cloud sync/export, enabling /chronicle:* commands and a read-only SQL tool over recorded sessions.

Changes:

  • Introduces a local SQLite-backed SessionStore with FTS indexing and a VS Code tracker that records sessions/turns/files/refs from OTel spans.
  • Adds cloud querying/export plumbing (client + remote exporter) gated by user consent and repo exclusions.
  • Registers the /chronicle intent and a session_store_sql tool, plus settings/context keys and package contributions.

Copilot's findings

Comments suppressed due to low confidence (3)

extensions/copilot/src/platform/configuration/common/configurationService.ts:1

  • This string-array setting is missing a validator (unlike the adjacent boolean setting). Without validation, malformed config values can reach SessionIndexingPreference and break matching logic at runtime. Add an appropriate array-of-strings validator (consistent with this file’s other settings) so invalid values are rejected/coerced early.
    extensions/copilot/src/extension/tools/node/sessionStoreSqlTool.ts:1
  • The tool claims “Only SELECT queries are allowed”, but enforcement is currently a blocklist of a few keywords. This is especially risky on the local path when executeReadOnlyFallback() is used (Node without authorizer), since non-SELECT statements like VACUUM, ANALYZE, REINDEX, transaction control (BEGIN/COMMIT), or other dialect-specific write/export commands are not blocked. Prefer enforcing an allowlist (e.g., query must be a single statement starting with SELECT or WITH and contain no semicolons), and expand blocking to cover known mutators if an allowlist isn’t feasible.
    extensions/copilot/src/extension/tools/node/sessionStoreSqlTool.ts:1
  • Table formatting doesn’t escape cell values. If a value contains | or newlines, the markdown table will break and can produce confusing output. Escape/replace | and line breaks in s before joining (and consider backtick-wrapping values) to keep rendering stable.
  • Files reviewed: 36/36 changed files
  • Comments generated: 8

Comment thread extensions/copilot/src/extension/chronicle/common/sessionIndexingPreference.ts Outdated
Comment thread extensions/copilot/src/extension/chronicle/vscode-node/sessionStoreTracker.ts Outdated
Comment thread extensions/copilot/src/extension/chronicle/vscode-node/sessionStoreTracker.ts Outdated
Comment thread extensions/copilot/src/extension/chronicle/vscode-node/sessionStoreTracker.ts Outdated
Comment thread extensions/copilot/src/extension/chronicle/vscode-node/remoteSessionExporter.ts Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces “Chronicle” session history for Copilot Chat, including a local SQLite-backed session store, optional cloud export, and a new /chronicle intent with tool-calling via a dedicated session_store_sql tool.

Changes:

  • Add local SQLite session store (schema + FTS5) and trackers to persist sessions/turns/files/refs.
  • Add cloud sync pipeline (event translation + batching + circuit breaker) and a cloud SQL query client.
  • Add /chronicle intent (standup + tips + freeform) plus session_store_sql tool and registrations.
Show a summary per file
File Description
test/componentFixtures/blocks-ci-screenshots.md Updates CI snapshot image links.
extensions/copilot/src/platform/configuration/common/configurationService.ts Adds team-internal config keys for session search and cloud sync.
extensions/copilot/src/platform/chronicle/node/test/sessionStore.spec.ts Adds unit tests for the SQLite session store behavior.
extensions/copilot/src/platform/chronicle/node/sessionStore.ts Implements SQLite-backed SessionStore with schema, migrations, FTS5, and read-only query APIs.
extensions/copilot/src/platform/chronicle/common/sessionStore.ts Adds shared row types + ISessionStore service contract.
extensions/copilot/src/extension/tools/node/sessionStoreSqlTool.ts Adds session_store_sql tool to query local or cloud session store.
extensions/copilot/src/extension/tools/node/allTools.ts Registers the new sessionStoreSqlTool.
extensions/copilot/src/extension/tools/common/toolNames.ts Adds tool name constants for session store SQL.
extensions/copilot/src/extension/test/vscode-node/services.ts Wires ISessionStore into VS Code extension test service collection.
extensions/copilot/src/extension/test/node/services.ts Wires ISessionStore into unit test service collection.
extensions/copilot/src/extension/prompts/node/panel/chroniclePrompt.tsx Adds prompt wrapper for Chronicle tool-calling.
extensions/copilot/src/extension/intents/node/chronicleIntent.ts Implements /chronicle subcommands and tool availability gating.
extensions/copilot/src/extension/intents/node/allIntents.ts Registers the new ChronicleIntent.
extensions/copilot/src/extension/intents/node/agentIntent.ts Explicitly disables session_store_sql for agent flows (chronicle-only).
extensions/copilot/src/extension/extension/vscode-node/services.ts Creates and registers a persistent SessionStore instance for the extension host.
extensions/copilot/src/extension/extension/vscode-node/contributions.ts Registers Chronicle contributions (local tracker + remote exporter).
extensions/copilot/src/extension/conversation/vscode-node/chatParticipants.ts Minor formatting-only changes (blank lines).
extensions/copilot/src/extension/contextKeys/vscode-node/contextKeys.contribution.ts Adds context key gating for session search enablement.
extensions/copilot/src/extension/common/constants.ts Adds Chronicle intent and command mappings.
extensions/copilot/src/extension/chronicle/vscode-node/sessionStoreTracker.ts Tracks OTel spans and batches writes to local SQLite.
extensions/copilot/src/extension/chronicle/vscode-node/remoteSessionExporter.ts Buffers and flushes translated events to the cloud with circuit breaker.
extensions/copilot/src/extension/chronicle/node/cloudSessionStoreClient.ts Implements cloud SQL query endpoint client.
extensions/copilot/src/extension/chronicle/node/cloudSessionApiClient.ts Implements cloud session creation + event submission client.
extensions/copilot/src/extension/chronicle/common/test/standupPrompt.spec.ts Adds tests for standup prompt building and extraction helpers.
extensions/copilot/src/extension/chronicle/common/test/sessionIndexingPreference.spec.ts Adds tests for indexing preference logic.
extensions/copilot/src/extension/chronicle/common/test/secretFilter.spec.ts Adds tests for secret redaction filters.
extensions/copilot/src/extension/chronicle/common/test/eventTranslator.spec.ts Adds tests for span→event translation.
extensions/copilot/src/extension/chronicle/common/test/circuitBreaker.spec.ts Adds tests for circuit breaker behavior.
extensions/copilot/src/extension/chronicle/common/standupPrompt.ts Adds prompt construction helpers and canned SQLite queries.
extensions/copilot/src/extension/chronicle/common/sessionStoreTracking.ts Adds helpers to extract file paths and refs from tool calls.
extensions/copilot/src/extension/chronicle/common/sessionIndexingPreference.ts Adds consent/target selection logic (local vs cloud).
extensions/copilot/src/extension/chronicle/common/secretFilter.ts Adds secret filtering/redaction utilities for cloud export.
extensions/copilot/src/extension/chronicle/common/eventTranslator.ts Adds OTel span translation into CLI-compatible cloud events.
extensions/copilot/src/extension/chronicle/common/cloudSessionTypes.ts Adds shared types for cloud session/event payloads.
extensions/copilot/src/extension/chronicle/common/circuitBreaker.ts Adds circuit breaker implementation for cloud sync robustness.
extensions/copilot/package.nls.json Adds localized strings for Chronicle command descriptions and settings text.
extensions/copilot/package.json Adds Chronicle slash commands and contributes copilot_sessionStoreSql tool metadata.

Copilot's findings

  • Files reviewed: 37/37 changed files
  • Comments generated: 4

Comment thread extensions/copilot/src/extension/tools/node/sessionStoreSqlTool.ts Outdated
@vijayupadya vijayupadya marked this pull request as ready for review April 16, 2026 06:44
@vijayupadya vijayupadya marked this pull request as draft April 16, 2026 06:44
…igrate-5049

# Conflicts:
#	extensions/copilot/src/platform/configuration/common/configurationService.ts
@vijayupadya vijayupadya marked this pull request as ready for review April 16, 2026 06:50
@vijayupadya vijayupadya enabled auto-merge (squash) April 16, 2026 06:51
@vijayupadya vijayupadya merged commit 602484a into main Apr 16, 2026
26 checks passed
@vijayupadya vijayupadya deleted the vscode-copilot-chat/migrate-5049 branch April 16, 2026 08:31
@vs-code-engineering vs-code-engineering Bot added this to the 1.117.0 milestone Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants