Improve performance of session listing in agent service - #331760
Merged
Benjamin Christopher Simmonds (benibenj) merged 1 commit intoAug 20, 2026
Merged
Conversation
Copilot started reviewing on behalf of
Benjamin Christopher Simmonds (benibenj)
August 20, 2026 08:06
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Optimizes Agent Host session listing by avoiding unnecessary metadata and database reads for hidden external sessions.
Changes:
- Prefilters external sessions when external visibility is disabled.
- Preserves overlay filtering and diagnostic counts.
- Adds regression coverage for skipped database work.
Show a summary per file
| File | Description |
|---|---|
agentService.ts |
Adds external-session prefiltering and logging updates. |
agentService.test.ts |
Verifies hidden sessions avoid database reads. |
Review details
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Balanced
Comment on lines
+2127
to
+2137
| /** | ||
| * Whether {@link _shouldIncludeSession} is guaranteed to reject every | ||
| * external session under `mode`, letting {@link _computeSessions} drop them | ||
| * on the registry's `external` flag alone. | ||
| * | ||
| * `None` is the only mode that rejects external sessions outright. The | ||
| * adoptable-legacy exemption is the single way one could still be visible, | ||
| * and while migration is off that marker forces exclusion as well — which | ||
| * matters because the marker is only discoverable from the provider | ||
| * metadata read this skip avoids. | ||
| */ |
Martin Aeschlimann (aeschli)
approved these changes
Aug 20, 2026
Benjamin Christopher Simmonds (benibenj)
merged commit Aug 20, 2026
be1bc52
into
main
45 of 46 checks passed
Benjamin Christopher Simmonds (benibenj)
deleted the
benibenj/agents/vscode-insiders-agent-logs-review
branch
August 20, 2026 10:00
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.
This pull request addresses a significant performance issue identified in the agent host logs, specifically related to the
listSessionsfunction in theagentService.Changes made:
_computeSessionsmethod was modified to skip the computation of external sessions when the mode is set to hide them. This change reduces the number of SQLite database opens and improves the startup time significantly.Verification:
This targeted optimization should enhance the performance of the agent host without requiring extensive refactoring.