Skip to content

Add /chronicle:reindex command to rebuild local session index from JS…#312905

Merged
vijayupadya merged 3 commits intomainfrom
vijayu/localReindex
Apr 27, 2026
Merged

Add /chronicle:reindex command to rebuild local session index from JS…#312905
vijayupadya merged 3 commits intomainfrom
vijayu/localReindex

Conversation

@vijayupadya
Copy link
Copy Markdown
Contributor

Adds a /chronicle:reindex slash command that rebuilds the local Chronicle SQLite session store by re-reading JSONL debug logs from disk. This enables users to manually recover session data that the live tracker may have missed, or to populate the index after enabling the local indexing setting.

…ONL logs

Co-authored-by: Copilot <copilot@github.com>
Copilot AI review requested due to automatic review settings April 27, 2026 21:03
# Conflicts:
#	extensions/copilot/src/extension/chronicle/common/sessionStoreTracking.ts
@vijayupadya vijayupadya requested review from Copilot and removed request for Copilot April 27, 2026 21:20
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:reindex slash command to rebuild the local Chronicle SQLite session store by replaying per-session JSONL debug logs written to disk.

Changes:

  • Add chronicle:reindex command wiring (intent routing, command registration, and localized description).
  • Introduce a new sessionReindexer implementation + unit tests to stream debug-log entries and write sessions/turns/files/refs into the SQLite store.
  • Refactor session-store tracking helpers to share truncation limits and utility helpers (truncateForStore, isTerminalTool).
Show a summary per file
File Description
extensions/copilot/src/extension/intents/node/chronicleIntent.ts Routes /chronicle:reindex and emits progress + telemetry for reindex runs.
extensions/copilot/src/extension/common/constants.ts Registers chronicle:reindex command mapping to the Chronicle intent.
extensions/copilot/src/extension/chronicle/vscode-node/sessionStoreTracker.ts Reuses shared truncation + terminal-tool detection helpers.
extensions/copilot/src/extension/chronicle/node/sessionReindexer.ts New reindexer that streams JSONL debug logs and writes into the session store.
extensions/copilot/src/extension/chronicle/node/test/sessionReindexer.spec.ts Adds unit coverage for the reindexer behavior.
extensions/copilot/src/extension/chronicle/common/sessionStoreTracking.ts Adds shared truncation constants/helpers and terminal-tool detection.
extensions/copilot/package.nls.json Adds localized description for /chronicle:reindex.
extensions/copilot/package.json Contributes the chronicle:reindex slash command.

Copilot's findings

Comments suppressed due to low confidence (1)

extensions/copilot/src/extension/chronicle/node/sessionReindexer.ts:256

  • processAssistantResponse reads entry.attrs.outputMessages, but the debug logger writes the serialized output messages under attrs.response for agent_response entries (and llm_request entries don't carry output messages). As-is, reindexing is likely to miss assistant responses entirely. Update the parser to use the actual attribute names from IChatDebugFileLoggerService output (and/or support both keys for backward compatibility).
	// Extract assistant response from outputMessages attribute (same as sessionStoreTracker)
	const outputMessagesRaw = entry.attrs.outputMessages as string | undefined;
	const assistantResponse = extractAssistantResponse(outputMessagesRaw);
  • Files reviewed: 8/8 changed files
  • Comments generated: 3

Comment thread extensions/copilot/src/extension/chronicle/common/sessionStoreTracking.ts Outdated
Comment thread extensions/copilot/src/extension/chronicle/node/test/sessionReindexer.spec.ts Outdated
Comment thread extensions/copilot/src/extension/chronicle/node/sessionReindexer.ts
Co-authored-by: Copilot <copilot@github.com>
@vijayupadya vijayupadya marked this pull request as ready for review April 27, 2026 22:10
@vijayupadya vijayupadya enabled auto-merge (squash) April 27, 2026 22:10
@vijayupadya vijayupadya merged commit 09d54a6 into main Apr 27, 2026
26 checks passed
@vijayupadya vijayupadya deleted the vijayu/localReindex branch April 27, 2026 22:34
@vs-code-engineering vs-code-engineering Bot added this to the 1.119.0 milestone Apr 27, 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