Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

Bump app to v2.4.124, Bump CLI to v0.3.307 — auth-key encryption-toggle fix + browser navigate fire-and-forget — release-app release-cli

Louis Beaumont622d5ce8c75a
diff --git a/Cargo.lock b/Cargo.lock
index e0b9cd818..51187088b 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -6870,7 +6870,7 @@ dependencies = [
[[package]]
name = "screenpipe-audio"
-version = "0.3.305"
+version = "0.3.307"
dependencies = [
"anyhow",
"audiopipe",
@@ -6931,7 +6931,7 @@ dependencies = [
[[package]]
name = "screenpipe-audio-eval"
-version = "0.3.305"
+version = "0.3.307"
dependencies = [
"anyhow",
"clap",
@@ -6946,7 +6946,7 @@ dependencies = [
[[package]]
name = "screenpipe-config"
-version = "0.3.305"
+version = "0.3.307"
dependencies = [
"dirs 6.0.0",
"serde",
@@ -6959,7 +6959,7 @@ dependencies = [
[[package]]
name = "screenpipe-connect"
-version = "0.3.305"
+version = "0.3.307"
dependencies = [
"anyhow",
"async-trait",
@@ -6991,7 +6991,7 @@ dependencies = [
[[package]]
name = "screenpipe-core"
-version = "0.3.305"
+version = "0.3.307"
dependencies = [
"accessibility",
"accessibility-sys",
@@ -7039,7 +7039,7 @@ dependencies = [
[[package]]
name = "screenpipe-db"
-version = "0.3.305"
+version = "0.3.307"
dependencies = [
"anyhow",
"chrono",
@@ -7065,7 +7065,7 @@ dependencies = [
[[package]]
name = "screenpipe-engine"
-version = "0.3.305"
+version = "0.3.307"
dependencies = [
"anyhow",
"arc-swap",
@@ -7138,7 +7138,7 @@ dependencies = [
[[package]]
name = "screenpipe-events"
-version = "0.3.305"
+version = "0.3.307"
dependencies = [
"anyhow",
"chrono",
@@ -7156,7 +7156,7 @@ dependencies = [
[[package]]
name = "screenpipe-screen"
-version = "0.3.305"
+version = "0.3.307"
dependencies = [
"accessibility-sys",
"anyhow",
@@ -7214,7 +7214,7 @@ dependencies = [
[[package]]
name = "screenpipe-vault"
-version = "0.3.305"
+version = "0.3.307"
dependencies = [
"argon2",
"chacha20poly1305",
diff --git a/Cargo.toml b/Cargo.toml
index a496d61a9..a43f4d63c 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -6,7 +6,7 @@ exclude = ["apps/screenpipe-app-tauri/src-tauri", "crates/screenpipe-integration
resolver = "2"
[workspace.package]
-version = "0.3.306"
+version = "0.3.307"
authors = ["louis030195 <[email protected]>"]
description = ""
repository = "https://github.com/screenpipe/screenpipe"
diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock b/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
index 104cb354f..c1c4b27ae 100644
--- a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
+++ b/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
@@ -9726,7 +9726,7 @@ dependencies = [
[[package]]
name = "screenpipe-app"
-version = "2.4.122"
+version = "2.4.123"
dependencies = [
"anyhow",
"arboard",
@@ -9833,7 +9833,7 @@ dependencies = [
[[package]]
name = "screenpipe-audio"
-version = "0.3.305"
+version = "0.3.306"
dependencies = [
"anyhow",
"audiopipe",
@@ -9889,7 +9889,7 @@ dependencies = [
[[package]]
name = "screenpipe-config"
-version = "0.3.305"
+version = "0.3.306"
dependencies = [
"dirs 6.0.0",
"serde",
@@ -9901,7 +9901,7 @@ dependencies = [
[[package]]
name = "screenpipe-connect"
-version = "0.3.305"
+version = "0.3.306"
dependencies = [
"anyhow",
"async-trait",
@@ -9932,7 +9932,7 @@ dependencies = [
[[package]]
name = "screenpipe-core"
-version = "0.3.305"
+version = "0.3.306"
dependencies = [
"accessibility",
"accessibility-sys",
@@ -9980,7 +9980,7 @@ dependencies = [
[[package]]
name = "screenpipe-db"
-version = "0.3.305"
+version = "0.3.306"
dependencies = [
"anyhow",
"chrono",
@@ -10005,7 +10005,7 @@ dependencies = [
[[package]]
name = "screenpipe-engine"
-version = "0.3.305"
+version = "0.3.306"
dependencies = [
"anyhow",
"arc-swap",
@@ -10071,7 +10071,7 @@ dependencies = [
[[package]]
name = "screenpipe-events"
-version = "0.3.305"
+version = "0.3.306"
dependencies = [
"anyhow",
"chrono",
@@ -10087,7 +10087,7 @@ dependencies = [
[[package]]
name = "screenpipe-screen"
-version = "0.3.305"
+version = "0.3.306"
dependencies = [
"accessibility-sys",
"anyhow",
@@ -10140,7 +10140,7 @@ dependencies = [
[[package]]
name = "screenpipe-vault"
-version = "0.3.305"
+version = "0.3.306"
dependencies = [
"argon2",
"chacha20poly1305",
diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.toml b/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
index d39b17c53..1094ec9ec 100644
--- a/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
+++ b/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "screenpipe-app"
-version = "2.4.123"
+version = "2.4.124"
description = "24/7 memory for your desktop. 100% local."
authors = ["you"]
license = ""
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/owned_browser.rs b/apps/screenpipe-app-tauri/src-tauri/src/owned_browser.rs
index 0a6088dea..8c87fb840 100644
--- a/apps/screenpipe-app-tauri/src-tauri/src/owned_browser.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/owned_browser.rs
@@ -255,6 +255,37 @@ impl OwnedWebviewHandle for TauriOwnedHandle {
error: parsed.error,
})
}
+
+ /// Native fire-and-forget navigate. Bypasses the eval round-trip so
+ /// the HTTP caller doesn't sit in a 30s polling loop waiting for a
+ /// `document.title` marker that real-world pages clobber with their
+ /// own titles. The frontend sidebar listens for `NAVIGATE_EVENT` and
+ /// reveals/positions the webview itself.
+ async fn navigate(&self, url: &str) -> Result<(), String> {
+ let webview_window = self
+ .app
+ .get_webview_window(WEBVIEW_LABEL)
+ .ok_or_else(|| "owned-browser webview window not found".to_string())?;
+
+ let parsed: url::Url = url
+ .parse()
+ .map_err(|e: url::ParseError| format!("invalid url: {e}"))?;
+
+ // Make the webview live before navigating — a hidden WebView2
+ // window can silently drop the navigate call. We do NOT hold the
+ // eval_lock here; navigate is independent of in-flight evals so
+ // a long-running snapshot can't queue behind it.
+ if !webview_window.is_visible().unwrap_or(false) {
+ let _ = webview_window.show();
+ }
+
+ let _ = self.app.emit(NAVIGATE_EVENT, parsed.as_str());
+ webview_window
+ .navigate(parsed)
+ .map_err(|e| format!("webview.navigate failed: {e}"))?;
+
+ Ok(())
+ }
}
// ---------------------------------------------------------------------------
diff --git a/crates/screenpipe-connect/src/connections/browser/mod.rs b/crates/screenpipe-connect/src/connections/browser/mod.rs
index 2228e704c..d4e5c184f 100644
--- a/crates/screenpipe-connect/src/connections/browser/mod.rs
+++ b/crates/screenpipe-connect/src/connections/browser/mod.rs
@@ -75,6 +75,31 @@ pub trait Browser: Send + Sync {
url: Option<&str>,
timeout: Duration,
) -> Result<EvalResult, EvalError>;
+
+ /// Navigate the browser to `url`. Fire-and-forget: returns as soon as
+ /// the navigation has been dispatched, NOT when the page has loaded.
+ /// Callers that need to wait for content to be ready should follow up
+ /// with `eval` (e.g. snapshot) which already handles its own
+ /// readyState wait.
+ ///
+ /// Default impl delegates to `eval("location.href = ...")` with a
+ /// short timeout — the round-trip just confirms the JS executed,
+ /// not that the new page finished loading. Browsers with a native
+ /// navigation primitive (the owned webview) override this so the
+ /// HTTP caller doesn't sit in a 30s polling loop racing the page's
+ /// own `document.title` setters. See `crates/screenpipe-connect`
+ /// docs for the full incident write-up.
+ async fn navigate(&self, url: &str) -> Result<(), EvalError> {
+ let escaped = serde_json::to_string(url)
+ .map_err(|e| EvalError::SendFailed(format!("encode url: {e}")))?;
+ self.eval(
+ &format!("location.href = {escaped}"),
+ None,
+ Duration::from_secs(5),
+ )
+ .await
+ .map(|_| ())
+ }
}
// ---------------------------------------------------------------------------
diff --git a/crates/screenpipe-connect/src/connections/browser/owned.rs b/crates/screenpipe-connect/src/connections/browser/owned.rs
index da48b1e83..44061d88d 100644
--- a/crates/screenpipe-connect/src/connections/browser/owned.rs
+++ b/crates/screenpipe-connect/src/connections/browser/owned.rs
@@ -39,6 +39,23 @@ pub trait OwnedWebviewHandle: Send + Sync {
url: Option<&str>,
timeout: Duration,
) -> Result<EvalResult, String>;
+
+ /// Fire-and-forget navigation. Default impl falls back to `eval` so
+ /// existing transports keep working unchanged; the Tauri impl
+ /// overrides it with `WebviewWindow::navigate(...)` so we don't pay
+ /// the eval round-trip (which polls `document.title` and races the
+ /// page's own title setters — see incident notes in the parent crate).
+ async fn navigate(&self, url: &str) -> Result<(), String> {
+ let escaped =
+ serde_json::to_string(url).map_err(|e| format!("encode url: {e}"))?;
+ self.eval(
+ &format!("location.href = {escaped}"),
+ None,
+ Duration::from_secs(5),
+ )
+ .await
+ .map(|_| ())
+ }
}
// ---------------------------------------------------------------------------
@@ -123,6 +140,13 @@ impl Browser for OwnedBrowser {
.await
.map_err(EvalError::SendFailed)
}
+ async fn navigate(&self, url: &str) -> Result<(), EvalError> {
+ let handle = {
+ let guard = self.handle.read().await;
+ guard.as_ref().cloned().ok_or(EvalError::NotConnected)?
+ };
+ handle.navigate(url).await.map_err(EvalError::SendFailed)
+ }
}
// ---------------------------------------------------------------------------
diff --git a/crates/screenpipe-engine/src/auth_key.rs b/crates/screenpipe-engine/src/auth_key.rs
index 2d1a28ac8..050e2d825 100644
--- a/crates/screenpipe-engine/src/auth_key.rs
+++ b/crates/screenpipe-engine/src/auth_key.rs
@@ -105,7 +105,27 @@ async fn open_secret_store(data_dir: &Path) -> Result<screenpipe_secrets::Secret
let db_path = data_dir.join("db.sqlite");
let db_url = format!("sqlite:{}?mode=rwc", db_path.display());
let pool = sqlx::SqlitePool::connect(&db_url).await?;
- let store = screenpipe_secrets::SecretStore::new(pool, None).await?;
+ // Load the keychain encryption key if the user has opted into encryption,
+ // otherwise pass None (plaintext mode). Without this, the previous code
+ // ALWAYS opened the store unkeyed — so as soon as the user toggled
+ // encryption on the existing api_auth_key entry (now encrypted with a
+ // non-zero nonce) became unreadable, `get()` returned an Err that the
+ // resolver swallowed, and the chain fell through to "auto-generate".
+ // The new auto-generated key was persisted as a fresh plaintext row,
+ // overwriting the encrypted one and silently rotating the API key out
+ // from under every consumer that had cached the prior value (the
+ // desktop frontend, the running engine's in-memory token, the tray
+ // menu, the embedded WebSocket clients) — ⇒ "unauthorized API access"
+ // on the next request the user issued (e.g. "Delete last 5 minutes").
+ let key = if screenpipe_secrets::is_encryption_requested(data_dir) {
+ match screenpipe_secrets::keychain::get_key() {
+ screenpipe_secrets::keychain::KeyResult::Found(k) => Some(k),
+ _ => None,
+ }
+ } else {
+ None
+ };
+ let store = screenpipe_secrets::SecretStore::new(pool, key).await?;
Ok(store)
}
diff --git a/crates/screenpipe-engine/src/connections_api.rs b/crates/screenpipe-engine/src/connections_api.rs
index cddb55aab..7d488f01d 100644
--- a/crates/screenpipe-engine/src/connections_api.rs
+++ b/crates/screenpipe-engine/src/connections_api.rs
@@ -1449,12 +1449,22 @@ async fn browser_get_status(
}
/// POST /connections/browsers/:id/navigate — open `url` in the named browser.
-/// High-level intent verb so the agent doesn't have to know that under the
-/// hood this is `eval(code: "return location.href", url: <target>)`.
-/// Returns `{ "ok": true, "url": <final-url> }` on success.
+///
+/// Fire-and-forget: returns `{ok: true, dispatched: true, url}` as soon as
+/// the navigation has been kicked off, NOT when the page has loaded. We
+/// previously did a `eval("return location.href", ...)` round-trip with a
+/// 30s timeout; the eval polled `document.title` for a result marker that
+/// real-world pages clobbered with their own titles, so the handler hung
+/// for the full timeout while the navigation had actually succeeded. The
+/// agent should follow up with `/snapshot` (which has its own readyState
+/// wait) to read the loaded page.
#[derive(Deserialize)]
struct BrowserNavigateBody {
url: String,
+ /// Accepted but ignored — kept so existing pipes that pass it don't
+ /// break. Navigation is now fire-and-forget; if you need to wait for
+ /// the page, call `/snapshot` afterwards.
+ #[allow(dead_code)]
#[serde(default)]
timeout_secs: Option<u64>,
}
@@ -1465,8 +1475,7 @@ async fn browser_run_navigate(
Json(body): Json<BrowserNavigateBody>,
) -> (StatusCode, Json<Value>) {
// Validate the URL up front so a malformed input returns 400 (client
- // error), not 502 (the upstream eval transport's catch-all). Same
- // parser the Tauri shell uses internally — keeps semantics consistent.
+ // error), not 502 (the upstream transport's catch-all).
if let Err(e) = url::Url::parse(&body.url) {
return (
StatusCode::BAD_REQUEST,
@@ -1484,28 +1493,15 @@ async fn browser_run_navigate(
}
};
- let timeout = std::time::Duration::from_secs(body.timeout_secs.unwrap_or(30).min(120));
- // We pass `return location.href` so the response includes the URL the
- // page actually settled on (after redirects). The user-visible side
- // effect — the navigation itself — is driven by the `url` argument.
- // The Tauri eval impl already waits for the page to start loading
- // before reading; further redirect-stability detection would need a
- // mutation observer in the page and isn't worth the complexity here.
- match browser
- .eval("return location.href", Some(&body.url), timeout)
- .await
- {
- Ok(r) if r.ok => (
+ match browser.navigate(&body.url).await {
+ Ok(()) => (
StatusCode::OK,
Json(json!({
"ok": true,
- "url": r.result,
+ "dispatched": true,
+ "url": body.url,
})),
),
- Ok(r) => (
- StatusCode::UNPROCESSABLE_ENTITY,
- Json(json!({ "ok": false, "error": r.error })),
- ),
Err(EvalError::NotConnected) => (
StatusCode::SERVICE_UNAVAILABLE,
Json(json!({ "ok": false, "error": EvalError::NotConnected.to_string() })),