Skip to content

Commit ba51b25

Browse files
authored
agent sessions - prefer endTime for sorting and display (#278560)
1 parent aea5802 commit ba51b25

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ export class AgentSessionRenderer implements ICompressibleTreeRenderer<IAgentSes
230230
}
231231

232232
private renderStatus(session: ITreeNode<IAgentSessionViewModel, FuzzyScore>, template: IAgentSessionItemTemplate): void {
233-
const getStatus = (session: IAgentSessionViewModel) => `${session.providerLabel}${fromNow(session.timing.startTime)}`;
233+
const getStatus = (session: IAgentSessionViewModel) => `${session.providerLabel}${fromNow(session.timing.endTime || session.timing.startTime)}`;
234234

235235
template.status.textContent = getStatus(session.element);
236236
const timer = template.elementDisposable.add(new IntervalTimer());
@@ -346,8 +346,8 @@ export class AgentSessionsSorter implements ITreeSorter<IAgentSessionViewModel>
346346
return 1; // a (finished) comes after b (in-progress)
347347
}
348348

349-
// Both in-progress or finished: sort by start time (most recent first)
350-
return sessionB.timing.startTime - sessionA.timing.startTime;
349+
// Both in-progress or finished: sort by end or start time (most recent first)
350+
return (sessionB.timing.endTime || sessionB.timing.startTime) - (sessionA.timing.endTime || sessionA.timing.startTime);
351351
}
352352
}
353353

0 commit comments

Comments
 (0)