Repository navigation
Sign in to Claude from the app - #13
Merged
Merged
Conversation
The app checks the latest published GitHub release (latest.json) when it opens and every six hours. A newer version shows "Update available" in the title bar; one click downloads it with progress, runs the installer passively and reopens Botloft, and the reopened app updates the daemon because it is now outdated. Failures keep the current version, with the error under "Details". Dev builds never offer to replace themselves. Updates are signed with the Tauri updater key (public key in tauri.conf.json, private key in the TAURI_SIGNING_PRIVATE_KEY secret), and requireSignedVersion keeps a tampered feed from pushing an older signed release back. Pushing a tag vX.Y.Z runs release.yml: it checks the tag against the workspace version, builds the signed installer and opens a draft release with the installer, its signature and latest.json. The updater sees it once the owner publishes it. The version now lives only in Cargo.toml.
… for the app The daemon runs `claude auth status` (documented: JSON with loggedIn, exit 0 when signed in, 1 when not; checked with 2.1.284) once Claude Code is found, every 30 s while signed out, at once when a bot hits a sign-in error, and when the app calls the new `system.refresh`. `system.status` reports `claudeSignedIn` and `claudePath`. When the answer turns from signed out to signed in, the bots a sign-in error stopped start again by themselves. An account problem with a valid sign-in (billing, a blocked organization) does not change the answer, so it cannot loop. So the app can speak the owner's language, notices carry a code (signed_out, usage_limit, turn_failed) next to the English text, and the conversation-list line carries its kind with no wording of its own: the app adds "You:" and "Waiting for approval".
Both pick a free port; run in parallel, one could take the port the other had just freed and read it as taken.
"Sign in to Claude" opens Claude Code's own sign-in (`claude auth login`) in a window of its own, launched by the app so it comes to the front, then asks the daemon to check again and watches for the result. It shows on the welcome screen as a "Claude account" check, as a banner when signed out, and on a bot stopped by a sign-in error. The Tauri command only runs an absolute path to an existing claude.exe, and strips the Claude Code session variables an app started from a session would pass on.
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.
Adds a "Sign in to Claude" button, so a first-time user never has to open a terminal to sign in. Stacked on #12: the first commit here is #12's until it merges.
Service
claude auth status. The docs say it prints JSON withloggedInand exits 0 when signed in, 1 when not; I confirmed both with 2.1.284, using an emptyCLAUDE_CONFIG_DIRfor the signed-out case. It checks when Claude Code is found, every 30 s while signed out, right away when a bot hits a sign-in error, and when the app calls the newsystem.refresh.system.statusnow includesclaudeSignedInandclaudePath.code(signed_out,usage_limit,turn_failed) alongside the English text. The sidebar preview carries akindand no wording of its own; the app adds "You:" and "Waiting for approval".App
claude auth loginin its own window. The app launches it, not the service, so the window comes to the front. Once it finishes, the app callssystem.refreshand re-reads the status every second for up to 20 s.claude.exe. It stripsCLAUDECODEandCLAUDE_CODE_*from the environment, because an app started from inside a Claude Code session would otherwise pass them on.Tested
system.refresh, and no loop on account errors. Full workspace tests and clippy pass.Manual test
On a machine signed out of Claude Code (
claude auth logout): open Botloft and click "Sign in to Claude". A window opens and the browser asks you to sign in. When you finish, the window closes, the welcome screen shows "Signed in." within a few seconds, and any bot that was waiting starts. I didn't run the realclaude auth login, because it would have opened a sign-in page in your browser and I wasn't going to log you out; the app only relies on its exit code.