agentService.ts ×6

Frontier kind: Code frontier

unlabeled · c_9d57216f4b5c

8 tests · 51650 LOC · 304 files · introduces 0 tests · 30 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
6 ranges30 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
5414 ranges51650 lines · 304 files · Browse complete extent
All tests (intent)
8 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: 30 introduced LOC across 6 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/node/agentService.ts 30 introduced LOC · 6 ranges

Open complete file

2697 private async _restorePeerChatsFromCatalog(agent: IAgent, session: URI, entries: readonly IPersistedPeerChat[]): Promise<void> {
2698 const restored = await Promise.all(entries.map(async (entry) => {
2699 > let chatUri: URI; agentService.ts
2700 > try {
2701 > chatUri = URI.parse(entry.uri);
2702 > } catch (err) {
2703 this._logService.warn(`[AgentService] Skipping malformed persisted peer chat URI '${entry.uri}': ${toErrorMessage(err)}`);
2704 return undefined;
2705 }
2706 > // Re-attach the agent's in-memory backing for the chat BEFORE agentService.ts
2707 > // reading its history, so `getSessionMessages` can resolve the
2708 > // chat. Best-effort: a corrupt/unknown blob must not abort
2709 > // the restore — the chat is then surfaced with history but no live
2710 > // backing.
2711 > if (agent.materializeChat) {
2712 try {
2713 await agent.materializeChat(chatUri, entry.providerData);
2716 }
2717 }
2718 > let turns: readonly Turn[] = []; agentService.ts
2719 > try {
2720 > turns = await this._getChatMessages(agent, chatUri);
2721 > } catch (err) {
2722 this._logService.warn(`[AgentService] Failed to load history for peer chat ${chatUri.toString()}: ${toErrorMessage(err)}`);
2723 }
2724 > const [title, draft] = await Promise.all([ agentService.ts
2725 > this._readPersistedChatTitle(session, chatUri),
2726 > this._getChatDraft(session, chatUri),
2727 > ]);
2728 > const mergedTurns = await this._interleaveLocalTurns(session.toString(), chatUri.toString(), turns);
2729 > return { chatUri, title, turns: mergedTurns, draft, providerData: entry.providerData, origin: entry.origin };
2730 }));
2731 for (const item of restored) {
2732 > if (!item) { agentService.ts
2733 continue;
2734 }
2735 > const { chatUri, title, turns, draft, providerData, origin } = item; agentService.ts
2736 > this._stateManager.restoreChat(session.toString(), chatUri.toString(), {
2737 > title,
2738 > turns: [...turns],
2739 > draft,
2740 > ...(providerData !== undefined ? { providerData } : {}),
2741 > ...(origin !== undefined ? { origin } : {}),
2742 > });
2743 > }
2744 }
2745