1393
*/
1394
private _aggregateChatSummaries(chats: readonly ChatSummary[], defaultChat: URI | undefined): { status?: SessionStatus; activity?: string; modifiedAt?: number } {
1396
return {};
1397
}
1399
>
const base = (defaultChat !== undefined ? chats.find(c => c.resource === defaultChat) : undefined)
1400
?? chats.reduce((a, b) => Date.parse(b.modifiedAt) > Date.parse(a.modifiedAt) ? b : a);
1402
>
let driver = base;
1403
>
const errorChat = chats.find(c => (c.status & SessionStatus.Error) === SessionStatus.Error);
1404
>
const inputChat = chats.find(c => (c.status & SessionStatus.InputNeeded) === SessionStatus.InputNeeded);
1405
>
// `InputNeeded` is a superset of the `InProgress` bit, so exclude
1406
>
// input-needed chats here to find one that is purely streaming.
1407
>
const inProgressChat = chats.find(c => (c.status & SessionStatus.InputNeeded) === SessionStatus.InProgress);
1408
>
if (inputChat) {
1409
status = SessionStatus.InputNeeded;
1410
driver = inputChat;
1412
status = SessionStatus.Error;
1413
driver = errorChat;
1415
status = SessionStatus.InProgress;
1416
driver = inProgressChat;
1417
}
1418
>
const modifiedAt = chats.reduce((max, c) => Math.max(max, Date.parse(c.modifiedAt)), 0);
agentHostStateManager.ts
1419
>
return { status, activity: driver.activity, modifiedAt };
1420
>
}
1421
1422
/**