Skip to content

feat: add Copilot Chat session parser for recall#29

Open
bilersan wants to merge 1 commit intoActiveMemory:mainfrom
bilersan:feat/copilot-chat-parser
Open

feat: add Copilot Chat session parser for recall#29
bilersan wants to merge 1 commit intoActiveMemory:mainfrom
bilersan:feat/copilot-chat-parser

Conversation

@bilersan
Copy link
Contributor

@bilersan bilersan commented Mar 7, 2026

Summary

Add a JSONL parser that discovers and parses VS Code Copilot Chat session files, enabling ctx recall to surface conversations from GitHub Copilot alongside existing Claude Code sessions.

Closes #28

Merge Order

Merge first — this PR is standalone with no dependencies on other open PRs.
Suggested order: #29#31#36

Changes

New files

  • internal/recall/parser/copilot.go (522 lines) - CopilotParser implementing the Parser interface with Matches(), ParseFile(), and CopilotSessionDirs() for platform-aware directory discovery
  • internal/recall/parser/copilot_raw.go (95 lines) - Typed Go structs for Copilot Chat JSONL format

Modified files

  • internal/config/file.go (+2 lines) - Added ToolCopilot = "copilot" constant
  • internal/recall/parser/parser.go (+1 line) - Registered NewCopilotParser() in registeredParsers
  • internal/recall/parser/query.go (+5 lines) - Added CopilotSessionDirs() to the directory scan loop

How it works

Copilot Chat stores conversations as JSONL files using a snapshot+patch model:

  • Kind 0: Full conversation snapshot
  • Kind 1: Incremental patch (add message)
  • Kind 2: Incremental patch (modify message)

The parser reads the JSONL file, applies patches in order to reconstruct the final conversation state, then builds Session objects with proper metadata (tool, model, timestamp, token counts).

Testing

  • All existing parser tests continue to pass
  • Copilot-specific tests pass (TestCopilot*, TestScanDir*, TestSession*, TestParse*)
  • go build ./... passes
  • Compliance tests pass

Notes

  • This is a purely additive change — no existing behavior is modified
  • The pre-existing TestGetPathRelativeToHome failure on Windows (hardcoded / separator) is NOT introduced by this PR; it exists on upstream/main already

@bilersan bilersan requested a review from josealekhine as a code owner March 7, 2026 02:16
Add a JSONL parser that discovers and parses VS Code Copilot Chat
session files, enabling ctx recall to surface conversations from
GitHub Copilot alongside existing Claude Code sessions.

Implementation:
- CopilotParser with Matches/ParseFile conforming to Parser interface
- copilot_raw.go: typed structs for Copilot Chat JSONL format
- CopilotSessionDirs() discovers platform-specific session paths
- Parser registered in registeredParsers and query scan loop
- ToolCopilot constant added to config

The parser handles Copilot's snapshot+patch model (kind 0/1/2),
reconstructs conversation turns, and builds Session objects with
proper metadata (tool, model, timestamp, token counts).

Signed-off-by: ersan bilik <ersanbilik@gmail.com>
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.

feat: Add Copilot Chat session parser for recall

1 participant