agentService.ts ×14

Frontier kind: Code frontier

unlabeled · c_2065d6b9cf80

144 tests · 47586 LOC · 285 files · introduces 0 tests · 41 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
14 ranges41 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
4621 ranges47586 lines · 285 files · Browse complete extent
All tests (intent)
144 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: 41 introduced LOC across 14 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/node/agentService.ts 41 introduced LOC · 14 ranges

Open complete file

632
633 registerProvider(provider: IAgent): void {
634 > if (this._providers.has(provider.id)) { agentService.ts
635 throw new Error(`Agent provider already registered: ${provider.id}`);
636 }
637 > this._logService.info(`Registering agent provider: ${provider.id}`); agentService.ts
638 > this._providers.set(provider.id, provider);
639 > provider.setServerToolHost?.(this._serverToolHost);
640 > // Deterministic subagent membership ordering: apply a spawned subagent's
641 > // catalog membership (via the spawn-channel handlers) BEFORE
642 > // AgentSideEffects — registered next — handles the same signal and starts
643 > // a turn on the subagent chat, which requires that chat to already exist.
644 > // Registering this listener ahead of the side-effects listener makes the
645 > // ordering independent of when the agent registers its own subagent->spawn
646 > // bridge; addChat/removeChat are idempotent, so the overlap is safe.
647 > this._providerSubscriptions.add(provider.onDidSessionProgress(signal => this._sequenceSpawnedChat(signal)));
648 > this._providerSubscriptions.add(this._sideEffects.registerProgressListener(provider));
649 > if (provider.onDidMaterializeSession) {
650 this._providerSubscriptions.add(provider.onDidMaterializeSession(e => this._onDidMaterializeSession(e)));
651 }
652 > if (provider.onMcpNotification) { agentService.ts
653 this._providerSubscriptions.add(provider.onMcpNotification(e => this._onMcpNotification.fire(e)));
654 }
655 > if (provider.onDidChangeChatData) { agentService.ts
656 this._providerSubscriptions.add(provider.onDidChangeChatData(e => this._onChatDataChanged(e)));
657 }
658 > if (provider.onDidSpawnChat) { agentService.ts
659 this._providerSubscriptions.add(provider.onDidSpawnChat(e => this._onChatSpawned(e)));
660 }
661 > this._registerSkillCompletionProvider(); agentService.ts
662 > if (!this._defaultProvider) {
663 > this._defaultProvider = provider.id;
664 > }
665 >
666 > // Update root state with current agents list
667 > this._updateAgents();
668 > }
669
670 private _registerSkillCompletionProvider(): void {
671 > if (this._skillCompletionProviderRegistered) { agentService.ts
672 return;
673 }
674 > this._skillCompletionProviderRegistered = true; agentService.ts
675 > const provider = this._register(new AgentHostSkillCompletionProvider(
676 > session => this._findProviderForSession(session),
677 > ));
678 > this._register(this._completions.registerProvider(provider));
679 > }
680
681 // ---- auth ---------------------------------------------------------------
2777 /** Marks a subagent chat as pending once its confirmed tool call reaches (or is about to reach) `Running`. */
2778 private _trackPendingSubagentChatFromEnvelope(envelope: ActionEnvelope): void {
2779 > const { channel, action } = envelope; agentService.ts
2780 > if (action.type === ActionType.ChatToolCallStart || action.type === ActionType.ChatToolCallDelta || action.type === ActionType.ChatToolCallReady) {
2781 const key = `${channel}:${action.toolCallId}`;
2782 // Providers stamp `toolKind`/`subagentChatUri` on whichever action
2800 return;
2801 }
2802 > if (action.type === ActionType.ChatToolCallConfirmed) { agentService.ts
2803 const key = `${channel}:${action.toolCallId}`;
2804 const subagentChatUri = this._pendingSubagentToolCalls.get(key);
2814 return;
2815 }
2816 > if (action.type === ActionType.ChatToolCallComplete) { agentService.ts
2817 // Defensive cleanup: a tool call can complete without ever being
2818 // confirmed (e.g. cancelled by other means) while still tracked.
2819 this._pendingSubagentToolCalls.delete(`${channel}:${action.toolCallId}`);
2820 }
2821 > } agentService.ts
2822
2823 private _armPendingSubagentChat(subagentChatUri: string): void {
3830 */
3831 private _updateAgents(): void {
3832 > this._agents.set([...this._providers.values()], undefined); agentService.ts
3833 > }
3834
3835 override dispose(): void {
3836 for (const provider of this._providers.values()) {
3837 > provider.dispose(); agentService.ts
3838 > }
3839 this._providers.clear();
3840 super.dispose();