agentService.ts ×13

Frontier kind: Code frontier

unlabeled · c_daeb53fd1da7

45 tests · 50259 LOC · 290 files · introduces 0 tests · 24 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
13 ranges24 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
5217 ranges50259 lines · 290 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: 24 introduced LOC across 13 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/node/agentService.ts 24 introduced LOC · 13 ranges

Open complete file

1408 */
1409 private async _getChatMessages(provider: IAgent, chat: URI): Promise<readonly Turn[]> {
1410 > const turns = await provider.chats.getMessages(chat); agentService.ts
1411 > // Host-owned worktree restore announcement: re-inject the "Created isolated
1412 > // worktree" message at the top of the default chat's first turn from
1413 > // persisted metadata. No-op for folder sessions and non-default chats (peer
1414 > // / subagent). Agents stay unaware of worktrees.
1415 > if (this._worktree && isDefaultChatUri(chat)) {
1416 return this._worktree.applyRestoreAnnouncement(URI.parse(parseRequiredSessionUriFromChatUri(chat.toString())), turns);
1417 }
1418 > return turns; agentService.ts
1419 > }
1420
1421 /**
1429 */
1430 private async _interleaveLocalTurns(sessionStr: string, chatUri: string, turns: readonly Turn[]): Promise<Turn[]> {
1431 > const records = await this._localTurns.loadForChat(sessionStr, chatUri); agentService.ts
1432 > if (records.length === 0) {
1433 return [...turns];
1434 }
2649 */
2650 private async _restorePeerChats(agent: IAgent, session: URI): Promise<void> {
2651 > const persisted = await this._readPersistedPeerChatCatalog(session); agentService.ts
2652 > if (persisted !== undefined) {
2653 // The orchestrator owns the catalog: enumerate from it.
2654 await this._restorePeerChatsFromCatalog(agent, session, persisted);
2657 // No orchestrator catalog yet: one-time migration from legacy `*.chats`.
2658 await this._migrateLegacyPeerChats(agent, session);
2659 > } agentService.ts
2660
2661 /**
2877 */
2878 private async _readPersistedPeerChatCatalog(session: URI): Promise<IPersistedPeerChat[] | undefined> {
2879 > const ref = await this._sessionDataService.tryOpenDatabase?.(session); agentService.ts
2880 > if (!ref) {
2881 return undefined;
2882 }
3014 /** Reads a chat's persisted custom title (default or peer chat), if any. */
3015 private async _readPersistedChatTitle(session: URI, chatUri: URI): Promise<string | undefined> {
3016 > const ref = await this._sessionDataService.tryOpenDatabase?.(session); agentService.ts
3017 > if (!ref) {
3018 return undefined;
3019 }
3020 try {
3021 return (await ref.object.getMetadata(`customChatTitle:${chatUri.toString()}`)) ?? undefined;
3022 > } catch { agentService.ts
3023 return undefined;
3024 } finally {
3025 ref.dispose();
3026 }
3027 > } agentService.ts
3028
3029 private async _getChatDraft(session: URI, chatUri: URI): Promise<Message | undefined> {
3030 > const ref = await this._sessionDataService.tryOpenDatabase(session); agentService.ts
3031 > if (!ref) {
3032 return undefined;
3033 }
3037 ref.dispose();
3038 }
3039 > } agentService.ts
3040
3041 private async _getSessionMetadataForRestore(agent: IAgent, session: URI): Promise<IAgentSessionMetadata | undefined> {