@@ -8,6 +8,7 @@ import { ChatExtendedRequestHandler, l10n, Uri } from 'vscode';
88import { ConfigKey , IConfigurationService } from '../../../platform/configuration/common/configurationService' ;
99import { IVSCodeExtensionContext } from '../../../platform/extContext/common/extensionContext' ;
1010import { IGitService } from '../../../platform/git/common/gitService' ;
11+ import { ITelemetryService } from '../../../platform/telemetry/common/telemetry' ;
1112import { Emitter , Event } from '../../../util/vs/base/common/event' ;
1213import { Disposable , DisposableStore , IDisposable } from '../../../util/vs/base/common/lifecycle' ;
1314import { localize } from '../../../util/vs/nls' ;
@@ -297,6 +298,7 @@ export class CopilotCLIChatSessionParticipant {
297298 @IGitService private readonly gitService : IGitService ,
298299 @ICopilotCLIModels private readonly copilotCLIModels : ICopilotCLIModels ,
299300 @ICopilotCLISessionService private readonly sessionService : ICopilotCLISessionService ,
301+ @ITelemetryService private readonly telemetryService : ITelemetryService ,
300302 ) { }
301303
302304 createHandler ( ) : ChatExtendedRequestHandler {
@@ -305,6 +307,23 @@ export class CopilotCLIChatSessionParticipant {
305307
306308 private async handleRequest ( request : vscode . ChatRequest , context : vscode . ChatContext , stream : vscode . ChatResponseStream , token : vscode . CancellationToken ) : Promise < vscode . ChatResult | void > {
307309 const { chatSessionContext } = context ;
310+
311+
312+ /* __GDPR__
313+ "copilotcli.chat.invoke" : {
314+ "owner": "joshspicer",
315+ "comment": "Event sent when a CopilotCLI chat request is made.",
316+ "hasChatSessionItem": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "comment": "Invoked with a chat session item." },
317+ "isUntitled": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "comment": "Indicates if the chat session is untitled." },
318+ "hasDelegatePrompt": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "comment": "Indicates if the prompt is a /delegate command." }
319+ }
320+ */
321+ this . telemetryService . sendMSFTTelemetryEvent ( 'copilotcli.chat.invoke' , {
322+ hasChatSessionItem : String ( ! ! chatSessionContext ?. chatSessionItem ) ,
323+ isUntitled : String ( chatSessionContext ?. isUntitled ) ,
324+ hasDelegatePrompt : String ( request . prompt . startsWith ( '/delegate' ) )
325+ } ) ;
326+
308327 if ( ! chatSessionContext ) {
309328 if ( request . acceptedConfirmationData || request . rejectedConfirmationData ) {
310329 stream . warning ( vscode . l10n . t ( 'No chat session context available for confirmation data handling.' ) ) ;
0 commit comments