2313
2314
setPendingRequests(requests: readonly { requestId: string; kind: ChatRequestQueueKind }[]): void {
2315
>
const existingMap = new Map(this._pendingRequests.map(p => [p.request.id, p]));
chatModel.ts
2316
>
const newPending: IChatPendingRequest[] = [];
2317
>
for (const { requestId, kind } of requests) {
2318
>
const existing = existingMap.get(requestId);
2319
>
if (existing) {
2320
>
// Update kind if changed, keep existing request and sendOptions
2321
>
newPending.push(existing.kind === kind ? existing : { request: existing.request, kind, sendOptions: existing.sendOptions });
2322
>
}
2323
>
}
2324
>
this._pendingRequests.length = 0;
2325
>
this._pendingRequests.push(...newPending);
2326
>
this._onDidChangePendingRequests.fire();
2327
>
}
2328
2329
/**