From 5bf1b4f0a8916645e11d9c1f56bf4ac6f45e1e91 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Thu, 1 May 2025 11:43:53 -0400 Subject: [PATCH] collab: Add `use_new_billing` to `LlmTokenClaims` (#29739) This PR adds a `use_new_billing` field to the LLM token claims, based on the `new-billing` feature flag. 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 e5e8a10718..9387c4d3f8 100644 --- a/crates/collab/src/llm/token.rs +++ b/crates/collab/src/llm/token.rs @@ -32,6 +32,8 @@ pub struct LlmTokenClaims { pub has_llm_subscription: bool, pub max_monthly_spend_in_cents: u32, pub custom_llm_monthly_allowance_in_cents: Option, + #[serde(default)] + pub use_new_billing: bool, pub plan: Plan, #[serde(default)] pub has_extended_trial: bool, @@ -90,6 +92,7 @@ impl LlmTokenClaims { custom_llm_monthly_allowance_in_cents: user .custom_llm_monthly_allowance_in_cents .map(|allowance| allowance as u32), + use_new_billing: feature_flags.iter().any(|flag| flag == "new-billing"), plan: subscription .as_ref() .and_then(|subscription| subscription.kind)