@@ -95,9 +95,6 @@ export class NextEditLoggingService {
9595 outcome . accepted = true ;
9696 outcome . aborted = false ;
9797 this . logNextEditOutcome ( outcome ) ;
98- if ( outcome . requestId ) {
99- void this . logAcceptReject ( outcome . requestId , true ) ;
100- }
10198 this . _outcomes . delete ( completionId ) ;
10299 return outcome ;
103100 }
@@ -116,9 +113,6 @@ export class NextEditLoggingService {
116113 outcome . accepted = false ;
117114 outcome . aborted = false ;
118115 this . logNextEditOutcome ( outcome ) ;
119- if ( outcome . requestId ) {
120- void this . logAcceptReject ( outcome . requestId , false ) ;
121- }
122116 this . _outcomes . delete ( completionId ) ;
123117 return outcome ;
124118 }
@@ -151,9 +145,6 @@ export class NextEditLoggingService {
151145 outcome . accepted = false ;
152146 outcome . aborted = false ;
153147 this . logNextEditOutcome ( outcome ) ;
154- if ( outcome . requestId ) {
155- void this . logAcceptReject ( outcome . requestId , false ) ;
156- }
157148 this . _logRejectionTimeouts . delete ( completionId ) ;
158149 this . _outcomes . delete ( completionId ) ;
159150 } , COUNT_COMPLETION_REJECTED_AFTER ) ;
@@ -197,44 +188,15 @@ export class NextEditLoggingService {
197188 this . _logRejectionTimeouts . delete ( completionId ) ;
198189 }
199190
200- // If we have the full outcome, log it as aborted.
191+ // Only log if the completion was displayed to the user.
192+ // This aligns with Autocomplete behavior and prevents logging
193+ // of cancelled requests that never reached the user.
201194 if ( this . _outcomes . has ( completionId ) ) {
202195 const outcome = this . _outcomes . get ( completionId ) ! ;
203- outcome . accepted = false ;
196+ // outcome.accepted = false;
204197 outcome . aborted = true ;
205198 this . logNextEditOutcome ( outcome ) ;
206199 this . _outcomes . delete ( completionId ) ;
207- } else {
208- // Log minimal abort event for requests that never got displayed.
209- const pendingData = this . _pendingCompletions . get ( completionId ) ;
210-
211- const minimalAbortOutcome : Partial < NextEditOutcome > = {
212- completionId,
213- accepted : false ,
214- aborted : true ,
215- timestamp : Date . now ( ) ,
216- uniqueId : completionId ,
217- elapsed : pendingData ? Date . now ( ) - pendingData . startTime : 0 ,
218- modelName : pendingData ?. modelName || "unknown" ,
219- modelProvider : pendingData ?. modelProvider || "unknown" ,
220- fileUri : pendingData ?. filepath || "unknown" ,
221-
222- // Empty/default values for fields we don't have.
223- completion : "" ,
224- prompt : "" ,
225- userEdits : "" ,
226- userExcerpts : "" ,
227- originalEditableRange : "" ,
228- workspaceDirUri : "" ,
229- cursorPosition : { line : - 1 , character : - 1 } ,
230- finalCursorPosition : { line : - 1 , character : - 1 } ,
231- editableRegionStartLine : - 1 ,
232- editableRegionEndLine : - 1 ,
233- diffLines : [ ] ,
234- completionOptions : { } ,
235- } ;
236-
237- this . logNextEditOutcome ( minimalAbortOutcome as NextEditOutcome ) ;
238200 }
239201
240202 // Clean up.
@@ -255,6 +217,9 @@ export class NextEditLoggingService {
255217 } ) ;
256218
257219 // const { prompt, completion, prefix, suffix, ...restOfOutcome } = outcome;
220+ if ( outcome . requestId && outcome . accepted !== undefined ) {
221+ void this . logAcceptReject ( outcome . requestId , outcome . accepted ) ;
222+ }
258223 void Telemetry . capture ( "nextEditOutcome" , outcome , true ) ;
259224 }
260225
@@ -268,7 +233,7 @@ export class NextEditLoggingService {
268233 }
269234
270235 const controlPlaneEnv = getControlPlaneEnvSync ( "production" ) ;
271- await fetchwithRequestOptions (
236+ const resp = await fetchwithRequestOptions (
272237 new URL ( "model-proxy/v1/feedback" , controlPlaneEnv . CONTROL_PLANE_URL ) ,
273238 {
274239 method : "POST" ,
0 commit comments