Skip to content

Adding fix for Code - Insiders#111

Merged
rajbos merged 1 commit intomainfrom
code-insiders-fix
Jan 15, 2026
Merged

Adding fix for Code - Insiders#111
rajbos merged 1 commit intomainfrom
code-insiders-fix

Conversation

@rajbos
Copy link
Owner

@rajbos rajbos commented Jan 15, 2026

This pull request significantly enhances the robustness and flexibility of the Copilot token tracking logic, especially around session file discovery and parsing. The changes add support for new session file formats (notably .jsonl files used by Copilot CLI/agent mode), improve detection of session files across all major VS Code variants and remote environments, and introduce utility methods for recursive scanning and token estimation. These updates ensure more comprehensive and accurate tracking of Copilot usage across diverse setups.

Support for new session file formats:

  • Added logic to handle .jsonl session files (used by Copilot CLI/agent mode), including counting interactions and estimating token usage by parsing each event line and differentiating between user, assistant, and tool messages. [1] [2] [3] [4]

Session file discovery improvements:

  • Introduced the getVSCodeUserPaths method to systematically enumerate all likely VS Code user data directories across platforms and variants (stable, insiders, VSCodium, Cursor, remote/server environments).
  • Refactored session file search logic to use all discovered VS Code paths, scan for both .json and .jsonl files, and include Copilot CLI and Copilot Chat extension storage locations.

Utility and code structure enhancements:

  • Added a recursive scanDirectoryForSessionFiles method to efficiently locate session files within nested directories, improving coverage of non-standard storage layouts.
  • Improved diagnostic logging for session file discovery, including summaries and hints for troubleshooting when no files are found.

@rajbos rajbos merged commit 4e1f188 into main Jan 15, 2026
13 checks passed
@rajbos rajbos deleted the code-insiders-fix branch January 15, 2026 21:42
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

Comments