agentSideEffects.ts ×4

Frontier kind: Code frontier

unlabeled · c_35d17384426d

13 tests · 43111 LOC · 238 files · introduces 0 tests · 51 LOC · 4 files

Introduces — evidence that enters the hierarchy at this concept

Code
9 ranges51 lines · 4 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
4192 ranges43111 lines · 238 files · Browse complete extent
All tests (intent)
13 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.

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

src/vs/platform/agentHost/node/agentHostToolCallTracker.ts 19 introduced LOC · 3 ranges

Open complete file

105
106 toolCallCompleted(session: string, toolCallId: string, result: ToolCallResult): void {
107 > const key = this._key(session, toolCallId); agentHostToolCallTracker.ts
108 > const timing = this._toolCalls.get(key);
109 > if (!timing) {
110 // No matching start: either the start was never observed, or this is
111 // a duplicate completion (the entry was already consumed). Either
113 return;
114 }
115 > this._toolCalls.delete(key); agentHostToolCallTracker.ts
116 > const resultBucket = deriveToolInvokedResult(result);
117 > const totalTimeMs = timing.stopWatch.elapsed();
118 >
119 > this._reporter.toolInvoked({
120 > provider: timing.provider,
121 > session: timing.session,
122 > toolId: timing.toolId,
123 > toolSourceKind: timing.toolSourceKind,
124 > result: resultBucket,
125 > invocationTimeMs: totalTimeMs,
126 > });
127 >
128 > const stalled = this._stalledToolCalls.get(key);
129 > if (stalled) {
130 this._stalledToolCalls.delete(key);
131 this._reporter.stalledToolCallCompleted({
140 });
141 }
143
144 toolCallBlocked(provider: string, session: string, request: ToolCallBlockerRequest): void {
src/vs/platform/agentHost/node/agentSideEffects.ts 17 introduced LOC · 4 ranges

Open complete file

690 // ChatToolCallContentChanged while running.
691 if (action.type === ActionType.ChatToolCallComplete) {
692 > const subagent = this._subagentChats.get(sessionKey, action.toolCallId); agentSideEffects.ts
693 > if (subagent) {
694 const parentState = this._stateManager.getSessionState(sessionKey);
695 const runningContent = this._getRunningToolCallContent(parentState, turnId, action.toolCallId);
702
703 }
705
706 this._stateManager.dispatchServerAction(sessionKey, action);
715
716 if (action.type === ActionType.ChatToolCallComplete) {
717 > // Emit `languageModelToolInvoked` telemetry for the completed tool agentSideEffects.ts
718 > // call. `action.result` carries `success`/`error.code` even after the
719 > // subagent-content merge above (which only touches `result.content`).
720 > this._toolCallTracker.toolCallCompleted(sessionKey, action.toolCallId, action.result);
721 >
722 > // Drop any events that were buffered for a subagent whose
723 > // `subagent_started` never arrived (e.g. the parent tool failed
724 > // before the subagent was created). The actual subagent session
725 > // teardown is driven by the `subagent_completed` signal because
726 > // background subagents (`mode: background`) continue running
727 > // after the parent tool call returns.
728 > this._pendingSubagentSignals.delete(sessionKey, action.toolCallId);
729 > if (getToolFileEdits(action.result).length > 0) {
730 this._changesets.onToolCallEditsApplied(sessionUri, turnId);
731 }
733
734 if (action.type === ActionType.ChatTurnComplete) {
src/vs/platform/agentHost/node/agentHostTelemetryReporter.ts 14 introduced LOC · 1 range

Open complete file

510
511 toolInvoked(report: IAgentHostToolInvokedReport): void {
512 > // `chatSessionId` is the full session URI string (matching the value agentHostTelemetryReporter.ts
513 > // previously emitted by `CopilotAgentSession`). Action signals are keyed
514 > // by their chat-channel URI, so normalize it back to the session URI.
515 > const session = isAhpChatChannel(report.session) ? parseRequiredSessionUriFromChatUri(report.session) : report.session;
516 > this._telemetryService.publicLog2<LanguageModelToolInvokedEvent, LanguageModelToolInvokedClassification>('languageModelToolInvoked', {
517 > result: report.result,
518 > chatSessionId: session,
519 > toolId: report.toolId,
520 > toolExtensionId: undefined,
521 > toolSourceKind: report.toolSourceKind,
522 > invocationTimeMs: report.invocationTimeMs,
523 > provider: report.provider,
524 > });
525 > }
526
527 toolCallStalled(report: IAgentHostToolCallStalledReport): void {
src/vs/platform/agentHost/common/state/sessionState.ts 1 introduced LOC · 1 range

Open complete file

510 */
511 export function getToolFileEdits(result: ToolCallResult): ToolResultFileEditContent[] {
512 > if (!result.content || result.content.length === 0) { sessionState.ts
513 return [];
514 }