Chainlit#2899 - Hot-swap Chat Profile within an active conversation
FO
3mo ago+1230+1230+0123456789012345678901234567890123456789-43-43-01234567890123456789
This feature allows users to hot-swap between chat profiles within a conversation.
As shown in the video, when going back to a chat, it sets the latest used profile
https://github.com/user-attachments/assets/0db1239f-2e53-4f69-a67b-e21d1df4ca2c
Summary by cubic
Hot-swaps the chat profile during an active conversation so switching no longer reconnects or resets the thread. Previously, switching profiles forced a reconnect; now the session updates in place and persists the last used profile (and thread tag when features.auto_tag_thread is on) after the first interaction.
Backend
- Adds opt-in
features.hot_swap_chat_profileandcl.set_chat_profile(name | None), which validates against@cl.set_chat_profiles, updates the session config, persists to thread metadata, and emitschat_profile_updated. - The
set_chat_profileevent is ignored when the feature is off; metadata redaction keepschat_profileandchat_settings, and restoration honors an explicitly unset profile.
Frontend
hotSwapChatProfileswitches in place without recreating the socket; Chat Profiles hot-swaps when the feature is on, otherwise falls back to the confirm-and-reset flow.- New, updated, streamed, and ask messages are stamped with
metadata.chat_profileso avatars resolve per message.