copilotAgent.ts ×8

Frontier kind: Joint frontier

unlabeled · c_f57e9ec5c181

2 tests · 51746 LOC · 300 files · introduces 1 test · 23 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
8 ranges23 lines · 1 files
Tests
1 test

Contains — complete concept membership

All code (extent)
4988 ranges51746 lines · 300 files · Browse complete extent
All tests (intent)
2 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.

1 test introduced at this concept.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

1 file ranked by introduced lines: 23 introduced LOC across 8 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/node/copilot/copilotAgent.ts 23 introduced LOC · 8 ranges

Open complete file

586
587 protected _createCopilotClient(options: CopilotClientOptions): CopilotClient {
588 > return new CopilotClient(options); copilotAgent.ts
589 > }
590
591 // ---- auth ---------------------------------------------------------------
902 // retry would just resurrect the client we are tearing down.
903 if (this._githubToken !== tokenAtRefreshStart || this._modelCatalogGeneration !== generation || this._shutdownPromise) {
904 > return; copilotAgent.ts
905 > }
906 if (attempt + 1 < this._modelRefreshMaxAttempts) {
907 const delay = this._modelRefreshBackoff(attempt);
1024 return;
1025 }
1026 > if (typeof connection.sendRequest !== 'function') { copilotAgent.ts
1027 this._logService.warn(`[Copilot] Could not enable plan mode: client.connection.sendRequest is ${typeof connection.sendRequest}`);
1028 return;
1029 }
1030 > if (typeof connection.onRequest !== 'function') { copilotAgent.ts
1031 this._logService.warn(`[Copilot] Could not enable plan mode: client.connection.onRequest is ${typeof connection.onRequest}`);
1032 return;
1033 }
1034 > const originalSendRequest = connection.sendRequest.bind(connection); copilotAgent.ts
1035 > connection.sendRequest = (method: string, params: unknown) => {
1036 > if ((method === 'session.create' || method === 'session.resume') && params && typeof params === 'object') {
1037 return originalSendRequest(method, { ...params as Record<string, unknown>, requestExitPlanMode: true });
1038 }
1039 > return originalSendRequest(method, params); copilotAgent.ts
1040 > };
1041 }
1042
1492 return existing;
1493 }
1494 > // A workspace-less session (inferred from an absent input copilotAgent.ts
1495 > // `workingDirectory`) gets a STABLE, deterministic per-session scratch
1496 > // dir (mirroring the GitHub app's `<copilotHome>/chats/<id>`) rather than
1497 > // a throwaway `os.tmpdir()` dir, so the cwd survives reloads and isn't
1498 > // lost to OS temp reaping.
1499 > if (isWorkspaceless) {
1500 > const scratchDir = this._workspacelessScratchDir(sessionId);
1501 > await fs.mkdir(scratchDir.fsPath, { recursive: true });
1502 > return scratchDir;
1503 > }
1504 const tmpPath = await fs.mkdtemp(join(os.tmpdir(), 'agent-host-session-'));
1505 const workingDirectory = URI.file(tmpPath);
1514 */
1515 private _workspacelessScratchDir(sessionId: string): URI {
1516 > return workspacelessScratchDir(this._environmentService.userHome, sessionId); copilotAgent.ts
1517 > }
1518
1519 /** Ensures a workspace-less chat's scratch dir exists (mkdir -p), recreating it if it was reaped. */