Repository navigation
Prevent Desktop owner lockout before adding accounts - #13961
Conversation
A desktop owner is seeded with a bootstrap password it never sees, and nothing asks for a real one before the first managed account is created. Once that account exists and the webview holds no session, desktop-login answered login_required and the owner faced a form no credential could complete. Keep minting owner tokens in multi mode until the owner has set a password; the refusal still applies after that.
Desktop tokens used to mean a one-account install, so the webview set the login mode to single without asking. Now the owner also receives tokens on a multi-account install while the bootstrap password stands, and that hardcoded mode showed the single-account remote password copy there. Fetch the status instead; it still clears a stale multi hint once the last managed account is gone.
|
@codex review |
Codex Review SummaryThis 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e4f42082c7
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…owner tokens The secret answers for the shell, not for whoever signed in to the document. With owner tokens now minted on a multi-account install while the bootstrap password stands, the token path would have replaced a managed account's live desktop session with the owner's on the next launch. Refresh and keep a managed session that is still valid, as the login_required path already does, and fall back to the owner tokens only when it no longer refreshes.
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. 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". |
|
@codex security review |
1 similar comment
|
@codex security review |
…13983) ## Summary `Frontend build + bundle sanity` fails on PRs based on current main (for example #13961 and #13963) with `over the startup budget`. Main itself is over: | commit | raw | transfer | |---|---|---| | 5870795 | 6,791,021 B (within) | 2,042,102 B (within) | | 4a8b727 (main) | 6,791,768 B (587 B over) | 2,042,404 B (113 B over) | All numbers are from one machine and build, Node 24, with the chunk count unchanged at 95. Measured commit by commit, no single import did it: - Deep research under Tools in the + menu (#13959) took main over, at +0.2 KB raw. - The connection name and provider menu order (#13964) and the attachment card polish (#13970) add the rest, 0.1 and 0.4 KB raw. All of it lands in the eager chat and settings chunks. ## Change Following the file's own rule ("raise BUDGET in this file ... with the measured numbers"), the budget is raised by that growth, 747 B raw and 302 B transfer, so main keeps the margin it had at 5870795. The measurement is recorded next to the limits like the previous raises. ## Testing - `npm run build && npm run bundle:check` on main with this change: within budget (0.2 KB transfer, 0.2 KB raw to spare). Without it: over by the amounts above. - `tests/bundle-budget-cli.test.ts` and `tests/bundle-budget-closure.test.ts`: 43 passed. - `prettier --check scripts/check-bundle-budget.ts`: clean.
…ts, and let the owner sign in with a chosen name (unslothai#15619) Settings > Accounts showed the owner as "unsloth" with a letter avatar, even when the owner had set a profile name and picture. The owner also always had to sign in as `unsloth` (and `reset-password --username <profile name>` said "account not found"), and Unsloth Desktop had no Log out at all. - **Accounts:** each row shows the profile name and avatar, plus the name it signs in with. The owner's row has a "..." menu with Change password; so does the Profile page. - **Owner sign-in name:** set in Settings > Accounts, checked like a managed username and can't clash with one. Login and `reset-password --username` accept it; `unsloth` keeps working and stays the internal identity. New nullable `auth_user.login_alias` column. - **Log out on Desktop:** shown in the user menu and the shortcut. It writes a marker next to the desktop secret so the shell can't sign the owner straight back in, even after a quick quit. Single account: the login page offers "Continue as owner". Multi account: username and password. Password changes only happen in Settings while signed in; nothing new on the login screen. **Tested** on Unsloth Desktop built from this branch (Change password, sign-in name and multi-account shots taken at `3feaf61`), Windows 11 (AMD R9700), isolated install. Log out, quit 2 s later and relaunch stays signed out; Continue as owner survives a relaunch; signing in with the sign-in name works in Desktop, in Edge, and in `reset-password`. Backend, Rust (`desktop_auth`) and frontend suites pass on a MacBook Pro M5. Not tested by hand: Linux and macOS Desktop. | Before (main) | After | |---|---| | <img src="https://raw.githubusercontent.com/LeoBorcherding/unsloth/b8df1b1b56856ead2773361394c504a8eda3215f/01-before-main-accounts.png" width="420"> | <img src="https://raw.githubusercontent.com/LeoBorcherding/unsloth/b8df1b1b56856ead2773361394c504a8eda3215f/02-accounts-owner-profile.png" width="420"> | | Log out in the Desktop user menu<br><img src="https://raw.githubusercontent.com/LeoBorcherding/unsloth/b8df1b1b56856ead2773361394c504a8eda3215f/03-desktop-log-out.png" width="420"> | Signed out, single account<br><img src="https://raw.githubusercontent.com/LeoBorcherding/unsloth/b8df1b1b56856ead2773361394c504a8eda3215f/04-desktop-signed-out.png" width="420"> | | Change password, from the owner's "..." menu<br><img src="https://raw.githubusercontent.com/LeoBorcherding/unsloth/b8df1b1b56856ead2773361394c504a8eda3215f/05-change-password.png" width="420"> | Signed out, multi account (owner can use the sign-in name)<br><img src="https://raw.githubusercontent.com/LeoBorcherding/unsloth/b8df1b1b56856ead2773361394c504a8eda3215f/06-desktop-signed-out-multi.png" width="420"> | Related: unslothai#13961 (independent). ### Before / after: Settings > Accounts Same owner profile (display name "Riley Owner" and avatar) and one managed account on both sides; merge base `a20b732e0` vs head `46cb010ed`. The owner row now shows the profile name and avatar, every row shows the name it signs in with, the owner gets a "..." menu with Change password, and the owner sign-in name field appears. <img src="https://raw.githubusercontent.com/danielhanchen/unsloth-staging-2/pr-media/pr/15619/pr15619_before_after-a38549a59158.png" width="900"> --------- Co-authored-by: Daniel Han <[email protected]>
|
Review record for #13961, carried over from the mirror it was reviewed on: danielhanchen/unsloth-staging-review#701. Findings are quoted as posted and attributed to the account that posted them. The reactions shown are the triage recorded on the mirror; none were re-applied here. Commits are named as the mirror's, with this PR's equivalent where one was found. Round 1: reviewed mirror
|
Desktop can create a managed account while its owner still has a generated password that the app never shows. This switches the installation to multi-account sign-in and can lock the owner out after the current session expires.
Creating an account now opens the existing password dialog when the owner password is still generated, then continues to the existing account-creation form. Cancelling creates no account. The server checks the same prerequisite inside the existing account-creation transaction, so older frontends cannot create the lockout state. Owners who already chose a password continue directly to account creation.
Shared installations retain strict multi-account Desktop login. The Desktop secret does not bypass it. Existing locked-out installations retain the
unsloth studio reset-passwordrecovery command. The change introduces no native protocol, installer, updater, persistent schema, notebook, GPU-detection or inference changes.Validation:
2099086d8and passes on reviewed headb06e347b2: account creation changes from 201 with a generated password to 400 with unchanged account records. After password setup, creation returns 201 and the chosen owner password signs in successfully. Desktop-secret exchange still requires login in multi-account mode.1250a66ef; runs 41454175696, 41454175721 and 41454175728.The complete local frontend suite reports 14,670 passed, one skipped and one pre-existing font-spacing failure, reproduced on the original merge base with the affected component and test unchanged. Broader inherited CI also exposes an unrelated composer font-scale contract and companion Zoo CPU-MLX cache-shim failures; their baseline reproductions are recorded. The source organization queue cancelled its remaining jobs, so those jobs are not counted as passes; current scoped staging is green.
Native Linux checks have passed all routes and Settings in one corrected-head run. Complete current native validation remains unproven: a bounded replacement run receives RemoteDisconnected on both base and head at different WebDriver steps, and the unchanged red report is retained. No product change was made for that transport fault. Native macOS/Windows GUI, WSL and previous-release updater execution are not claimed. The browser onboarding evidence uses real frontends and backends with an adapter for native IPC.
Before and after: adding an account from Desktop
Base
2099086d8opens account creation immediately while the owner password is still generated. Reviewed headb06e347b2opens Set password first and then continues account creation. Source head3cb8ac3a9adds only an empty CI-release commit. Both sides keep strict multi-account Desktop login.