2761
2762
private async _changeModel(chat: URI, model: ModelSelection): Promise<void> {
2763
>
const longContextWindow = this._longContextWindowFor(model.id);
copilotAgent.ts
2764
>
const freeLongContext = this._isFreeLongContext(model.id);
2765
>
const context = this._getChatContext(chat);
2766
>
// Same override the launcher applies at create (validated + logged by
2767
>
// resolveCopilotReasoningEffort); computed at the point of use so the
2768
>
// provisional-session path doesn't resolve or log it prematurely.
2769
>
if (context.isPeerChat) {
2770
>
await context.target?.setModel(model.id, resolveCopilotReasoningEffort(model, this._configurationService, this._logService, context.sessionId), getCopilotContextTier(model, longContextWindow, freeLongContext));
2771
>
const backing = this._chatBackings.get(context.chatKey);
2772
>
if (backing) {
2773
const updated: IPersistedChat = { ...backing, model };
2774
this._chatBackings.set(context.chatKey, updated);
2775
this._onDidChangeChatData.fire({ chat: chat, providerData: encodeProviderData(updated) });
2776
}
2778
>
}
2779
const provisional = this._provisionalSessions.get(context.sessionId);
2780
if (provisional) {