copilotAgentSession.ts ×10

Frontier kind: Code frontier

unlabeled · c_83600b2cb677

6 tests · 43821 LOC · 243 files · introduces 0 tests · 21 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
10 ranges21 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
4030 ranges43821 lines · 243 files · Browse complete extent
All tests (intent)
6 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: 21 introduced LOC across 10 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts 21 introduced LOC · 10 ranges

Open complete file

1361 return { kind: 'token', accessToken: githubToken };
1362 }
1363 > const resource = this._protectedResourceFromMcpAuthRequest(request); copilotAgentSession.ts
1364 const requiredScopes = this._scopesFromChallenge(request.wwwAuthenticateParams?.scope);
1365 const oauthClient: McpAuthRequirement['oauthClient'] = request.staticClientConfig?.publicClient
1399 }, toolCall.parentToolCallId);
1400 }
1401 > this._logService.info(`[Copilot:${this.sessionId}] MCP server '${request.serverName}' requires authentication for ${resource.resource}`); copilotAgentSession.ts
1402 > return deferred.p.finally(() => this._pendingMcpAuthRequests.delete(request.requestId));
1403 }
1404
1405 private _activeMcpToolCalls(serverName: string): IMcpAuthToolCall[] {
1406 > if (!this._turnId) { copilotAgentSession.ts
1407 return [];
1408 }
1414 }
1415 return result;
1417
1418 private async _initialGitHubMcpToken(request: McpAuthRequest): Promise<string | undefined> {
1436
1437 private _protectedResourceFromMcpAuthRequest(request: McpAuthRequest): ProtectedResourceMetadata {
1438 > if (request.resourceMetadata) { copilotAgentSession.ts
1439 try {
1440 const parsed = JSON.parse(request.resourceMetadata);
1447 }
1448 }
1449 > const scopes = this._scopesFromChallenge(request.wwwAuthenticateParams?.scope); copilotAgentSession.ts
1450 > return {
1451 > resource: request.serverUrl,
1452 > resource_name: request.serverName,
1453 > scopes_supported: scopes.length ? scopes.slice() : undefined,
1454 > };
1455 > }
1456
1457 private _scopesFromChallenge(scope: string | undefined): readonly string[] {
1460
1461 private _mcpAuthRequiredReason(reason: McpAuthRequest['reason']): McpAuthRequiredReason {
1462 > switch (reason) { copilotAgentSession.ts
1463 > case 'refresh':
1464 > case 'reauth':
1465 return McpAuthRequiredReason.Expired;
1466 > case 'upscope': copilotAgentSession.ts
1467 return McpAuthRequiredReason.InsufficientScope;
1468 > case 'initial': copilotAgentSession.ts
1469 > default:
1470 return McpAuthRequiredReason.Required;
1472 > }
1473
1474 private _scopesSatisfy(provided: readonly string[] | undefined, required: readonly string[]): boolean {