-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Description
Description
Copilot Chat’s Claude session loader reads and parses very large .jsonl files under ~/.claude/projects. After the size limit removal in microsoft/vscode-copilot-chat#3166, the extension host spikes CPU and crashes when the JSONL files are hundreds of MB.
Large files are agent-*.jsonl files: .claude/projects/..../aaaa-bbbb-cccc..../subagents/agent-abc.jsonl
Steps to Reproduce
- Have large Claude session
.jsonlfiles under~/.claude/projects(e.g., 200–300+ MB each, created by large tool outputs - e.g. large grep results). - Launch VS Code Insiders with Copilot Chat enabled.
- Let the extension load chat sessions on startup
Expected Behavior
Copilot Chat should handle large session logs without crashing the extension host, or disable large session logs as now the extension is unusable when the files are present.
Actual Behavior
Extension host CPU spikes and becomes unresponsive, then crashes. Profile shows hot path in _getMessagesFromSession and heavy buffer slicing.
Evidence
- CPU profile (extension host) shows
_getMessagesFromSessionas the dominant hotspot:- ~76.5% of sampled CPU time (2.21s of 2.89s) in
github.copilot-chatdist/extension.jsaround line 1443. - Next hotspot is
Buffer.slice(~17.9%), consistent with large string processing.
- ~76.5% of sampled CPU time (2.21s of 2.89s) in
- Local Claude session data size:
- Total
.jsonlunder~/.claude/projects: ~1.47 GB across 488 files. - Largest single file: ~329 MB.
- Avg line size in the largest file: ~1.4 MB; largest line: ~2.85 MB.
- Total
- Example of the large line content (structure only):
type=progresswithdata.output≈ 1.31M chars anddata.fullOutput≈ 1.57M chars. - The large
progresslines were emitted during aBashtool run with a repo‑widegrep -rncommand, producing massive output that was logged repeatedly.
Environment
- VS Code Insiders:
1.109.0-insider(f07c55879d2979aa0006d9cb681ca25bb7248dec) - Copilot Chat:
0.37.2026020302 - OS: macOS
26.3(Build25D5112c)
Additional Notes
microsoft/vscode-copilot-chat#3166 removed the 5MB read limit to allow large session files. That change appears to trade “file too large” errors for expensive full-file parsing that can crash the extension host.