2108
*/
2109
private async _changeAgent(chat: URI, agent: AgentSelection | undefined): Promise<void> {
2111
>
const queueKey = context.isPeerChat ? context.chatKey : context.sessionId;
2112
>
await this._sessionSequencer.queue(queueKey, async () => {
2113
>
const current = this._getChatContext(chat);
2114
>
const sess = current.target;
2115
>
if (sess) {
2116
await sess.setAgent(agent);
2118
await this._metadataStore.write(current.isPeerChat ? chat : current.session, { agent: agent ?? null });
2119
}
2121
>
}
2122
2123
setServerToolHost(host: IAgentServerToolHost): void {