chainlit icon indicating copy to clipboard operation
chainlit copied to clipboard

Avatar image is broken when reading threads from history

Open LucasMagnum opened this issue 5 months ago • 7 comments

Describe the bug

The PR https://github.com/Chainlit/chainlit/pull/1326 introduces a bug when it expects the get_avatar to match string (https://github.com/Chainlit/chainlit/pull/1326/files#diff-9a73e67e163edc3fae6839bf2bcc8c6ab650624eff6668502388a7a86b7ece78R964) .

The Frontend app can make requests to the avatar that do not match the Regex (https://github.com/Chainlit/chainlit/blob/main/frontend/src/components/molecules/messages/components/Avatar.tsx#L31) this creates a bug for existing applications where the config.ui.name contains space (e.g. My Assistant).

To Reproduce Set your config.ui.name to My Assistant

  1. Create a thread
  2. Publish messages
  3. Create a new thread
  4. Try to resume the previous thread
  5. See the 400 error and the avatar not showing

Expected behavior Avatar should be loaded for threads in history.

LucasMagnum avatar Sep 24 '24 10:09 LucasMagnum