From 5ae7ca11c9ea8e3d86dca7b5d382630b7ba850cf Mon Sep 17 00:00:00 2001 From: Ahmi <6326713+AhmiDarrow@users.noreply.github.com> Date: Sun, 15 Nov 2026 23:33:52 -0600 Subject: [PATCH 1/2] Fix: Switch to Web UI signs the browser in and no longer fakes a first run The desktop sidecar keeps browser token bootstrap off by default, so the WebUI opened from the desktop had no token, settings failed with 401, and the SPA treated that as first run and opened the setup wizard. Switch to Web UI now mints a one-time bootstrap link (authenticated with the desktop's own token) and opens that URL. A live one-time link now opens the default-off sidecar; an explicit REMEDY_HTTP_BOOTSTRAP=0 still wins. A failed settings load shows a connection message instead of the setup wizard. Risk: WebUI auth and the shell/browser handoff. Smoke: Switch to Web UI on a real desktop instance. Co-Authored-By: Claude Sonnet 5.5 --- desktop/src-tauri/src/lib.rs | 39 +++++++++++++++++++ desktop/src/hooks/useAppBootstrap.ts | 8 ++-- native/go/httpapi/bootstrap.go | 25 +++++++++++- native/go/httpapi/bootstrap_same_user_test.go | 27 +++++++++++++ 4 files changed, 95 insertions(+), 4 deletions(-) diff --git a/desktop/src-tauri/src/lib.rs b/desktop/src-tauri/src/lib.rs index 36b2d129..972b057c 100644 --- a/desktop/src-tauri/src/lib.rs +++ b/desktop/src-tauri/src/lib.rs @@ -2825,6 +2825,35 @@ fn start_dragging_main_window(app: AppHandle) -> Result<(), String> { Ok(()) } +/// POST /api/auth/bootstrap-link with the desktop's own token; returns the URL. +fn mint_web_ui_link() -> Result { + use std::io::{Read, Write}; + let token = get_local_api_token()?; + let mut s = TcpStream::connect_timeout(&status_addr(), Duration::from_secs(2)) + .map_err(|e| format!("connect: {e}"))?; + let _ = s.set_read_timeout(Some(Duration::from_secs(3))); + let req = format!( + "POST /api/auth/bootstrap-link HTTP/1.1\r\nHost: 127.0.0.1:{}\r\n\ + Authorization: Bearer {}\r\nContent-Length: 0\r\nConnection: close\r\n\r\n", + api_port(), + token + ); + s.write_all(req.as_bytes()).map_err(|e| format!("write: {e}"))?; + let mut buf = String::new(); + let _ = s.read_to_string(&mut buf); + if !(buf.starts_with("HTTP/1.1 200") || buf.starts_with("HTTP/1.0 200")) { + return Err(format!("unexpected response: {}", buf.lines().next().unwrap_or(""))); + } + let body = buf.split("\r\n\r\n").nth(1).unwrap_or(""); + let v: serde_json::Value = + serde_json::from_str(body.trim()).map_err(|e| format!("json: {e}"))?; + v.get("url") + .and_then(|u| u.as_str()) + .filter(|u| u.starts_with("http://127.0.0.1:")) + .map(str::to_string) + .ok_or_else(|| "no url in response".to_string()) +} + /// Hide desktop window to tray and open the browser WebUI (same chat app via local API). #[tauri::command] fn switch_to_web_ui(app: AppHandle) -> Result { @@ -2843,6 +2872,16 @@ fn switch_to_web_ui(app: AppHandle) -> Result { thread::sleep(Duration::from_millis(200)); } + // The browser has no IPC token. Mint a one-time sign-in link (authenticated + // with the desktop's own token) so it does not land on a bogus first run. + let url = match mint_web_ui_link() { + Ok(link) => link, + Err(e) => { + log::warn!("switch_to_web_ui: one-time link not minted: {e}"); + url + } + }; + // Same stay-ready path as title-bar Close (WSLg minimizes; others hide). if let Some(w) = primary_window(&app) { stay_ready_after_close(&w)?; diff --git a/desktop/src/hooks/useAppBootstrap.ts b/desktop/src/hooks/useAppBootstrap.ts index ed36a0a7..1d675643 100644 --- a/desktop/src/hooks/useAppBootstrap.ts +++ b/desktop/src/hooks/useAppBootstrap.ts @@ -106,10 +106,12 @@ export function useAppBootstrap(opts: { if (cancelled) return if (!settings) { - setShowSetupWizard(true) + // A failed settings load (auth, restarting server) is NOT first run: + // never open the setup wizard here or an existing install looks reset. setServerError( - 'Could not load settings yet — complete setup once the local server is ready. ' - + 'If save fails, use Retry then Open setup.', + 'Could not reach your Remedy settings (the local server is not ' + + 'responding or this browser is not signed in to it). Your setup ' + + 'is untouched. Use Retry, or reopen the Web UI from the desktop app.', ) return } diff --git a/native/go/httpapi/bootstrap.go b/native/go/httpapi/bootstrap.go index 2b8564f5..1095abdc 100644 --- a/native/go/httpapi/bootstrap.go +++ b/native/go/httpapi/bootstrap.go @@ -56,6 +56,22 @@ func (b *bootstrapLinks) mint(now time.Time) string { return nonce } +// peek reports whether nonce is a live link without burning it. +func (b *bootstrapLinks) peek(nonce string, now time.Time) bool { + nonce = strings.TrimSpace(nonce) + if len(nonce) < 32 { + return false + } + b.mu.Lock() + defer b.mu.Unlock() + for n, exp := range b.nonces { + if subtle.ConstantTimeCompare([]byte(n), []byte(nonce)) == 1 { + return now.Before(exp) + } + } + return false +} + // consume reports whether nonce is a live link, and burns it either way. func (b *bootstrapLinks) consume(nonce string, now time.Time) bool { nonce = strings.TrimSpace(nonce) @@ -126,7 +142,14 @@ func (s *Server) handleLocalBootstrap(w http.ResponseWriter, r *http.Request) { }) return } - if !HTTPBootstrapEnabled(s.homeDir) { + // A live one-time link is explicit owner consent (only a caller that + // already holds the token can mint one), so it opens the default-off + // desktop sidecar too. An explicit REMEDY_HTTP_BOOTSTRAP=0 still wins. + linkOK := s.bootLinks.peek(r.URL.Query().Get("nonce"), time.Now()) + if env, forced := envTruthy("REMEDY_HTTP_BOOTSTRAP"); forced && !env { + linkOK = false + } + if !HTTPBootstrapEnabled(s.homeDir) && !linkOK { writeJSON(w, http.StatusForbidden, map[string]any{ "error": "http_bootstrap_disabled", "detail": "Browser token bootstrap is off. Desktop still uses IPC " + diff --git a/native/go/httpapi/bootstrap_same_user_test.go b/native/go/httpapi/bootstrap_same_user_test.go index ac3dc2d9..fe5ce3f5 100644 --- a/native/go/httpapi/bootstrap_same_user_test.go +++ b/native/go/httpapi/bootstrap_same_user_test.go @@ -5,6 +5,7 @@ import ( "io" "net/http" "net/url" + "os" "runtime" "strings" "testing" @@ -125,6 +126,32 @@ func TestBootstrapLinkIsSingleUseWhenPeerUnknown(t *testing.T) { } } +func TestBootstrapLinkOpensDefaultOffSidecar(t *testing.T) { + t.Setenv("REMEDY_DESKTOP_SIDECAR", "1") // http_bootstrap defaults off + base := startBootstrapServer(t) + os.Unsetenv("REMEDY_HTTP_BOOTSTRAP") // helper forces it on; restored by t.Setenv cleanup + stubPeer(t, false, errPeerUnsupported) + if code, body, _ := bootstrapGet(t, base, ""); code != http.StatusForbidden || body["error"] != "http_bootstrap_disabled" { + t.Fatalf("no link on default-off sidecar: %d %v", code, body) + } + if code, _, _ := bootstrapGet(t, base, strings.Repeat("A", 43)); code != http.StatusForbidden { + t.Fatalf("guessed link accepted: %d", code) + } + nonce := mintLink(t, base) + if code, body, text := bootstrapGet(t, base, nonce); code != http.StatusOK || body["token"] != sameUserTestToken { + t.Fatalf("valid link on default-off sidecar: %d %s", code, text) + } +} + +func TestBootstrapLinkRespectsExplicitLockdown(t *testing.T) { + base := startBootstrapServer(t) + nonce := mintLink(t, base) + t.Setenv("REMEDY_HTTP_BOOTSTRAP", "0") + if code, body, _ := bootstrapGet(t, base, nonce); code != http.StatusForbidden || body["error"] != "http_bootstrap_disabled" { + t.Fatalf("lockdown must beat a link: %d %v", code, body) + } +} + func TestBootstrapLinkNeedsTokenToMint(t *testing.T) { base := startBootstrapServer(t) req, _ := http.NewRequest(http.MethodPost, base+"/api/auth/bootstrap-link", nil) From bfa9206bddaa165bd37938c2ede9a7d6ebfbc144 Mon Sep 17 00:00:00 2001 From: Ahmi <6326713+AhmiDarrow@users.noreply.github.com> Date: Mon, 16 Nov 2026 00:12:42 -0600 Subject: [PATCH 2/2] Cut Remedy Desktop 0.70.2 Bump every version surface to 0.70.2. Changelog: Switch to Web UI now signs the browser in with a one-time link, and a failed settings load no longer shows the first-run wizard. Co-Authored-By: Claude Sonnet 5.5 --- CHANGELOG.md | 6 ++++++ android/app/build.gradle.kts | 4 ++-- desktop/package-lock.json | 4 ++-- desktop/package.json | 2 +- desktop/src-tauri/Cargo.lock | 2 +- desktop/src-tauri/Cargo.toml | 2 +- desktop/src-tauri/tauri.conf.json | 2 +- desktop/src/help/articles/13-whats-new.md | 10 +++++++++- docs/manual/13-whats-new.md | 10 +++++++++- native/go/httpapi/api.go | 2 +- pyproject.toml | 2 +- scripts/latest.json | 14 +++++++------- uv.lock | 7 +++++-- 13 files changed, 46 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4bffa36b..ee0fbcfb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to Remedy (`remedy-ai`) are documented here. ## [Unreleased] +## [0.70.2] - 2026-11-15 + +### Fixed +- Switch to Web UI now signs the browser in. The desktop mints a one-time sign-in link and opens it, so the browser app no longer loses its connection and shows the first-run wizard. A one-time link now works even while browser token bootstrap is off (the desktop default); an explicit `REMEDY_HTTP_BOOTSTRAP=0` still blocks it. (#65) +- A settings load that fails (server restarting, browser not signed in) shows a connection message instead of the first-run setup wizard, so an existing install never looks reset. (#65) + ## [0.70.1] - 2026-11-15 ### Added diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index 7a3a3a3e..8294c13f 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -12,8 +12,8 @@ android { applicationId = "com.remedy.groveconnect" minSdk = 26 targetSdk = 35 - versionCode = 50 - versionName = "0.70.1" + versionCode = 51 + versionName = "0.70.2" } buildTypes { diff --git a/desktop/package-lock.json b/desktop/package-lock.json index d25e56ee..b9e35529 100644 --- a/desktop/package-lock.json +++ b/desktop/package-lock.json @@ -1,12 +1,12 @@ { "name": "desktop", - "version": "0.70.1", + "version": "0.70.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "desktop", - "version": "0.70.1", + "version": "0.70.2", "dependencies": { "@codemirror/lang-markdown": "^6.5.1", "@codemirror/state": "^6.7.1", diff --git a/desktop/package.json b/desktop/package.json index 2d8e30f9..6dae960a 100644 --- a/desktop/package.json +++ b/desktop/package.json @@ -1,7 +1,7 @@ { "name": "desktop", "private": true, - "version": "0.70.1", + "version": "0.70.2", "type": "module", "scripts": { "dev": "vite", diff --git a/desktop/src-tauri/Cargo.lock b/desktop/src-tauri/Cargo.lock index 7680b77d..38ee61f4 100644 --- a/desktop/src-tauri/Cargo.lock +++ b/desktop/src-tauri/Cargo.lock @@ -101,7 +101,7 @@ checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470" [[package]] name = "app" -version = "0.70.1" +version = "0.70.2" dependencies = [ "adblock", "base64 0.22.1", diff --git a/desktop/src-tauri/Cargo.toml b/desktop/src-tauri/Cargo.toml index 3e9dc281..d19d28b1 100644 --- a/desktop/src-tauri/Cargo.toml +++ b/desktop/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "app" -version = "0.70.1" +version = "0.70.2" description = "Remedy Desktop — local AI partner for knowledge, design, and code" authors = ["Ahmi "] license = "Apache-2.0" diff --git a/desktop/src-tauri/tauri.conf.json b/desktop/src-tauri/tauri.conf.json index 265aee2a..9998e6b8 100644 --- a/desktop/src-tauri/tauri.conf.json +++ b/desktop/src-tauri/tauri.conf.json @@ -2,7 +2,7 @@ "$schema": "../node_modules/@tauri-apps/cli/config.schema.json", "productName": "Remedy Desktop", "mainBinaryName": "Remedy Desktop", - "version": "0.70.1", + "version": "0.70.2", "identifier": "com.remedy.desktop", "build": { "frontendDist": "../dist", diff --git a/desktop/src/help/articles/13-whats-new.md b/desktop/src/help/articles/13-whats-new.md index f2b4275d..262b0b6a 100644 --- a/desktop/src/help/articles/13-whats-new.md +++ b/desktop/src/help/articles/13-whats-new.md @@ -2,13 +2,14 @@ High-level product notes for owners. Full detail: repo `CHANGELOG.md`. -Current release: **v0.70.1**. Installed apps update on their own. +Current release: **v0.70.2**. Installed apps update on their own. Remedy lives on this computer. She finishes the goal you set, keeps the rules you gave her, and waits for you before money, send, or delete. ## Contents +- [0.70.2 — Switch to Web UI stays signed in](#0702---switch-to-web-ui-stays-signed-in) - [0.70.1 — About](#0701---about) - [0.70.0 — Ten languages](#0700---ten-languages) - [0.69.2 — The browser app in pip installs](#0692---the-browser-app-in-pip-installs) @@ -32,6 +33,13 @@ you gave her, and waits for you before money, send, or delete. Earlier notes follow on this page, newest first. +## 0.70.2 - Switch to Web UI stays signed in + +- **Switch to Web UI.** Opening the browser app from the desktop now signs you + in, so it keeps your chats and settings instead of showing the first-run + setup. If the browser ever can't reach Remedy, it says so and leaves your + setup untouched. + ## 0.70.1 - About - **About.** About Remedy shows the app version, a link to the source on GitHub, and the line "Hope this helps" - Ahmi. diff --git a/docs/manual/13-whats-new.md b/docs/manual/13-whats-new.md index f2b4275d..262b0b6a 100644 --- a/docs/manual/13-whats-new.md +++ b/docs/manual/13-whats-new.md @@ -2,13 +2,14 @@ High-level product notes for owners. Full detail: repo `CHANGELOG.md`. -Current release: **v0.70.1**. Installed apps update on their own. +Current release: **v0.70.2**. Installed apps update on their own. Remedy lives on this computer. She finishes the goal you set, keeps the rules you gave her, and waits for you before money, send, or delete. ## Contents +- [0.70.2 — Switch to Web UI stays signed in](#0702---switch-to-web-ui-stays-signed-in) - [0.70.1 — About](#0701---about) - [0.70.0 — Ten languages](#0700---ten-languages) - [0.69.2 — The browser app in pip installs](#0692---the-browser-app-in-pip-installs) @@ -32,6 +33,13 @@ you gave her, and waits for you before money, send, or delete. Earlier notes follow on this page, newest first. +## 0.70.2 - Switch to Web UI stays signed in + +- **Switch to Web UI.** Opening the browser app from the desktop now signs you + in, so it keeps your chats and settings instead of showing the first-run + setup. If the browser ever can't reach Remedy, it says so and leaves your + setup untouched. + ## 0.70.1 - About - **About.** About Remedy shows the app version, a link to the source on GitHub, and the line "Hope this helps" - Ahmi. diff --git a/native/go/httpapi/api.go b/native/go/httpapi/api.go index 4f47a270..607c8a01 100644 --- a/native/go/httpapi/api.go +++ b/native/go/httpapi/api.go @@ -27,7 +27,7 @@ import ( ) // Version matches pyproject.toml; scripts/sync_version.py stamps this const. -const Version = "0.70.1" +const Version = "0.70.2" // Config controls the minimal local API server. type Config struct { diff --git a/pyproject.toml b/pyproject.toml index 8341ff08..ec02d3bd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ # unrelated package (remedy 0.0.6) that pulls ancient Jinja2/begins. # Import package and CLI entry point remain `remedy`. name = "remedy-ai" -version = "0.70.1" +version = "0.70.2" description = "Personal AI partner for any ability level — drives this computer to finish goals (life tasks, research, games, code). Not a medical product." readme = "README.md" license = { text = "Apache-2.0" } diff --git a/scripts/latest.json b/scripts/latest.json index 8e45fd5f..8a3d32bf 100644 --- a/scripts/latest.json +++ b/scripts/latest.json @@ -1,23 +1,23 @@ { - "version": "v0.70.1", - "notes": "Remedy Desktop v0.70.1 \u2014 Windows installer, Linux AppImage, and macOS app", - "pub_date": "2026-11-16T00:46:51Z", + "version": "v0.70.2", + "notes": "Remedy Desktop v0.70.2 \u2014 Windows installer, Linux AppImage, and macOS app", + "pub_date": "2026-11-16T05:58:45Z", "platforms": { "windows-x86_64": { "signature": "", - "url": "https://github.com/AhmiDarrow/RemedyAI/releases/download/v0.70.1/Remedy.Desktop_0.70.1_x64-setup.exe" + "url": "https://github.com/AhmiDarrow/RemedyAI/releases/download/v0.70.2/Remedy.Desktop_0.70.2_x64-setup.exe" }, "linux-x86_64": { "signature": "", - "url": "https://github.com/AhmiDarrow/RemedyAI/releases/download/v0.70.1/Remedy.Desktop_0.70.1_amd64.AppImage" + "url": "https://github.com/AhmiDarrow/RemedyAI/releases/download/v0.70.2/Remedy.Desktop_0.70.2_amd64.AppImage" }, "darwin-aarch64": { "signature": "", - "url": "https://github.com/AhmiDarrow/RemedyAI/releases/download/runtime-v0.70.1/Remedy.Desktop_0.70.1_aarch64.app.tar.gz" + "url": "https://github.com/AhmiDarrow/RemedyAI/releases/download/runtime-v0.70.2/Remedy.Desktop_0.70.2_aarch64.app.tar.gz" }, "darwin-x86_64": { "signature": "", - "url": "https://github.com/AhmiDarrow/RemedyAI/releases/download/runtime-v0.70.1/Remedy.Desktop_0.70.1_x64.app.tar.gz" + "url": "https://github.com/AhmiDarrow/RemedyAI/releases/download/runtime-v0.70.2/Remedy.Desktop_0.70.2_x64.app.tar.gz" } } } diff --git a/uv.lock b/uv.lock index e2b95dfc..9fe66153 100644 --- a/uv.lock +++ b/uv.lock @@ -1,5 +1,5 @@ version = 1 -revision = 5 +revision = 3 requires-python = ">=3.12" resolution-markers = [ "python_full_version >= '3.15' and sys_platform == 'win32'", @@ -2143,6 +2143,9 @@ wheels = [ name = "nvidia-cufft-cu12" version = "11.2.1.3" source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "nvidia-nvjitlink-cu12" }, +] wheels = [ { url = "https://files.pythonhosted.org/packages/27/94/3266821f65b92b3138631e9c8e7fe1fb513804ac934485a8d05776e1dd43/nvidia_cufft_cu12-11.2.1.3-py3-none-manylinux2014_x86_64.whl", hash = "sha256:f083fc24912aa410be21fa16d157fed2055dab1cc4b6934a0e03cba69eb242b9", size = 211459117, upload-time = "2024-04-03T20:57:40.402Z" }, ] @@ -3174,7 +3177,7 @@ wheels = [ [[package]] name = "remedy-ai" -version = "0.70.1" +version = "0.70.2" source = { editable = "." } dependencies = [ { name = "aiohttp" },