agentService.ts ×4

Frontier kind: Joint frontier

unlabeled · c_e82f6922554f

1 test · 51791 LOC · 304 files · introduces 1 test · 36 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
4 ranges36 lines · 1 files
Tests
1 test

Contains — complete concept membership

All code (extent)
5442 ranges51791 lines · 304 files · Browse complete extent
All tests (intent)
1 testBrowse 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.

1 test introduced at this concept.

Introduced code

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

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

src/vs/platform/agentHost/node/agentService.ts 36 introduced LOC · 4 ranges

Open complete file

2559 promises.push((async () => {
2560 if (agent.getSubagentSessions) {
2561 > try { agentService.ts
2562 > const children = await agent.getSubagentSessions(session);
2563 > for (const child of children) {
2564 > this._registerRestoredSubagent(child, summary, sessionStr);
2565 > }
2566 > } catch (err) {
2567 this._logService.warn(`[AgentService] restoreSession failed to eagerly register subagents session=${sessionStr}`, err);
2568 }
2569 > } agentService.ts
2570 })());
2571
3776 */
3777 private _registerRestoredSubagent(child: IRestoredSubagentSession, parentSummary: SessionSummary, parentSessionStr: string): void {
3778 > const resourceStr = child.resource.toString(); agentService.ts
3779 > if (this._stateManager.getSessionState(resourceStr)) {
3780 return;
3781 }
3782 > const registeredNow = new Date().toISOString(); agentService.ts
3783 > this._stateManager.restoreSession(
3784 > {
3785 > resource: resourceStr,
3786 > provider: 'subagent',
3787 > title: child.title,
3788 > status: SessionStatus.Idle,
3789 > createdAt: registeredNow,
3790 > modifiedAt: registeredNow,
3791 > ...(parentSummary.project ? { project: parentSummary.project } : {}),
3792 > },
3793 > [...child.turns],
3794 > );
3795 >
3796 > // Mirror the live `_handleSubagentStarted` flow on restore: surface the
3797 > // subagent as a read-only peer chat in the PARENT session's catalog so it
3798 > // reappears as a tab (and the inline "Open Agent" link can reveal it)
3799 > // after a restart. Uses the same `ahp-chat://subagent/...` chat URI form
3800 > // as the live path so the sessions provider parses and surfaces it.
3801 > const subagentChatUri = buildSubagentChatUri(parentSessionStr, child.toolCallId);
3802 > this._stateManager.addChat(parentSessionStr, subagentChatUri, {
3803 > title: child.title,
3804 > turns: [...child.turns],
3805 > origin: { kind: ChatOriginKind.Tool, chat: buildDefaultChatUri(parentSessionStr), toolCallId: child.toolCallId },
3806 > interactivity: ChatInteractivity.ReadOnly,
3807 > });
3808 > }
3809
3810 private _findProviderForSession(session: URI | string): IAgent | undefined {