Skip to content

Commit cd8dfd2

Browse files
authored
Enable used references by default (microsoft#196654)
* Add sessionId, agent, and slash command to core telemetry * Enable used references by default
1 parent a35d42b commit cd8dfd2

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

src/vs/workbench/contrib/chat/browser/chatListRenderer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,10 @@ export class ChatListItemRenderer extends Disposable implements ITreeRenderer<Ch
143143
this._treePool = this._register(this.instantiationService.createInstance(TreePool, this._onDidChangeVisibility.event));
144144
this._contentReferencesListPool = this._register(this.instantiationService.createInstance(ContentReferencesListPool, this._onDidChangeVisibility.event));
145145

146-
this._usedReferencesEnabled = configService.getValue('chat.experimental.usedReferences') ?? productService.quality !== 'stable';
146+
this._usedReferencesEnabled = configService.getValue('chat.experimental.usedReferences') ?? true;
147147
this._register(configService.onDidChangeConfiguration(e => {
148148
if (e.affectsConfiguration('chat.experimental.usedReferences')) {
149-
this._usedReferencesEnabled = configService.getValue('chat.experimental.usedReferences') ?? productService.quality !== 'stable';
149+
this._usedReferencesEnabled = configService.getValue('chat.experimental.usedReferences') ?? true;
150150
}
151151
}));
152152
}

src/vs/workbench/contrib/chat/common/chatServiceImpl.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ type ChatProviderInvokedEvent = {
4949
totalTime: number | undefined;
5050
result: 'success' | 'error' | 'errorWithOutput' | 'cancelled' | 'filtered';
5151
requestType: 'string' | 'followup' | 'slashCommand';
52+
chatSessionId: string;
53+
agent: string;
5254
slashCommand: string | undefined;
5355
};
5456

@@ -58,6 +60,8 @@ type ChatProviderInvokedClassification = {
5860
totalTime: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; isMeasurement: true; comment: 'The total time it took to run the provider\'s `provideResponseWithProgress`.' };
5961
result: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether invoking the ChatProvider resulted in an error.' };
6062
requestType: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The type of request that the user made.' };
63+
chatSessionId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'A random ID for the session.' };
64+
agent: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The type of agent used.' };
6165
slashCommand?: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The type of slashCommand used.' };
6266
owner: 'roblourens';
6367
comment: 'Provides insight into the performance of Chat providers.';
@@ -492,7 +496,9 @@ export class ChatService extends Disposable implements IChatService {
492496
totalTime: stopWatch.elapsed(),
493497
result: 'cancelled',
494498
requestType,
495-
slashCommand: usedSlashCommand?.command
499+
agent: agentPart?.agent.id ?? '',
500+
slashCommand: agentSlashCommandPart ? agentSlashCommandPart.command.name : usedSlashCommand?.command,
501+
chatSessionId: model.sessionId
496502
});
497503

498504
model.cancelRequest(request);
@@ -597,7 +603,9 @@ export class ChatService extends Disposable implements IChatService {
597603
totalTime: rawResponse.timings?.totalElapsed,
598604
result,
599605
requestType,
600-
slashCommand: usedSlashCommand?.command
606+
agent: agentPart?.agent.id ?? '',
607+
slashCommand: agentSlashCommandPart ? agentSlashCommandPart.command.name : usedSlashCommand?.command,
608+
chatSessionId: model.sessionId
601609
});
602610
model.setResponse(request, rawResponse);
603611
this.trace('sendRequest', `Provider returned response for session ${model.sessionId}`);

0 commit comments

Comments
 (0)