copilotAgentSession.ts ×10

Frontier kind: Code frontier

unlabeled · c_7553c818eb13

8 tests · 43724 LOC · 243 files · introduces 0 tests · 29 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
10 ranges29 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
3999 ranges43724 lines · 243 files · Browse complete extent
All tests (intent)
8 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 10 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

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

Open complete file

2988
2989 private async _beginRepoInfoTelemetry(telemetryMessageId: string, isCurrent: () => boolean): Promise<{ readonly context: IAgentHostRestrictedTelemetryContext; readonly baseBranch: string | undefined } | undefined> {
2990 > let resolved: { readonly context: IAgentHostRestrictedTelemetryContext; readonly baseBranch: string | undefined } | undefined; copilotAgentSession.ts
2991 > try {
2992 > resolved = await this._resolveRepoInfoTelemetryContext();
2993 > } catch (error) {
2994 this._logService.warn(`[Copilot:${this.sessionId}] Failed to resolve repository info telemetry context: ${getErrorMessage(error)}`);
2995 return undefined;
2996 }
2997 > if (!resolved || this._store.isDisposed || !isCurrent()) { copilotAgentSession.ts
2998 return undefined;
2999 }
3000 await this._repoInfoTelemetry.reportBegin(resolved.context, this.sessionUri.toString(), telemetryMessageId, this._workingDirectory, resolved.baseBranch, isCurrent);
3001 return resolved;
3003
3004 private async _endRepoInfoTelemetry(telemetryMessageId: string, resolved: { readonly context: IAgentHostRestrictedTelemetryContext; readonly baseBranch: string | undefined } | undefined, isCurrent: () => boolean): Promise<void> {
3020
3021 private _cancelActiveRepoInfoTelemetry(): void {
3022 > const turn = this._activeRepoInfoTurn; copilotAgentSession.ts
3023 > if (!turn) {
3024 > return;
3025 > }
3026 this._activeRepoInfoTurn = undefined;
3027 turn.cancelled = true;
3028 void turn.begin.finally(() => this._repoInfoTelemetry.clearTurn(turn.telemetryMessageId));
3030
3031 private async _resolveRepoInfoTelemetryContext(): Promise<{ readonly context: IAgentHostRestrictedTelemetryContext; readonly baseBranch: string | undefined } | undefined> {
3032 > if (this._configurationService.getRootValue(platformRootSchema, AgentHostDisableRepoInfoTelemetryConfigKey) === true) { copilotAgentSession.ts
3033 return undefined;
3034 }
3041 this._databaseRef.object.getMetadata(META_DIFF_BASE_BRANCH),
3042 ]);
3043 > if (!rawContext.restrictedTelemetryEnabled && !rawContext.isInternal) { copilotAgentSession.ts
3044 return undefined;
3045 }
3046 return { context: this._toRepoInfoTelemetryContext(rawContext), baseBranch };
3048
3049 private _isLaunchTokenCurrent(): boolean {
4364
4365 this._register(wrapper.onTurnStart(e => {
4366 > this._currentTurn?.markRunning(); copilotAgentSession.ts
4367 > this._logService.trace(`[Copilot:${sessionId}] Turn started: ${e.data.turnId}`);
4368 > if (!e.agentId) {
4369 > const telemetryMessageId = this._currentTurn?.id ?? e.data.turnId;
4370 > if (this._activeRepoInfoTurn?.telemetryMessageId === telemetryMessageId) {
4371 return;
4372 }
4373 > this._cancelActiveRepoInfoTelemetry(); copilotAgentSession.ts
4374 > const turn: NonNullable<CopilotAgentSession['_activeRepoInfoTurn']> = {
4375 > telemetryMessageId,
4376 > cancelled: false,
4377 > begin: Promise.resolve(undefined),
4378 > };
4379 > const isCurrent = () => !turn.cancelled && this._isLaunchTokenCurrent();
4380 > turn.begin = this._beginRepoInfoTelemetry(telemetryMessageId, isCurrent);
4381 > this._activeRepoInfoTurn = turn;
4382 > }
4383 }));
4384