copilotAgentSession.ts ×6

Frontier kind: Code frontier

unlabeled · c_8ea9ae7f0aa5

23 tests · 43637 LOC · 242 files · introduces 0 tests · 29 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
6 ranges29 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
3990 ranges43637 lines · 242 files · Browse complete extent
All tests (intent)
23 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: 29 introduced LOC across 6 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts 29 introduced LOC · 6 ranges

Open complete file

2272 return { kind: 'reject' };
2273 }
2275 > // For write permission requests, build a FileEdit preview so the
2276 > // client can show a diff before the user approves or denies. This
2277 > // awaits async filesystem operations; the SDK already calls
2278 > // `handlePermissionRequest` from an arbitrary async context, so the
2279 > // extra await here is fine.
2280 > const edits = await this._buildEditsForPermission(request, toolCallId);
2281 >
2282 > // If the session was aborted/disposed while we were building the
2283 > // preview, the deferred has already been resolved and the
2284 > // `pending-edit-content:` entry has been cleaned up. Bail without
2285 > // firing tool_ready.
2286 > if (!this._pendingPermissions.has(toolCallId)) {
2287 return { kind: 'reject' };
2288 }
2564 */
2565 private async _buildEditsForPermission(request: ITypedPermissionRequest, toolCallId: string): Promise<{ items: FileEdit[] } | undefined> {
2566 > if (request.kind !== 'write') { copilotAgentSession.ts
2567 return undefined;
2568 }
2569 > const filePath = typeof request.fileName === 'string' ? request.fileName : undefined; copilotAgentSession.ts
2570 > const newFileContents = typeof request.newFileContents === 'string' ? request.newFileContents : undefined;
2571 > if (!filePath || newFileContents === undefined) {
2572 return undefined;
2573 }
2602 this._pendingEditContentUris.set(toolCallId, afterUri);
2603
2604 > const diffCounts = typeof request.diff === 'string' ? countUnifiedDiffLines(request.diff) : undefined; copilotAgentSession.ts
2605 >
2606 > const edit: FileEdit = {
2607 > ...(beforeExists ? { before: { uri: fileUriStr, content: { uri: fileUriStr } } } : {}),
2608 > after: { uri: fileUriStr, content: { uri: afterUri.toString() } },
2609 > ...(diffCounts ? { diff: diffCounts } : {}),
2610 > };
2611 > return { items: [edit] };
2612 > }
2613
2614 respondToPermissionRequest(requestId: string, approved: boolean): boolean {
4558 */
4559 private _deletePendingEditContent(toolCallId: string): void {
4560 > const uri = this._pendingEditContentUris.get(toolCallId); copilotAgentSession.ts
4561 > if (!uri) {
4562 return;
4563 }
4566 this._logService.warn(`[Copilot:${this.sessionId}] Failed to delete pending edit content: ${uri.toString()}`, err);
4567 });
4569
4570 private _cancelPendingUserInputs(): void {