File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
src/vs/workbench/contrib/chat/browser/chatSessions Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -135,14 +135,15 @@ export class LocalChatSessionsProvider extends Disposable implements IChatSessio
135135 this . chatService . getLiveSessionItems ( ) . forEach ( sessionDetail => {
136136 let status : ChatSessionStatus | undefined ;
137137 let startTime : number | undefined ;
138+ let endTime : number | undefined ;
138139 const model = this . chatService . getSession ( sessionDetail . sessionResource ) ;
139140 if ( model ) {
140141 status = this . modelToStatus ( model ) ;
141- const requests = model . getRequests ( ) ;
142- if ( requests . length > 0 ) {
143- startTime = requests . at ( 0 ) ?. timestamp ;
144- } else {
145- startTime = Date . now ( ) ;
142+ startTime = model . timestamp ;
143+
144+ const lastResponse = model . getRequests ( ) . at ( - 1 ) ?. response ;
145+ if ( lastResponse ) {
146+ endTime = lastResponse . completedAt ?? lastResponse . timestamp ;
146147 }
147148 }
148149 const statistics = model ? this . getSessionStatistics ( model ) : undefined ;
@@ -153,7 +154,8 @@ export class LocalChatSessionsProvider extends Disposable implements IChatSessio
153154 status,
154155 provider : this ,
155156 timing : {
156- startTime : startTime ?? 0
157+ startTime : startTime ?? Date . now ( ) , // TODO@osortega this is not so good
158+ endTime
157159 } ,
158160 statistics
159161 } ;
You can’t perform that action at this time.
0 commit comments