Skip to content

fix(data): apply negative feedback filters in SQLAlchemy - #3069

Open
imharjot wants to merge 2 commits into
Chainlit:mainfrom
imharjot:fix/sqlalchemy-zero-feedback
Open

imharjot wants to merge 2 commits into
Chainlit:mainfrom
imharjot:fix/sqlalchemy-zero-feedback

Conversation

@imharjot

@imharjot imharjot commented Oct 4, 2026 •

Copy link
Copy Markdown

SQLAlchemyDataLayer.list_threads treats feedback=0 as though no feedback filter was supplied. Asking for conversations with thumbs-down feedback therefore returns positively rated and unrated conversations too.

Fixes #3068

Use an explicit None check so zero reaches the existing feedback filter. The seven SQLite regressions check negative, positive and unfiltered results, owner isolation, case-insensitive search and cursor pagination. The fixture retains the original required disableFeedback column and seeds compliant step rows explicitly, while users, feedback writes and thread reads use the real data-layer APIs. It also includes the props column needed by thread reads.

Validation on Python 3.13.16 and Node 24.11.1:

  • uv sync --all-packages --all-extras --dev completed, including the frontend build.
  • python -m pytest --cov=chainlit using the existing Python 3.13 environment: 939 passed after the review update. With the final fixture and the original feedback filter, the three negative-feedback cases fail and four controls pass.
  • From frontend/, pnpm test: 32 frontend tests passed.
  • Python lint, formatting and type checks passed; mypy checked all 109 source files.
  • pnpm lint, pnpm format-check and pnpm type-check passed. The repository's copilot type-check command explicitly reports that it is skipped.
  • pnpm check-overrides passed.
  • A local echo app using real SQLite passed login, four WebSocket conversations, HTTP feedback writes and filtered thread-list requests, including search and pagination.
  • The two active persistence Cypress cases in cypress/e2e/data_layer/spec.cy.ts passed, with two cases already marked pending in the repository. The first run hit a local server startup race on port 8000. The successful retry used a temporary configuration that waits for the initial server to listen and for cleanup to finish before starting the fixture; the tracked harness and test cases were unchanged.

Local validation covers Python 3.13 and the persistence browser spec; the broader Python and browser matrices remain for CI.


Summary by cubic

Fixes SQLAlchemyDataLayer.list_threads treating a feedback=0 filter as missing, so requesting thumbs-down conversations returned unrated and positively rated ones too.

  • Checks filters.feedback is not None so a zero value reaches the existing feedback filter.
  • Adds SQLite regression coverage for negative, positive, and unfiltered results, owner isolation, case-insensitive search, and cursor pagination.

Written for commit 272129a. Summary will update on new commits.

Review in cubic

Keep feedback=0 distinct from an omitted filter when listing threads.
Add SQLite coverage for both feedback values, unfiltered results, owner
isolation, search and cursor pagination using persisted steps and feedback.

Co-Authored-By: Codex <noreply@openai.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 2 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread backend/tests/data/test_sql_alchemy.py Outdated
Restore the original required disableFeedback column and explicitly seed
its value in the feedback fixture. Keep feedback writes and thread reads
on the real data-layer path.

Co-Authored-By: Codex <noreply@openai.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SQLAlchemy thread listing ignores thumbs-down feedback filters

1 participant