Make plans backwards compatible (#37941)

This PR fixes the backwards compatibility of the new `Plan` variants.

We can't add new variants to the wire representation, as old clients
won't be able to understand them.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers
2025-09-10 20:11:07 +00:00
committed by GitHub
parent 2c29eac29f
commit cb75c2aeb7
18 changed files with 215 additions and 135 deletions
+3 -2
View File
@@ -1,7 +1,7 @@
use crate::{Client, Connection, Credentials, EstablishConnectionError, UserStore};
use anyhow::{Context as _, Result, anyhow};
use cloud_api_client::{AuthenticatedUser, GetAuthenticatedUserResponse, PlanInfo};
use cloud_llm_client::{CurrentUsage, Plan, UsageData, UsageLimit};
use cloud_llm_client::{CurrentUsage, PlanV1, UsageData, UsageLimit};
use futures::{StreamExt, stream::BoxStream};
use gpui::{AppContext as _, BackgroundExecutor, Entity, TestAppContext};
use http_client::{AsyncBody, Method, Request, http};
@@ -269,7 +269,8 @@ pub fn make_get_authenticated_user_response(
},
feature_flags: vec![],
plan: PlanInfo {
plan: Plan::ZedPro,
plan: PlanV1::ZedPro,
plan_v2: None,
subscription_period: None,
usage: CurrentUsage {
model_requests: UsageData {