Skip to content

feat(copilotcli): add WorktreeSessionIndex for managing chat session entries with JSONL persistence#311609

Merged
DonJayamanne merged 5 commits intomainfrom
don/suspicious-aphid
Apr 21, 2026
Merged

feat(copilotcli): add WorktreeSessionIndex for managing chat session entries with JSONL persistence#311609
DonJayamanne merged 5 commits intomainfrom
don/suspicious-aphid

Conversation

@DonJayamanne
Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings April 21, 2026 05:58
@DonJayamanne DonJayamanne self-assigned this Apr 21, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 21, 2026

Screenshot Changes

Base: 938f78a9 Current: ca4bce75

Changed (3)

editor/inlineCompletions/other/JumpToHint/Dark
Before After
before after
agentSessionsViewer/WithMarkdownBadge/Dark
Before After
before after
agentSessionsViewer/WithMarkdownBadge/Light
Before After
before after

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 a new persistence and indexing layer for Copilot CLI chat session metadata to better support cross-process visibility and scalable storage (shared bulk cache + JSONL worktree index), including migrations from legacy storage locations.

Changes:

  • Add WorktreeSessionIndex with JSONL persistence for worktree-folder → session-id lookups.
  • Update ChatSessionMetadataStore to use a shared bulk cache file in ~/.copilot/, add refresh(), and implement last-modified-wins merging + top-N trimming.
  • Extend/adjust tests and integrations to exercise refresh, migration, JSONL behavior, and stale-cache safety.
Show a summary per file
File Description
extensions/copilot/src/extension/chatSessions/vscode-node/worktreeSessionIndex.ts New in-memory + JSONL-persisted index for worktree session lookups.
extensions/copilot/src/extension/chatSessions/vscode-node/test/worktreeSessionIndex.spec.ts Unit tests for WorktreeSessionIndex in-memory ops and JSONL persistence.
extensions/copilot/src/extension/chatSessions/vscode-node/test/chatSessionMetadataStoreImpl.spec.ts Major test updates/additions for shared bulk cache, refresh, migration, JSONL index, trim, and merge behavior.
extensions/copilot/src/extension/chatSessions/vscode-node/copilotCLIChatSessionsContribution.ts Calls metadata refresh() on session list changes/refresh actions.
extensions/copilot/src/extension/chatSessions/vscode-node/copilotCLIChatSessions.ts Triggers metadata refresh() during session list refresh.
extensions/copilot/src/extension/chatSessions/vscode-node/chatSessionWorktreeServiceImpl.ts Stops using legacy globalState storage for worktrees (clears key) and routes persistence through metadata store.
extensions/copilot/src/extension/chatSessions/vscode-node/chatSessionMetadataStoreImpl.ts Implements shared bulk cache, refresh, migration, JSONL top-up + session-state scan, and timestamping/merge semantics.
extensions/copilot/src/extension/chatSessions/copilotcli/node/cliHelpers.ts Adds helpers for shared bulk cache + worktree JSONL paths under ~/.copilot/.
extensions/copilot/src/extension/chatSessions/common/test/mockChatSessionMetadataStore.ts Adds refresh() no-op to mock store interface.
extensions/copilot/src/extension/chatSessions/common/chatSessionMetadataStore.ts Adds created/modified, defines WorktreeSessionEntry, and adds refresh() to the store interface.

Copilot's findings

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

DonJayamanne and others added 4 commits April 21, 2026 16:22
Co-authored-by: Copilot <copilot@github.com>
…SessionMetadataStoreImpl.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <copilot@github.com>
@DonJayamanne DonJayamanne marked this pull request as ready for review April 21, 2026 08:16
@DonJayamanne DonJayamanne enabled auto-merge (squash) April 21, 2026 08:16
@DonJayamanne DonJayamanne merged commit 018a47f into main Apr 21, 2026
26 checks passed
@DonJayamanne DonJayamanne deleted the don/suspicious-aphid branch April 21, 2026 09:11
@vs-code-engineering vs-code-engineering Bot added this to the 1.118.0 milestone Apr 21, 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