File tree Expand file tree Collapse file tree
src/extension/chatSessions/copilotcli/node Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -325,13 +325,12 @@ export class CopilotCLISessionService extends Disposable implements ICopilotCLIS
325325 // return sessionItem;
326326 // }
327327
328- const sessionManager = await raceCancellationError ( this . getSessionManager ( ) , token ) ;
329- const sessionMetadataList = await raceCancellationError ( sessionManager . listSessions ( ) , token ) ;
330- await this . _sessionTracker . initialize ( ) ;
331- const metadata = sessionMetadataList . find ( s => s . sessionId === sessionId ) ;
332- if ( ! metadata ) {
328+ const sessionManager = await raceCancellation ( this . getSessionManager ( ) , token ) ;
329+ const metadata = sessionManager ? await raceCancellationError ( sessionManager . getSessionMetadata ( { sessionId } ) , token ) : undefined ;
330+ if ( ! metadata || token . isCancellationRequested ) {
333331 return ;
334332 }
333+ await this . _sessionTracker . initialize ( ) ;
335334 return await this . constructSessionItem ( metadata , token ) ;
336335 }
337336
You can’t perform that action at this time.
0 commit comments