66
77import * as vscode from 'vscode' ;
88import { editsAgentName , getChatParticipantIdFromName } from '../../../platform/chat/common/chatAgents' ;
9- import { ChatLocation } from '../../../platform/chat/common/commonTypes' ;
109import { EditSurvivalResult } from '../../../platform/editSurvivalTracking/common/editSurvivalReporter' ;
1110import { ILanguageDiagnosticsService } from '../../../platform/languages/common/languageDiagnosticsService' ;
1211import { IMultiFileEditInternalTelemetryService } from '../../../platform/multiFileEdit/common/multiFileEditQualityTelemetry' ;
@@ -23,7 +22,6 @@ import { CopilotInteractiveEditorResponse, InteractionOutcome } from '../../inli
2322import { participantIdToModeName } from '../../intents/common/intents' ;
2423import { EditCodeStepTurnMetaData } from '../../intents/node/editCodeStep' ;
2524import { Conversation , ICopilotChatResultIn } from '../../prompt/common/conversation' ;
26- import { IntentInvocationMetadata } from '../../prompt/node/conversation' ;
2725import { IFeedbackReporter } from '../../prompt/node/feedbackReporter' ;
2826import { sendUserActionTelemetry } from '../../prompt/node/telemetry' ;
2927
@@ -55,7 +53,7 @@ export class UserFeedbackService implements IUserFeedbackService {
5553 const result = e . result as ICopilotChatResultIn ;
5654 const conversation = result . metadata ?. responseId && this . conversationStore . getConversation ( result . metadata . responseId ) ;
5755
58- if ( typeof conversation === 'object' && conversation . getLatestTurn ( ) . getMetadata ( IntentInvocationMetadata ) ?. value ?. location === ChatLocation . Editor ) {
56+ if ( typeof conversation === 'object' && conversation . getLatestTurn ( ) . getMetadata ( CopilotInteractiveEditorResponse ) ) {
5957 this . _handleChatUserAction ( result . metadata ?. sessionId , agentId , conversation , e , undefined ) ;
6058 return ;
6159 }
@@ -380,16 +378,6 @@ export class UserFeedbackService implements IUserFeedbackService {
380378 return ;
381379 }
382380
383- const response = conversation . getLatestTurn ( ) . getMetadata ( CopilotInteractiveEditorResponse ) ;
384- if ( ! response ) {
385- return ;
386- }
387-
388- const interactionOutcome = conversation . getLatestTurn ( ) . getMetadata ( InteractionOutcome ) ;
389- if ( ! interactionOutcome ) {
390- return ;
391- }
392-
393381 let kind : InteractiveEditorResponseFeedbackKind | undefined ;
394382 if ( event ?. action . kind === 'editor' ) {
395383 kind = event . action . accepted ? InteractiveEditorResponseFeedbackKind . Accepted : InteractiveEditorResponseFeedbackKind . Undone ;
@@ -405,6 +393,15 @@ export class UserFeedbackService implements IUserFeedbackService {
405393 return ;
406394 }
407395
396+ const response = conversation . getLatestTurn ( ) . getMetadata ( CopilotInteractiveEditorResponse ) ;
397+ if ( ! response ) {
398+ return ;
399+ }
400+
401+ let interactionOutcome = conversation . getLatestTurn ( ) . getMetadata ( InteractionOutcome ) ;
402+ if ( ! interactionOutcome ) {
403+ interactionOutcome = new InteractionOutcome ( ! response . telemetry ?. editCount ? 'none' : 'inlineEdit' , [ ] ) ;
404+ }
408405
409406 if ( kind === InteractiveEditorResponseFeedbackKind . Bug && conversation ) {
410407 this . feedbackReporter . reportInline ( conversation , response . promptQuery , interactionOutcome ) ;
@@ -606,4 +603,4 @@ const outcomes = new Map([
606603 [ vscode . ChatEditingSessionActionOutcome . Accepted , 'accepted' ] ,
607604 [ vscode . ChatEditingSessionActionOutcome . Rejected , 'rejected' ] ,
608605 [ vscode . ChatEditingSessionActionOutcome . Saved , 'saved' ]
609- ] ) ;
606+ ] ) ;
0 commit comments