Skip to content

DB schema mismatch: autoCollapse column missing after 2.10.0 #2865

@LexLuengas

Description

@LexLuengas

Describe the bug
Since upgrading from 2.9.6 to 2.10.0, the autoCollapse parameter was added to the Step class (commit: #2818 ), but the corresponding database schema column was not documented in release notes or included in the SQLAlchemy Data Layer example. Existing deployments upgrading to 2.10.0 experience persistence failures when steps with auto_collapse=True are created, because the autoCollapse column does not exist in the database.

This causes a silent failure: steps fail to persist, and when threads are resumed, step data is missing (manifesting as disappearing assistant messages and other step data).

To Reproduce
Steps to reproduce the behavior:

  1. Have an existing Chainlit 2.9.6 deployment with a PostgreSQL database
  2. Upgrade to 2.10.0
  3. Create a new thread and send a message
  4. Wait for the LLM response to appear in a step
  5. Switch to a different thread
  6. Navigate back to the first thread
  7. See that the assistant message is no longer visible (only user messages are shown)

Expected behavior
Threads and their step data should be persisted to the database correctly.

Screenshots
N/A (data persistence issue, not UI)

Environment

  • OS: Linux
  • Chainlit version: 2.10.0 (regression from 2.9.6)
  • Database: PostgreSQL
  • Data Layer: SQLAlchemy-based custom implementation
  • Python version: 3.12

Additional context

  1. Documentation Gap: The 2.10.0 release notes did not include a "Breaking Changes" section (unlike 2.9.4 which explicitly documented the modes column migration). Users who rely on persistence cannot discover the required schema change.

  2. Missing from SQLAlchemy Example: The Chainlit documentation for the SQLAlchemy Data Layer (https://docs.chainlit.io/data-layers/sqlalchemy) does not include the autoCollapse column in the steps table schema definition.

  3. Workaround:

    ALTER TABLE steps ADD COLUMN IF NOT EXISTS "autoCollapse" BOOLEAN;
  4. Precedent: Version 2.9.4 correctly documented a breaking change for the modes column with the exact migration SQL required.

Suggested fix:

  • Document the required schema change in 2.10.0 release notes.
  • Update the SQLAlchemy Data Layer documentation with the up-to-date schema including autoCollapse

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions