copilotAgent.ts ×9

Frontier kind: Code frontier

unlabeled · c_bba9da3b52ad

2 tests · 51745 LOC · 300 files · introduces 0 tests · 32 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
10 ranges32 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
5010 ranges51745 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.

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: 32 introduced LOC across 10 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/node/copilot/copilotAgent.ts 30 introduced LOC · 9 ranges

Open complete file

443 this._slashCommandProvider = new CopilotSlashCommandProvider(() => this._ensureClient().then(c => c.rpc.commands.list().then(c => c.commands)), this._logService);
444 this._githubTelemetryRouter = isAgentHostTelemetryService(this._telemetryService)
445 > ? new AgentHostGitHubTelemetryRouter(this._telemetryService) copilotAgent.ts
446 : undefined;
447 this.onDidCustomizationsChange = this._plugins.onDidChange;
759 const rtEnabled = context?.restrictedTelemetryEnabled === true;
760 if (rtEnabled !== this._restrictedTelemetryEnabled) {
761 > this._restrictedTelemetryEnabled = rtEnabled; copilotAgent.ts
762 > this._logService.info(`[Copilot] Enhanced (restricted) telemetry ${rtEnabled ? 'enabled for this account' : 'disabled'}`);
763 > this._onDidChangeRestrictedTelemetry.fire();
764 > }
765 // Push the token-derived telemetry policy/identity to the restricted sender: `rt` gates
766 // enhanced GH telemetry (kept off for public users), `tid` becomes `copilot_trackingId`, and
767 // the endpoint routes at the user's CAPI telemetry host (dotcom, GHE, or proxy).
768 if (isAgentHostTelemetryService(this._telemetryService)) {
769 > this._telemetryService.setRestrictedTelemetryEnabled(rtEnabled); copilotAgent.ts
770 > this._telemetryService.setCopilotTrackingId(context?.trackingId);
771 > this._telemetryService.setRestrictedTelemetryEndpoint(context?.telemetryEndpoint);
772 > }
773 }
774
775 private async _routeGitHubTelemetry(notification: GitHubTelemetryNotification): Promise<void> {
776 > const router = this._githubTelemetryRouter; copilotAgent.ts
777 > if (!router?.isTarget(notification)) {
778 this._gitHubTelemetryForwarder.forward(notification);
779 return;
780 }
781 > if (!notification.restricted) { copilotAgent.ts
782 router.route(notification);
783 return;
784 }
786 > const sessionId = notification.sessionId;
787 > const githubToken = this._githubToken;
788 > if (!githubToken) {
789 router.route(notification);
790 return;
791 }
793 > try {
794 > const context = await this._copilotApiService.resolveRestrictedTelemetryContext(githubToken);
795 > if (this._githubToken !== githubToken) {
796 return;
797 }
798 > router.route(notification, { copilotAgent.ts
799 > restrictedTelemetryEnabled: context.restrictedTelemetryEnabled,
800 > trackingId: context.trackingId,
801 > telemetryEndpoint: toRestrictedTelemetryEndpoint(context.telemetryEndpoint),
802 > isInternal: context.isInternal === true,
803 > userName: context.userName,
804 > isVscodeTeamMember: context.isVscodeTeamMember === true,
805 > });
806 > } catch (error) {
807 this._logService.debug(`[Copilot:${sessionId}] Restricted telemetry context resolution failed; dropping ${notification.event.kind}: ${error instanceof Error ? error.message : String(error)}`);
808 }
809 > } copilotAgent.ts
810
811 /**
src/vs/platform/agentHost/node/agentHostGitHubTelemetryRouter.ts 2 introduced LOC · 1 range

Open complete file

27
28 isTarget(notification: GitHubTelemetryNotification): boolean {
29 > return targetDestinations.has(notification.event.kind); agentHostGitHubTelemetryRouter.ts
30 > }
31
32 route(notification: GitHubTelemetryNotification, context?: IAgentHostRestrictedTelemetryContext): boolean {