copilotAgentSession.ts ×12

Frontier kind: Code frontier

unlabeled · c_f6a224db52a9

40 tests · 43714 LOC · 242 files · introduces 0 tests · 36 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
12 ranges36 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
4018 ranges43714 lines · 242 files · Browse complete extent
All tests (intent)
40 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: 36 introduced LOC across 12 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts 36 introduced LOC · 12 ranges

Open complete file

1138
1139 private _clientToolName(toolName: string): string {
1140 > return this._isToolSearchActive() copilotAgentSession.ts
1141 && toolName === RUNTIME_TOOL_SEARCH_TOOL_NAME
1142 ? CLIENT_TOOL_SEARCH_REFERENCE_NAME
1143 : toolName;
1145
1146 private _toToolSearchCandidates(availableTools: readonly CurrentToolMetadata[] | undefined): readonly IToolSearchCandidate[] {
3249 return;
3250 }
3251 > const toolKind = getToolKind(e.data.toolName); copilotAgentSession.ts
3252 const subagentMeta = toolKind === 'subagent' ? getSubagentMetadata(parameters) : undefined;
3253
3258 if (ownerClientId) {
3259 contributor = { kind: ToolCallContributorKind.Client, clientId: ownerClientId };
3260 > } else if (e.data.mcpServerName) { copilotAgentSession.ts
3261 const customizationId = this._mcpCustomizations.customizationIdForServer(e.data.mcpServerName);
3262 if (customizationId !== undefined) {
3264 }
3265 }
3267 > // A new tool call invalidates the current markdown and reasoning
3268 > // parts so the next text/reasoning delta after the tool call
3269 > // starts a fresh part. Without invalidating reasoning here, a
3270 > // later round of reasoning (after tool_start/tool_complete)
3271 > // would silently append to the pre-tool-call reasoning block.
3272 this._currentTurn?.markdownPartIds.delete(parentToolCallId ?? '');
3273 this._currentTurn?.reasoningPartIds.delete(parentToolCallId ?? '');
3280 meta.subagentAgentName = subagentMeta.agentName;
3281 }
3282 > if (toolArgs !== undefined) { copilotAgentSession.ts
3283 meta.toolArguments = toolArgs;
3284 }
3285 > if (e.data.mcpServerName) { copilotAgentSession.ts
3286 meta.mcpServerName = e.data.mcpServerName;
3287 }
3288 > if (e.data.mcpToolName) { copilotAgentSession.ts
3289 meta.mcpToolName = e.data.mcpToolName;
3290 }
3291 > // eslint-disable-next-line local/code-no-untyped-meta-access -- Copilot SDK's own typed `_meta`, not the AHP protocol bag. copilotAgentSession.ts
3292 > const resourceUri = e.data.toolDescription?._meta?.ui?.resourceUri;
3293 this._setToolCallUiMeta(meta, resourceUri, e.data.mcpServerName);
3294
3299 const tracked = this._activeToolCalls.get(e.data.toolCallId);
3300 if (tracked) {
3301 > tracked.meta = meta; copilotAgentSession.ts
3302 > }
3303 >
3304 > this._emitAction({
3305 > type: ActionType.ChatToolCallStart,
3306 > turnId: this._turnId,
3307 > toolCallId: e.data.toolCallId,
3308 > toolName: e.data.toolName,
3309 > displayName,
3310 > intention: getShellIntention(e.data.toolName, parameters),
3311 > contributor,
3312 > _meta: toToolCallMeta(meta),
3313 > }, parentToolCallId);
3314 >
3315 > // No client is connected to run this client tool. Fail it
3316 > // immediately instead of leaving it pending until the
3317 > // server-side disconnect timeout fires. We emit the completion
3318 > // ourselves and drop the active-tool entry so the SDK's own
3319 > // tool.execution_complete for this id is suppressed.
3320 if (isClientTool && !contributor) {
3321 this._logService.warn(`[Copilot:${sessionId}] Client tool '${e.data.toolName}' started with no connected client; failing it immediately.`);
3961
3962 private _setToolCallUiMeta(meta: Mutable<IToolCallMeta>, resourceUri: string | undefined, mcpServerName: string | undefined): void {
3963 > if (!resourceUri) { copilotAgentSession.ts
3964 return;
3965 }