Skip to content

Studio: Preserve chat history during autosave - #5278

Merged
danielhanchen merged 6 commits into
unslothai:mainfrom
Imagineer99:fix/chat-recents-reopen-after-new-chat
May 5, 2026
Merged

danielhanchen merged 6 commits into
unslothai:mainfrom
Imagineer99:fix/chat-recents-reopen-after-new-chat

Conversation

@Imagineer99

@Imagineer99 Imagineer99 commented May 5, 2026 •

Copy link
Copy Markdown
Member

Summary

Follow-up to #5256.

Autosave and explicit message deletion shared the same sync path, so autosave could treat an in-progress assistant-ui snapshot as authoritative. This keeps autosave non-destructive and limits message pruning to explicit delete flows.

  • Prevent autosave from pruning persisted chat messages during run lifecycle snapshots
  • Keep destructive pruning scoped to explicit message deletion
  • Preserve chat history when reopening threads from Recents after starting a New Chat

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request modifies the syncExportedRepositoryToDexie function to accept an optional pruneMissing flag, ensuring that message pruning in the local database only occurs during explicit deletion flows. The deleteThreadMessage utility has been updated to pass this flag. A review comment suggests an optimization to use .primaryKeys() instead of .toArray() when identifying messages for deletion to reduce memory overhead, especially for threads with many messages.

@danielhanchen
danielhanchen merged commit 19f3052 into unslothai:main May 5, 2026
1 check passed
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.

2 participants