copilotAgentSession.ts ×6

Frontier kind: Code frontier

unlabeled · c_fda5f096f057

4 tests · 44023 LOC · 242 files · introduces 0 tests · 29 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
7 ranges29 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
4144 ranges44023 lines · 242 files · Browse complete extent
All tests (intent)
4 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.

2 files ranked by introduced lines: 29 introduced LOC across 7 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

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

Open complete file

2572 return undefined;
2573 }
2575 > const fileUri = URI.file(filePath);
2576 > const fileUriStr = fileUri.toString();
2577 >
2578 > let beforeExists = false;
2579 > try {
2580 > beforeExists = await this._fileService.exists(fileUri);
2581 > } catch (err) {
2582 this._logService.warn(`[Copilot:${this.sessionId}] Failed to check file for edit preview: ${filePath}`, err);
2583 }
2585 > const afterUri = buildPendingEditContentUri(this._storageUri.toString(), toolCallId, filePath);
2586 > try {
2587 > await this._fileService.writeFile(afterUri, VSBuffer.fromString(newFileContents));
2588 > } catch (err) {
2589 this._logService.warn(`[Copilot:${this.sessionId}] Failed to write pending edit content for ${filePath}`, err);
2590 return undefined;
2591 }
2593 > // If the request was already resolved (aborted/disposed) while we
2594 > // were awaiting the write, drop the in-memory entry immediately;
2595 > // `_deletePendingEditContent` has already run and won't run again.
2596 > if (!this._pendingPermissions.has(toolCallId)) {
2597 this._fileService.del(afterUri).catch(err => {
2598 this._logService.warn(`[Copilot:${this.sessionId}] Failed to delete orphaned pending edit content: ${afterUri.toString()}`, err);
2600 return undefined;
2601 }
2602 > this._pendingEditContentUris.set(toolCallId, afterUri); copilotAgentSession.ts
2603 >
2604 const diffCounts = typeof request.diff === 'string' ? countUnifiedDiffLines(request.diff) : undefined;
2605
4562 return;
4563 }
4564 > this._pendingEditContentUris.delete(toolCallId); copilotAgentSession.ts
4565 > this._fileService.del(uri).catch(err => {
4566 this._logService.warn(`[Copilot:${this.sessionId}] Failed to delete pending edit content: ${uri.toString()}`, err);
4568 }
4569
src/vs/platform/agentHost/node/copilot/pendingEditContentStore.ts 6 introduced LOC · 1 range

Open complete file

24 */
25 export function buildPendingEditContentUri(sessionUri: string, toolCallId: string, filePath: string): URI {
26 > return URI.from({ pendingEditContentStore.ts
27 > scheme: PENDING_EDIT_CONTENT_SCHEME,
28 > authority: encodeHex(VSBuffer.fromString(sessionUri)).toString(),
29 > path: `/${encodeURIComponent(toolCallId)}/${encodeHex(VSBuffer.fromString(filePath))}`,
30 > });
31 > }
32
33 /**