Repository navigation
Make shared composer drafts opt-in - #16548
Merged
danielhanchen merged 24 commits intoNov 9, 2026
Merged
Conversation
Imagineer99
marked this pull request as ready for review
November 4, 2026 13:07
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
…g it A per-chat copy left behind after adoption came back once sharing was turned off, restoring a prompt already sent from the shared slot. [skip ci]
The draft key changes before the runtime swaps threads, so the save and navigation flush paired the previous chat's text with the new key: a saved chat's draft was copied into New chat, and returning to a chat from a New chat erased its draft. Skip saving while the composer still shows the text from before the restore. [skip ci]
danielhanchen
pushed a commit
to danielhanchen/unsloth-staging-2
that referenced
this pull request
Nov 7, 2026
danielhanchen
pushed a commit
to danielhanchen/unsloth-staging-2
that referenced
this pull request
Nov 7, 2026
danielhanchen
pushed a commit
to danielhanchen/unsloth-staging-2
that referenced
this pull request
Nov 7, 2026
This was referenced Nov 7, 2026
Resolve composer-settings against unslothai#16888, which moved Plain text, Rich text paste and Context window usage to Display; Share drafts across chats stays in Chat defaults, and the pinned Chat defaults row list includes it.
danielhanchen
pushed a commit
to danielhanchen/unsloth-staging-2
that referenced
this pull request
Nov 8, 2026
New chat ids and fresh Compare pair ids are minted per navigation, so a per-id draft slot was never read or removed once the user left it, and large pastes could fill localStorage. Every unsent New chat now drafts in the pre-sharing chat-draft:__new__ slot, and a Compare pair with no stored threads drafts in one new-pair slot until its first send. [skip ci]
Opening Settings hides the chat view, so the composer that held the draft was not mounted when the preference flipped and Compare never adopted its draft. Adopt in the preference setter from the per-chat slot this tab last typed into, prefer this tab's cached copy over another window's later write, and keep text typed in Compare while its history loads when the pair moves to the new-pair slot. [skip ci]
Same behaviour (the reset only fires on a pair change, which never takes the early return), but keeps the gate and the listed-pair assignment together as project-chat-run-keepalive pins them. [skip ci]
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
danielhanchen
pushed a commit
to danielhanchen/unsloth-staging-2
that referenced
this pull request
Nov 9, 2026
danielhanchen
added a commit
that referenced
this pull request
Nov 10, 2026
…ount (#17399) ## Summary `(Python 3.13, a-f)` is red on `main`: ``` studio/backend/tests/test_device_sync_settings.py::test_every_synced_store_field_is_saved E AssertionError: ('ChatPrefsPayload', {'shareComposerDraft'}) ``` This is a merge race between two correct PRs. #16548 (merged yesterday) added the opt-in `shareComposerDraft` preference to the chat preferences store. #17240 (merged today) added a guard that every synced chat preferences field is accepted by the server: the sync hook sends the whole store, and `ChatPrefsPayload` ignores unknown keys, so a field the model does not list is silently dropped and never follows the account. `shareComposerDraft` is not in `LOCAL_CHAT_PREFS` (which is only for browser-bound state such as notification permission and panel layout), so it is meant to sync like the other composer preferences, and today it does not. ## Changes - `studio/backend/routes/settings.py`: `ChatPrefsPayload` accepts `shareComposerDraft: Optional[bool]`, next to the other composer preferences. The setting now follows the account like `plainTextComposer` does; nothing else changes and older clients that do not send it are unaffected. ## Testing - `studio/backend/tests/test_device_sync_settings.py`: 19 passed; on `main` the guard fails as above (1 failed, 18 passed).
danielhanchen
added a commit
to debojyoti-dev/unsloth
that referenced
this pull request
Nov 13, 2026
…dd strings for the newer locales Main made shared composer drafts opt-in (unslothai#16548), so the handoff now writes the New chat slot the composer restores from and resets the runtime like New chat. The history is also capped by total characters so a full localStorage cannot throw out of addEntry after a translation succeeded. The 11 locales added since the PR opened get the Translate strings, so i18n:check:strict passes again. The bundle budget raise is dropped: main's budget has room. [skip ci]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Typing an unfinished prompt in one chat currently carries it into other chats and New chat. Keep drafts separate by default, and expose the existing shared-draft behavior under Settings → Chat → Chat defaults → Share drafts across chats (off by default).
This follows up on the intentional behavior change in #13722 and preserves #15782's cross-window isolation. Opting in shares a draft across chats and Compare within the same tab; it does not restore live synchronization between windows. Opening as a draft for agreement on the default behavior.
Validation:
npm run typecheckandnpm run i18n:check:strictpass.The native Unsloth Desktop shell and model-backed sends were not exercised.
Before / after: composer drafts
Two isolated Studio installs, no model loaded. Two saved chats are seeded; the draft "unfinished question typed in chat A" is typed in chat A, then the sidebar opens chat B, then New chat. Draft pairs: merge base
6c486bd0cvs heada55e89f10.Chat B after leaving chat A: before, chat A's draft follows into chat B; after, chat B starts empty.

New chat after leaving chat A: before, the draft follows into New chat; after, New chat starts empty. Returning to chat A afterwards shows its own draft again. Unsent New chat text is kept in one New chat slot, so stored drafts are only

chat-draft:__new__and one per saved chat.Settings > Chat > Chat defaults gains "Share drafts across chats", off by default (merge base

6c486bd0cvs headfe81dbae8, current main layout). With it switched on, the same chat A, New chat, chat B, chat A sequence shows the same composer text at every step on both builds.