copilotAgent.ts ×6

Frontier kind: Code frontier

unlabeled · c_c184383669ea

45 tests · 51197 LOC · 300 files · introduces 0 tests · 19 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
6 ranges19 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
4849 ranges51197 lines · 300 files · Browse complete extent
All tests (intent)
45 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

1 file ranked by introduced lines: 19 introduced LOC across 6 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/node/copilot/copilotAgent.ts 19 introduced LOC · 6 ranges

Open complete file

2948 */
2949 private _disposeChildChats(sessionId: string): void {
2950 > const entry = this._sessions.get(sessionId); copilotAgent.ts
2951 > if (entry) {
2952 for (const chatKey of entry.peerChatKeys()) {
2953 entry.disposePeerChat(chatKey);
2954 }
2955 }
2956 > for (const chatKey of [...this._chatBackings.keys()]) { copilotAgent.ts
2957 const parsed = parseChatUri(URI.parse(chatKey));
2958 if (parsed && AgentSession.id(parsed.session) === sessionId) {
2960 }
2961 }
2962 > } copilotAgent.ts
2963
2964 private _getOrCreateActiveClient(session: URI, directory: URI | undefined): ActiveClient {
3044
3045 private async _destroyAndDisposeSession(sessionId: string): Promise<void> {
3046 > await this._releaseSessionResources(sessionId); copilotAgent.ts
3047 > }
3048
3049 /**
3058 */
3059 private async _releaseSessionResources(sessionId: string): Promise<void> {
3060 > // Tear down any peer chats owned by this session first so their SDK copilotAgent.ts
3061 > // chats don't leak when the parent is deleted/disposed
3062 > // without each chat being individually disposed via `disposeChat`.
3063 > this._disposeChildChats(sessionId);
3064 > // Provisional sessions have no SDK session, no worktree, and no
3065 > // on-disk metadata — drop the in-memory record and clean up the
3066 > // active-client snapshot. The state-manager entry is removed by the
3067 > // caller via {@link IAgentService.disposeSession}.
3068 > const provisional = this._provisionalSessions.get(sessionId);
3069 > if (provisional) {
3070 this._provisionalSessions.delete(sessionId);
3071 // Drop any peer-host entry created for this still-provisional
3087 this._sessions.deleteAndDispose(sessionId);
3088 this._mcpNotificationSubs.deleteAndDispose(sessionId);
3089 > this._activeClients.get(sessionUri)?.dispose(); copilotAgent.ts
3090 > this._activeClients.delete(sessionUri);
3091 > }
3092
3093 protected _resumeSession(sessionId: string): Promise<CopilotAgentSession> {