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
+4 -2
View File
@@ -17,7 +17,7 @@ use agent::{
use agent_settings::{AgentProfileId, AgentSettings, CompletionMode};
use ai_onboarding::ApiKeysWithProviders;
use buffer_diff::BufferDiff;
use cloud_llm_client::CompletionIntent;
use cloud_llm_client::{CompletionIntent, PlanV1};
use collections::{HashMap, HashSet};
use editor::actions::{MoveUp, Paste};
use editor::display_map::CreaseId;
@@ -1298,7 +1298,9 @@ impl MessageEditor {
return None;
}
let plan = user_store.plan().unwrap_or(cloud_llm_client::Plan::ZedFree);
let plan = user_store
.plan()
.unwrap_or(cloud_llm_client::Plan::V1(PlanV1::ZedFree));
let usage = user_store.model_request_usage()?;