2080
2081
private async _changeModel(chat: URI, model: ModelSelection): Promise<void> {
2083
>
const queueKey = context.isPeerChat ? context.chatKey : context.sessionId;
2084
>
await this._sessionSequencer.queue(queueKey, async () => {
2085
>
const current = this._getChatContext(chat);
2086
>
const sess = current.target;
2087
>
if (sess) {
2088
await sess.setModel(model);
2090
await this._metadataStore.write(chat, { model });
2091
} else {
2092
await this._metadataStore.write(current.session, { model });
2093
}
2095
await this._updateChatBackingModel(chat, model);
2096
}
2098
>
}
2099
2100
/**