Chainlit#2899 - Hot-swap Chat Profile within an active conversation - #3015
Chainlit#2899 - Hot-swap Chat Profile within an active conversation#3015FosanzDev wants to merge 21 commits into
Conversation
There was a problem hiding this comment.
All reported issues were addressed across 10 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
All reported issues were addressed across 2 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
callbacks.py was modified to not trigger an error in the callback tests
There was a problem hiding this comment.
All reported issues were addressed across 12 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
All reported issues were addressed across 12 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
|
Closes #2355. @FosanzDev This requires at least E2E and backend unit tests and ideally also frontend unit tests. |
- New backend tests to test context and data layer - Mod. test_session to check actions on set_chat_profile calls - Mod. test_socket to also check actions on set_chat_profile that go through websocket
- Tests covering legacy flow compat, non-triggering new chat dialog on change when hot-swap is enabled - Tests convering if avatar icons are preserved when changing profiles
Validates in-place switching between profiles during an active chat.
There was a problem hiding this comment.
All reported issues were addressed across 7 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
- main.py: Used to do testing with a config file with flag set to true. Now it is explicitly set. This also fixes the env on the CI runs. - test_session.py: some methods modified the global state without reverting them unlike other tests do, leaving stale entries accross test runs. Corrected - ChatProfiles.spec.tsx: Added an untested branch for when chatProfiles array is empty. Also missing a not called assertion for set chat profiel
|
@dokterbob done added backend, frontend and E2E tests for this. |
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
2026-08-20.19-59-04.mp4
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_threadis on) after the first interaction.Backend
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.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.metadata.chat_profileso avatars resolve per message.Written for commit 7e2c863. Summary will update on new commits.