Re-implement lazy loading of chat session items without using IAgentSessionsService in the sessions workbench
@DonJayamanne is already working on this.
Since Jun 8, 2026.
Assessment
This issue has not been assessed yet.
Description
Context
Commit c385fd3ddeb819e2b4d0563b4621990bafdbef6c (PR #312047, "feat(copilot): enable lazy loading for chat session items") introduced calls to IAgentSessionsService.model.observeSession(...) directly inside the sessions workbench (src/vs/sessions):
src/vs/sessions/contrib/sessions/browser/views/sessionsList.ts(renderSession)src/vs/sessions/services/sessions/browser/visibleSessions.ts(_getOrCreateVisibleSession, originally added insessionsManagementService.setActiveSession)
This violates the sessions layer architecture: IAgentSessionsService / the agent sessions model (vs/workbench/contrib/chat/browser/agentSessions/**) must only be consumed by the Copilot chat sessions provider (contrib/providers/copilotChatSessions/browser/copilotChatSessionsProvider.ts), never by shared sessions-workbench code. The sessions layer is provider-agnostic and must not reach into a specific provider's model.
What was done
The cross-layer observeSession triggers and the IAgentSessionsService dependency were reverted from sessionsList.ts and visibleSessions.ts (plus the now-stale test scaffolding). This removes the lazy-loading trigger that those calls provided.
Follow-up needed
Re-implement lazy loading of chat session items (the on-demand observeSession trigger that populates expensive properties such as changes/badges) the right way, without importing IAgentSessionsService into the sessions workbench. Options to consider:
- Drive the trigger from inside the Copilot provider itself (it already legitimately depends on
IAgentSessionsService), e.g. by reacting to a provider-agnostic visibility signal exposed byISessionsManagementService/ISession. - Or expose a provider-agnostic "session became visible/closed" signal on the sessions services that the Copilot provider subscribes to in order to call
observeSessionon its own sessions.
cc @DonJayamanne (author of PR #312047)
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.9k
- PR merge metrics
- PR metrics pending
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/vscode
-
testplan-item
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
new release
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
testplan-item
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
testplan-item
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
All issues in microsoft/vscode
Similar issues
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 76/100
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
vercel/react-tweet#225 ·