diff --git a/desktop/src-tauri/src/builderlab.rs b/desktop/src-tauri/src/builderlab.rs
index 0168978d31..e0b226a57c 100644
--- a/desktop/src-tauri/src/builderlab.rs
+++ b/desktop/src-tauri/src/builderlab.rs
@@ -1,4 +1,8 @@
-use std::{collections::HashMap, sync::Mutex, time::Duration};
+use std::{
+ collections::{HashMap, VecDeque},
+ sync::Mutex,
+ time::Duration,
+};
use axum::{
extract::{Path, Query, State as AxumState},
@@ -15,6 +19,7 @@ use url::Url;
const BUILDERLAB_API_BASE_URL: &str = "https://app.builderlab.xyz/api/goose";
const LOGIN_TIMEOUT: Duration = Duration::from_secs(10 * 60);
const ENTERPRISE_LOGIN_ATTEMPT_PREFIX: &str = "enterprise-login-";
+const CANCELED_LOGIN_ATTEMPT_TOMBSTONE_LIMIT: usize = 64;
const BB_SESSION_CREDENTIAL_HEADER: &str = "X-BB-Session-Credential";
// Builderlab enforces an Origin check on the identity bind endpoints. Browsers
// attach this automatically; the desktop reqwest client must set it explicitly
@@ -144,7 +149,13 @@ const AUTH_COMPLETE_HTML: &str = r#"
pub(crate) struct BuilderlabSession(Mutex