@@ -269,17 +269,16 @@ export class CopilotCLISession extends DisposableStore implements ICopilotCLISes
269269 this . logService . info ( `[CopilotCLISession] Steering session ${ this . sessionId } ` ) ;
270270 const disposables = new DisposableStore ( ) ;
271271 const logStartTime = Date . now ( ) ;
272- const abortController = new AbortController ( ) ;
273272 disposables . add ( token . onCancellationRequested ( ( ) => {
274- abortController . abort ( ) ;
273+ this . _sdkSession . abort ( ) ;
275274 } ) ) ;
276- disposables . add ( toDisposable ( ( ) => abortController . abort ( ) ) ) ;
275+ disposables . add ( toDisposable ( ( ) => this . _sdkSession . abort ( ) ) ) ;
277276
278277 try {
279278 // Send the steering prompt (completes quickly) and also wait for the
280279 // previous request to finish, so this promise settles only once all
281280 // in-flight work is done.
282- await Promise . all ( [ previousRequestPromise , this . sendRequestInternal ( input , attachments , true , logStartTime , abortController ) ] ) ;
281+ await Promise . all ( [ previousRequestPromise , this . sendRequestInternal ( input , attachments , true , logStartTime ) ] ) ;
283282 this . _logConversation ( prompt , '' , modelId || '' , attachments , logStartTime , 'Completed' ) ;
284283 } catch ( error ) {
285284 this . _logConversation ( prompt , '' , modelId || '' , attachments , logStartTime , 'Failed' , error instanceof Error ? error . message : String ( error ) ) ;
@@ -350,11 +349,10 @@ export class CopilotCLISession extends DisposableStore implements ICopilotCLISes
350349 this . logService . info ( `[CopilotCLISession] Invoking session ${ this . sessionId } ` ) ;
351350 const disposables = new DisposableStore ( ) ;
352351 const logStartTime = Date . now ( ) ;
353- const abortController = new AbortController ( ) ;
354352 disposables . add ( token . onCancellationRequested ( ( ) => {
355- abortController . abort ( ) ;
353+ this . _sdkSession . abort ( ) ;
356354 } ) ) ;
357- disposables . add ( toDisposable ( ( ) => abortController . abort ( ) ) ) ;
355+ disposables . add ( toDisposable ( ( ) => this . _sdkSession . abort ( ) ) ) ;
358356
359357 this . _status = ChatSessionStatus . InProgress ;
360358 this . _statusChange . fire ( this . _status ) ;
@@ -657,7 +655,7 @@ export class CopilotCLISession extends DisposableStore implements ICopilotCLISes
657655 } ) ) ) ;
658656
659657 if ( ! token . isCancellationRequested ) {
660- await this . sendRequestInternal ( input , attachments , false , logStartTime , abortController ) ;
658+ await this . sendRequestInternal ( input , attachments , false , logStartTime ) ;
661659 }
662660 this . logService . trace ( `[CopilotCLISession] Invoking session (completed) ${ this . sessionId } ` ) ;
663661
@@ -736,7 +734,7 @@ export class CopilotCLISession extends DisposableStore implements ICopilotCLISes
736734 * prompt is injected into the already-running conversation rather than
737735 * starting a new turn. This is the mechanism behind session steering.
738736 */
739- private async sendRequestInternal ( input : CopilotCLISessionInput , attachments : Attachment [ ] , steering = false , logStartTime : number , abortController : AbortController ) : Promise < void > {
737+ private async sendRequestInternal ( input : CopilotCLISessionInput , attachments : Attachment [ ] , steering = false , logStartTime : number ) : Promise < void > {
740738 const prompt = getPromptLabel ( input ) ;
741739 this . _logRequest ( prompt , this . _lastUsedModel || '' , attachments , logStartTime ) ;
742740
@@ -763,7 +761,7 @@ export class CopilotCLISession extends DisposableStore implements ICopilotCLISes
763761 } else {
764762 this . _sdkSession . currentMode = 'interactive' ;
765763 }
766- const sendOptions : SendOptions = { prompt : input . prompt , attachments, abortController , agentMode : this . _sdkSession . currentMode } ;
764+ const sendOptions : SendOptions = { prompt : input . prompt , attachments, agentMode : this . _sdkSession . currentMode } ;
767765 if ( steering ) {
768766 sendOptions . mode = 'immediate' ;
769767 }
0 commit comments