copilotAgent.ts ×7

Frontier kind: Code frontier

unlabeled · c_1952acac8b49

2 tests · 51777 LOC · 300 files · introduces 0 tests · 24 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
7 ranges24 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
5008 ranges51777 lines · 300 files · Browse complete extent
All tests (intent)
2 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: 24 introduced LOC across 7 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/node/copilot/copilotAgent.ts 24 introduced LOC · 7 ranges

Open complete file

1554 */
1555 private _resolveChatTarget(chat: URI): { session: URI; chat: URI } {
1556 > const parsed = parseChatUri(chat); copilotAgent.ts
1557 > if (!parsed) {
1558 throw new Error(`Copilot chat operation requires an AHP chat URI: ${chat.toString()}`);
1559 }
1560 > return { session: URI.parse(parsed.session), chat: chat }; copilotAgent.ts
1561 > }
1562
1563 private _getChatContext(chatOrSession: URI): { session: URI; sessionId: string; chatKey: string; target: CopilotAgentSession | undefined; isPeerChat: boolean } {
2543
2544 private async _disposeChat(session: URI, chat: URI): Promise<void> {
2545 > if (isDefaultChatUri(chat)) { copilotAgent.ts
2546 return;
2547 }
2548 > const chatKey = chat.toString(); copilotAgent.ts
2549 > // Resolve the chat's backing SDK chat id — from the in-memory
2550 > // session, the live backing map, or (for legacy sessions) a one-time
2551 > // read of the agent's pre-orchestrator catalog — so we can delete it
2552 > // from the SDK's on-disk store. Without this a fresh process could
2553 > // re-resume an orphaned chat. The durable peer-chat catalog is
2554 > // owned by the orchestrator now, so this no longer rewrites
2555 > // `copilot.chats`; it only drops the live backing and SDK chat.
2556 > let sdkSessionId = this._findPeerChat(session, chat)?.sessionId
2557 ?? this._chatBackings.get(chatKey)?.sdkSessionId;
2558 > if (!sdkSessionId) { copilotAgent.ts
2559 const parsed = parseChatUri(chat);
2560 if (parsed) {
2563 }
2564 }
2565 > this._chatBackings.delete(chatKey); copilotAgent.ts
2566 > this._sessions.get(AgentSession.id(session))?.disposePeerChat(chatKey);
2567 > if (sdkSessionId) {
2568 > try {
2569 > const client = await this._ensureClient();
2570 > await client.deleteSession(sdkSessionId);
2571 > } catch (err) {
2572 this._logService.warn(`[Copilot] Failed to delete SDK session for chat ${chatKey}: ${err instanceof Error ? err.message : String(err)}`);
2573 }
2574 > } copilotAgent.ts
2575 > }
2576
2577 /**