785
return;
786
}
788
if (chatUri === sessionState.defaultChat || isDefaultChatUri(chatUri)) {
789
this._logService.warn(`[AgentHostStateManager] refusing to remove default chat: ${chatUri}`);
790
return;
791
}
793
>
// state. A peer chat can be removed while it still has an active turn;
794
>
// because active-turn tracking is driven by chat state transitions,
795
>
// deleting the ChatState here without this would strand the chat URI in
796
>
// the active set forever, keeping the session permanently "active"
797
>
// (activeSessions > 0) and leaving changeset operations disabled.
798
>
this._removeChatActiveTurn(session, chatUri);
799
>
this._chatStates.delete(chatUri);
800
>
this._chatProviderData.delete(chatUri);
801
>
this.dispatchServerAction(session, { type: ActionType.SessionChatRemoved, chat: chatUri });
802
}
803