Skip to content

Attachments disappear when resuming thread #2806

@maxchen-002

Description

@maxchen-002

Describe the bug
File attachments (message.elements/cl.Message.elements) disappear when resuming thread, even though they can be accessed correctly during live chat sessions. The attachment data are missing from messages after page refresh or thread resumption. message.elements became empty list but file is still showing on the frontend.

To Reproduce
Steps to reproduce the behavior:

  1. Start a new Chainlit chat session
  2. Upload a file attachment to a message
  3. Send the message (message.elements should now have the data)
  4. Refresh the page OR navigate to thread history and resume the thread
  5. message.elements is now an empty list in the backend code

Expected behavior
File attachment data should still be accessible when resuming thread. message.elements should contain the attachment data

Screenshots
N/A

Desktop (please complete the following information):

  • OS: Linux/Windows/macOS (affects all)
  • Browser: Chrome, Firefox, Safari (affects all)
  • Chainlit Version: 2.9.4+ (Probably older version too)

Additional context
Some what similar to #2584 and #2698. But I'm using the official data layer

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions