Limit Copilot CLI startup session listing#322026
Open
ben-dlwlrma wants to merge 2 commits into
Open
Conversation
Author
|
@microsoft-github-policy-service agree |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR optimizes Copilot CLI chat session listing at startup by requesting only bounded session metadata and avoiding eager session-label resolution, reducing the amount of per-session history loading performed during initial refresh.
Changes:
- Add
IListCopilotCLISessionsOptionstoICopilotCLISessionService.getAllSessions(...), supportingmetadataLimitandresolveLabels. - Update both the startup session refresh path and the legacy session item provider path to use
metadataLimit: 20andresolveLabels: false. - Extend unit tests to validate metadata limit propagation and that disabling label resolution avoids full session loads.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| extensions/copilot/src/extension/chatSessions/vscode-node/test/copilotCLIChatSessions.spec.ts | Updates VS Code-side tests to assert bounded startup refresh and bounded legacy item-provider refresh. |
| extensions/copilot/src/extension/chatSessions/vscode-node/copilotCLIChatSessionsContribution.ts | Bounds the legacy session item provider refresh by requesting limited metadata and skipping label resolution. |
| extensions/copilot/src/extension/chatSessions/vscode-node/copilotCLIChatSessions.ts | Bounds the startup session list refresh to limited metadata and skips eager label resolution. |
| extensions/copilot/src/extension/chatSessions/copilotcli/node/test/testHelpers.ts | Updates mock SDK session manager to accept (and ignore) a metadataLimit option. |
| extensions/copilot/src/extension/chatSessions/copilotcli/node/test/copilotCliSessionService.spec.ts | Adds coverage for passing metadataLimit to the SDK and for skipping full session loads when label resolution is disabled. |
| extensions/copilot/src/extension/chatSessions/copilotcli/node/copilotcliSessionService.ts | Implements bounded metadata listing and optional label resolution skipping; de-dupes in-flight getAllSessions work by options key. |
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.
Related to #319710 and #321901.
This limits the initial Copilot CLI session list refresh to a bounded metadata request and skips eager label resolution for that startup list. The full session title path remains available for explicit session resolution, while startup no longer needs to load full session histories for every persisted CLI session.
Validation run in the standalone Copilot Chat checkout before porting this minimal diff into vscode:
The vscode fork checkout used for this PR is sparse and only contains the touched extensions/copilot paths, so I did not rerun the full vscode repository test suite there. Account-backed E2E for an existing Copilot CLI session store is also not included in this draft.