Skip to content

fix(copilot): include copilot legacy chat sessions - #1232

Open
JaylyDev wants to merge 4 commits into
getagentseal:mainfrom
JaylyDev:jayly/copilot-legacy-json-sessions
Open

fix(copilot): include copilot legacy chat sessions#1232
JaylyDev wants to merge 4 commits into
getagentseal:mainfrom
JaylyDev:jayly/copilot-legacy-json-sessions

Conversation

@JaylyDev

@JaylyDev JaylyDev commented Sep 2, 2026

Copy link
Copy Markdown

Summary

Adding support for VS Code's GitHub Copilot chat sessions prior to February 2026 to copilot's parser.

How it works:

The parser scan for chatSessions/*.json and parses the legacy chat sessions if there is a requests array in root JSON object. The schema of those JSON files and its definitions like IToolCallRound and ThinkingData can be found in https://github.com/microsoft/vscode-copilot-chat.

This old format reads all of input, output, reasoning messages and tool calling outputs to determine number of tokens used by a model, which is also stored in the request object. It reads exact token counts (promptTokens, completionTokens, usage) when available, otherwise it fallbacks to character-based estimation.

This parser also maps the model used in auto model selection to the actual model used.

Testing

  • I have tested this locally against real data (not just unit tests)
  • npm test passes
  • npm run build succeeds

For new providers only:

  • I installed the tool and generated real sessions by using it
  • npm run dev -- today shows correct costs and session counts for this provider
  • npm run dev -- models --provider <name> shows correct model names and pricing
  • Screenshot or terminal output attached below proving it works with real data

Before:

image

After:

image

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.

1 participant