Repository navigation
Conversation
Desktop client for the accounts API on api.atomic.chat: sign in with an email one-time code or Google, see the profile and the devices signed in, sign a device out, and delete the account. - Rust owns the session (src-tauri/src/core/account): tokens never cross IPC, live in atomic-account.json (mode 0600, written via temp + rename), refresh is single-flight, invalid_grant ends the session, network errors keep it, and a 401 refreshes once and retries. - Google signs in through the system browser and a loopback redirect (127.0.0.1/auth/callback) on the MCP sign-in listener, which now takes the callback path as a parameter. - Each sign-in sends a stable installation_id that outlives sign-out, so signing in again replaces this install's previous session. - Factory reset signs out first and removes the session file. - UI: an account avatar above Help in the rail opens Settings -> Account (sign-in, profile, devices, delete with re-auth that checks the user id). - Gated by PlatformFeature.ACCOUNTS: desktop dev builds only for now. - ADR: docs/decisions/2026-11-10-sign-in-to-an-atomic-chat-account.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # docs/decisions/INDEX.md
The account no longer lives under Settings. The rail avatar opens /account/, a section of its own that is lit while it is open. It has no contextual sidebar for now, so the page takes the full width and the sidebar toggle is hidden there. Remote access and sync will add rows later. Settings drops its Account row, and the route moves from /settings/account to /account/. The account page reads like the other settings cards: - sign-in is laid out in rows, with Google's own branded button; - Google stays offered unless the backend says it is off; - the profile card no longer lists sign-in methods. The Devices card no longer jumps on load: - the loading state is one row shaped like a device row (this device is always listed), with the same line heights; - the last list is kept in the account store for the signed-in user, so a repeat visit shows it at once and refreshes it in place; - a layout test checks that the card keeps its height when the row loads. Also fixes a flaky device-order test whose fixtures tied on new Date(). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The full first-run flow gets an optional `account` step after Media and before Purpose, so it serves both everyday use and the server path. It is gated by the accounts flag; the experiment's model_only and none variants are unchanged. The step is built from the onboarding shell's own pieces and tokens, in light and dark: - three benefit cards: private chat sync, remote access, one sign-in everywhere; - Google and email-code sign-in in one row, with controls as tall as the step's buttons at any font size; - a reserved message line, so errors never move the page; - a signed-in card; - Skip or Continue, as on the Cloud and Media steps. The Google and email-code logic moves from AccountSignIn into a shared useAccountSignIn hook, so the settings card and the step behave the same. A sign-in on the step is reported as onboarding_account_signed_in with its method. Strings: onboarding-account in en, fr and ru, plus Russian for the whole account namespace. The session-lost toast no longer points at Settings -> Account. Recorded in docs/decisions/2026-11-11-give-the-account-its-own-section-and-an-onboarding-step.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Desktop client for the account backend's remote access API, in both roles.
Host ("Share this computer's models"): registers the device and the host,
long-polls host sync as a heartbeat with the tunnel and LAN state read from
the core. It honours a code pairing only when the device's proof matches the
code or the QR secret it showed, and a request only after "Allow" with
matching check codes. Each device gets its own key for the public API, sealed
with HPKE to the device's X25519 key (plus a MAC for code pairings), and a
sealed address list that is resealed with a higher sequence number whenever
the tunnel URL or LAN changes. Keys of grants that end leave the core at once.
Client ("Use models from your other computers"): long-polls its grants, opens
the key, refuses one whose code-pairing MAC does not match, acknowledges it,
follows newer address lists, and prefers a LAN address that answers. A ready
connection becomes a read-only "<computer> (remote)" provider.
- Rust `core/account/remote/`: protocol (checked against the backend's
reference vectors both ways), API client, 0600 `atomic-remote.json`,
host and client rounds, background loops, `account_remote_*` commands and
events. Sign-out, a lost session, deletion or a new sign-in wipe what was
shared and received.
- New crates: hpke 0.12, chacha20poly1305, hkdf.
- Device keys reach the core through `PUT /atomic/v1/server/client-keys`
(atomic-chat-core PR #98); sharing requires the server's own key and
generates one with consent.
- Web: Account sidebar is back (Overview, Remote models); the Remote models
page; request toasts on any page; managed providers kept in step; en/fr/ru.
- An opt-in live test runs two installs of one account against a real API.
Decision record: docs/decisions/2026-11-12-share-and-use-models-through-the-account.md
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Core v0.23.0 adds `PUT /atomic/v1/server/client-keys` (AtomicBot-ai/atomic-chat-core#98): the public listener accepts the keys a sharing computer hands its paired devices, next to its own API key. Without it, remote access through the account answers those devices with 401. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # package.json # web-app/package.json # yarn.lock
…uter The remote access host handed a key to any grant the account service reported as approved with a method other than code. A compromised or buggy backend could fabricate an approved request with its own public key and get a device key and the sealed addresses without anyone clicking Allow, and a key swapped after Allow was sealed to the new key although the check code covered the old one. - atomic-remote.json keeps `allowed` records: grant, device, public key. - Allow works only for a request shown from the last sync and writes the record before calling approve. - plan_host issues to an approved request only when a record matches grant, device and key; any other method is denied. - Records go once their key is out or their grant is no longer pending or approved; end_access and removing this host clear them. - A used pairing code is cleared only after its credential upload succeeded, so a failed upload can retry. - Sign-out already refreshes through authed(); a test now pins that. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… a newer address list
A remote provider created while its host served no models kept an empty
list: starting a model on the host changed neither the address nor the
key, so no connections event came and the provider stayed hidden from
the model picker. The refresh button on "Use models from your other
computers" only reloaded the list of computers, with no sign of progress.
- Refresh spins and is disabled while it runs; it reloads the computers
and re-lists every connected computer's models
(`syncAccountRemoteProviders(..., { refreshModels: true })`), keeping
the one-at-a-time queue.
- Provider connections carry the host's address list number
(`endpointsSeq`). A newer list is announced even at the same address,
and the provider sync lists that host's models again.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…line host connected
Stopping sharing on a host only paused it: grants stayed active, so the
devices kept saying "Connected", and a host that stopped kept showing as
connected on the device.
Host (this computer shares):
- Turning sharing off ends every device's access: keys leave the core
first, a waiting request is denied, and every other live grant of
this host is revoked (revoked_by_user). The host record stays, so no
new "new computer" email. The page asks first when devices have access.
- A device whose access ends from its side (Disconnect, sign-out, a
revoke elsewhere) raises "<device> disconnected" once
(account-remote-device-left). The host's own revoke or stop does not.
Client (this computer uses another's models):
- The grant read's host.online is kept per connection. An offline host,
or one that sent an empty address list (its server stopped), reads
"Offline" instead of "Connected", with one toast when it goes. The
provider stays and lists the host's models again when it is back.
- A host that ends this device's access is named in the toast
("<host> ended your access").
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Summary
Desktop client for the new accounts API on
api.atomic.chat(atomic-chat-backend PR #1, live since 2026-11-10). People can sign in with an email one-time code or with Google, see their profile and every device signed in, sign a device out, and delete the account.The whole feature is behind
PlatformFeature.ACCOUNTS, which is on in desktop dev builds only. Release builds show nothing new. Turning it on for release will be a separate commit, after a check in the real Tauri window and translations beyond en/fr.Decision record:
docs/decisions/2026-11-10-sign-in-to-an-atomic-chat-account.md.What's in it
Rust:
src-tauri/src/core/account/AccountStatusand token-free DTOs throughaccount_*commands, plus anaccount-changedevent.atomic-account.jsonin the data folder, mode 0600, written to a temp file and then renamed. This follows the ChatGPT and MCP token files.tokio::Mutex. The backend rotates refresh tokens and treats a replay as theft.invalid_grantends the session.401 invalid_tokentriggers one refresh and one retry.http://127.0.0.1:<port>/auth/callback.start_callback_servernow takes the callback path.atomic-chat://because only macOS registers that scheme.clientobject:desktop, the device name, the platform, the app version, and a randominstallation_id. The id outlives sign-out, so signing in again replaces this install's previous session.ATOMIC_ACCOUNT_API_URLpoints the app at a local backend. It accepts https, or http on loopback only.Web app
/account/), a rail section of its own that is lit while open.onboarding_account_signed_inwith itsmethod.useAccountSignIn.docs/decisions/2026-11-11-give-the-account-its-own-section-and-an-onboarding-step.md.accountandonboarding-accountnamespaces in en, fr and ru. Other locales fall back to en for now.Testing
cargo test --lib -- core::account core::mcp::oauth core::app::constantspasses (35 tests).invalid_grantvs. a transient failure, retry after a 401, error mapping, and Google PKCE / state / cancel through the real loopback listener.clippyis clean on the new files.account_*commands as desktop-only.make verify-fastpass on 9901ab2.Remote access through the account
Desktop client for the account backend's remote access API (atomic-chat-backend PR #2, live since 2026-11-11), in both roles, behind the same
PlatformFeature.ACCOUNTSflag. Decision record:docs/decisions/2026-11-12-share-and-use-models-through-the-account.md.Pins core v0.23.0 (AtomicBot-ai/atomic-chat-core#98, release):
PUT /atomic/v1/server/client-keyslets the public API accept the device keys next to the server's own key. Checked against the released binary: a device key is refused before the push, accepted after it, refused again once cleared; a stranger's key is refused, a bad body gets 400, and the key never shows in the server state.main(v2.4.5) is merged in, so the branch now carries main's core pin 0.23.4, which includes the route.Host — Account → Remote models → "Share this computer's models"
atomic-chat://remote/pair?c=…&k=…). The QR secret never reaches the backend. Devices asking with "Connect" show up with a check code and Allow/Deny; a toast with "Review" appears on any page.sk-atomic-…key, HPKE-sealed to its X25519 key (plus a MAC for code pairings). It also gets a sealed address list (tunnel URL, then LAN URLs), resealed with a higher sequence number when the tunnel URL or LAN changes. Revoke ends one device at once.Client — "Use models from your other computers"
Rust:
src-tauri/src/core/account/remote/protocol.rsimplements the README protocol. It is checked against vectors from the backend's referencetests/remote_protocol.py, and a one-off run had the Python reference open Rust-sealed values.atomic-remote.jsonis mode 0600 and bound to the signed-in user: device key, issued keys, received keys, the open code's secrets.hpke0.12,chacha20poly1305,hkdf.Security fix (ede2dc2, from the review of the same host ported to Atomic Server, AtomicBot-ai/atomic-server#97)
approvedwith a method other thancode. A compromised or buggy backend could fabricate an approved request with its own key and get a device key plus the sealed addresses without anyone clicking Allow; a key swapped after Allow was sealed to the new key.allowedrecord (grant, device, public key) toatomic-remote.json.plan_hostissues to an approved request only when a record matches all three; any other method is denied. Records go once the key is out or the grant ends;end_accessclears them.authed()before/v1/auth/logout; a test now pins it.Web
lib/account-remote-providers.ts).endpointsSeq) re-lists them too, even at the same address, so a provider created while its host had no models no longer stays empty.Testing (remote access)
clippyis clean.account::remote::live_testspassed against a local backend built from atomic-chat-backendmain. Two installs of one account went through QR pairing, key in the core, ack, address, revoke, request + Allow with matching check codes, and device sign-out.make verify-fastpasses.How to try it
https://api.atomic.chatby default.FORCE_ONBOARDING_VARIANT=full make dev-freshand go on past Media. Ctrl-C andFRESH_INSTALL=true FORCE_ONBOARDING=true FORCE_ONBOARDING_VARIANT=full yarn devreplays it.🤖 Generated with Claude Code