From 266c41ed9a5d43d185acc46e0c8ac71d0cfbac3c Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Wed, 23 Apr 2025 10:22:18 -0400 Subject: [PATCH] collab: Add `can_use_web_search_tool` to LLM token claims (#29278) This PR adds a `can_use_web_search_tool` field to the LLM token claims. Currently anyone in the `assistant2` feature flag will have access to the web search tool. Co-authored-by: Bennet Release Notes: - N/A --- crates/collab/src/llm/token.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/collab/src/llm/token.rs b/crates/collab/src/llm/token.rs index 29a2acc816..a550255ed8 100644 --- a/crates/collab/src/llm/token.rs +++ b/crates/collab/src/llm/token.rs @@ -33,6 +33,8 @@ pub struct LlmTokenClaims { pub plan: Plan, #[serde(default)] pub subscription_period: Option<(NaiveDateTime, NaiveDateTime)>, + #[serde(default)] + pub can_use_web_search_tool: bool, } const LLM_TOKEN_LIFETIME: Duration = Duration::from_secs(60 * 60); @@ -70,6 +72,7 @@ impl LlmTokenClaims { bypass_account_age_check: feature_flags .iter() .any(|flag| flag == "bypass-account-age-check"), + can_use_web_search_tool: feature_flags.iter().any(|flag| flag == "assistant2"), has_llm_subscription: has_legacy_llm_subscription, max_monthly_spend_in_cents: billing_preferences .map_or(DEFAULT_MAX_MONTHLY_SPEND.0, |preferences| {