Repository navigation
Sort chat recents by last activity - #6844
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
There was a problem hiding this comment.
Code Review
This pull request introduces an updatedAt field to chat threads to track and sort by the last activity time (e.g., when messages are added or synced). It includes backend database schema updates, a migration to backfill existing threads, API model adjustments, and frontend updates to sort threads by updatedAt and display a "No chats yet" message when the sidebar is empty. There are no review comments, so I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7194536cc6
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
Ran a focused check on this PR: https://github.com/Imagineer99/unsloth/actions/runs/28875558129 Looks good. Backend updated_at ordering tests passed, frontend sidebar sorting checks passed, and the screenshot artifact shows recents moving from createdAt order to last-activity order. |
Tested manually and working as expected, nice work @NilayYadav. |
|
pre-commit.ci is failing only on formatting. I reproduced it locally and the fix is just running the repo formatter on:
Can you apply that and push? Maintainer edits are disabled, so I can’t push the fix directly to your branch. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8f0dfb511e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| conn.execute("ALTER TABLE chat_threads ADD COLUMN updated_at INTEGER") | ||
| # Floor at created_at: forked threads copy older ancestor messages, | ||
| # so the fork's creation time must win over the branch message times. | ||
| conn.execute( |
There was a problem hiding this comment.
Commit the updated_at backfill during migration
When the first request after upgrade is read-only (for example GET /api/chat/threads), this UPDATE starts a sqlite transaction inside _ensure_schema, but _ensure_schema never commits it; the caller then closes the connection after reading, rolling the backfill back while _schema_ready is already true. The column remains added but existing rows keep updated_at = NULL, so old chats continue sorting by created_at until they are written again. Commit the schema/backfill work before marking the schema ready or otherwise ensure this DML is committed even on read paths.
Useful? React with 👍 / 👎.


Adds an
updatedAtfield to chat threads that gets bumped whenever a message is written. The Recents sidebar now sorts by last activity instead of creation time, so continuing an old chat bubbles it to the top.updated_atcolumn with migration backfill from existing messagesupdatedAt ?? createdAt; compare pairs take the newest activity across both panes