copilotAgentSession.ts ×7

Frontier kind: Code frontier

unlabeled · c_facf8e1577d5

18 tests · 43719 LOC · 243 files · introduces 0 tests · 24 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
7 ranges24 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
3996 ranges43719 lines · 243 files · Browse complete extent
All tests (intent)
18 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 7 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts 24 introduced LOC · 7 ranges

Open complete file

3367
3368 this._register(wrapper.onToolComplete(async e => {
3369 > this._approvedDuplicablePermissionSignatures.delete(e.data.toolCallId); copilotAgentSession.ts
3370 > const tracked = this._activeToolCalls.get(e.data.toolCallId);
3371 > if (!tracked) {
3372 return;
3373 }
3374 const parentToolCallId = tracked.parentToolCallId ?? this._parentToolCallIdForSubagentEvent(e);
3375 > if (!parentToolCallId && e.agentId) { copilotAgentSession.ts
3376 this._logService.warn(`[Copilot:${this.sessionId}] Dropping tool.execution_complete for unknown subagent agentId=${e.agentId}`);
3377 return;
3380 this._activeToolCalls.delete(e.data.toolCallId);
3381 this._autoApprovals.delete(e.data.toolCallId);
3382 > this._pendingAutoApprovals.get(e.data.toolCallId)?.complete(undefined); copilotAgentSession.ts
3383 > const displayName = tracked.displayName;
3384 > const toolOutput = e.data.error?.message ?? e.data.result?.content;
3385 >
3386 > if (isTaskCompleteTool(tracked.toolName)) {
3387 const summary = getTaskCompleteMarkdown(tracked.parameters, toolOutput);
3388 if (summary) {
3405 // the terminal block (skip if any terminal block was already added
3406 // while the tool was running).
3407 > const ptyTerminalUri = isShellTool(tracked.toolName) ? this._shellManager?.getTerminalUriForToolCall(e.data.toolCallId) : undefined; copilotAgentSession.ts
3408 > let retireNonPtyShellTracking = !!ptyTerminalUri;
3409 > if (ptyTerminalUri && !content.some(c => c.type === ToolResultContentType.Terminal)) {
3410 content.push({
3411 type: ToolResultContentType.Terminal,
3415 }
3416
3417 > const shellExit = appendSdkToolResultContent(content, e.data.result?.contents, { session: this.sessionUri, toolCallId: e.data.toolCallId, title: tracked.displayName }); copilotAgentSession.ts
3418 > if (isShellTool(tracked.toolName) && !ptyTerminalUri) {
3419 const completion = this._nonPtyShellTerminals.completeToolCall(e.data.toolCallId, toolOutput, shellExit);
3420 if (completion) {
3436 }
3437
3438 > const command = isString(tracked.parameters?.command) ? tracked.parameters.command : undefined; copilotAgentSession.ts
3439 > const filePaths = isEditTool(tracked.toolName, command) ? this._getEditFilePaths(tracked.parameters) : [];
3440 > for (const filePath of filePaths) {
3441 try {
3442 const fileEdit = await this._editTracker.takeCompletedEdit(this._turnId, e.data.toolCallId, filePath, tracked.toolName, tracked.parameters, this._lastSeenModelId);
3455 result: {
3456 success: e.data.success,
3457 > pastTenseMessage: getPastTenseMessage(tracked.toolName, displayName, tracked.parameters, e.data.success, e.data.success ? toolOutput : undefined), copilotAgentSession.ts
3458 > content: content.length > 0 ? content : undefined,
3459 > error: e.data.error,
3460 > },
3461 > _meta: tracked.meta ? toToolCallMeta(tracked.meta) : undefined,
3462 > }, parentToolCallId);
3463 > if (retireNonPtyShellTracking) {
3464 // Preserve the terminal result in chat state before removing its
3465 // now-redundant live output resource from the host.