From 80d50f56f3456ab184f680ed7afb9e134493eda2 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Mon, 18 Nov 2024 18:20:32 -0500 Subject: [PATCH] collab: Add feature flag to bypass account age check (#20843) This PR adds a `bypass-account-age-check` feature flag that can be used to bypass the minimum account age check. Release Notes: - N/A --- crates/collab/src/rpc.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/collab/src/rpc.rs b/crates/collab/src/rpc.rs index 397fcefacf..1184c48618 100644 --- a/crates/collab/src/rpc.rs +++ b/crates/collab/src/rpc.rs @@ -4031,7 +4031,10 @@ async fn get_llm_api_token( } let has_llm_subscription = session.has_llm_subscription(&db).await?; - if !has_llm_subscription { + + let bypass_account_age_check = + has_llm_subscription || flags.iter().any(|flag| flag == "bypass-account-age-check"); + if !bypass_account_age_check { let mut account_created_at = user.created_at; if let Some(github_created_at) = user.github_user_created_at { account_created_at = account_created_at.min(github_created_at);