Repository navigation
perf: cache Copilot CLI/App sessions per folder on cached loads - #406
Merged
Merged
Conversation
Every cached load read all Copilot CLI/App session folders again, serially. Fingerprint each session folder in the directory metadata, keep unchanged CLI/App sessions from the cache, and read only changed folders through the shard pool. Load the disk cache only once per parse. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1dc5f486-30b8-42cb-9bcc-27638e93d668
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1dc5f486-30b8-42cb-9bcc-27638e93d668
github-actions
Bot
requested review from
TamasBoncz and
Sanjay Singh (san360)
December 1, 2026 12:04
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
Sanjay Singh (san360)
approved these changes
Dec 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Agent assessment
Self-reported assessment, not an independent review.
Assessed revision:
c2c5e9d7f01dc975c45964a38168bb425fd6eff7npm run checkpasses (4,267 tests), with new tests for unchanged, changed and same-named CLI folders.↑ Real data: the second load re-read 7 of 7,017 CLI sessions; the total went from 33 s to 6.3 s.
↓ Custom instructions of an unchanged CLI session can be stale until its log changes (same as editor workspaces).
↓ Tested on macOS only.
Description
Each cached load (disk-cache hit or incremental) read all Copilot CLI/App session folders in
~/.copilot/session-stateagain, serially. On a machine with about 7,000 sessions this was most of the load time. The cache (~/.copilot-analytics-cache/parsed.json+meta.json) did not record these folders.Changes:
computeDirMetas(Async)now stores a fingerprint (size and mtime ofevents.jsonlandworkspace.yaml) for each CLI/App session folder that has a log.Measured with the canvas on real data (
runtime.log,worker-phase-timing):Related Issues
Relates to #402
Checklist
npm run checkpasses (typecheck + lint + spellcheck + knip + tests)changelog.d/<PR number>.mdfragment