agent: Don't render trial upsell when not using the Zed provider (#30029)

This PR makes it so we don't render the trial upsell when not using the
Zed provider.

Release Notes:

- Agent Beta: Changed Zed Pro trial upsell to only be displayed when
using a model through the Zed provider.
This commit is contained in:
Marshall Bowers 2025-05-06 14:07:25 -04:00 committed by GitHub
parent b83d00d69b
commit 544e8fc46c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -27,7 +27,9 @@ use gpui::{
linear_gradient, prelude::*, pulsating_between,
};
use language::LanguageRegistry;
use language_model::{LanguageModelProviderTosView, LanguageModelRegistry, RequestUsage};
use language_model::{
LanguageModelProviderTosView, LanguageModelRegistry, RequestUsage, ZED_CLOUD_PROVIDER_ID,
};
use language_model_selector::ToggleModelSelector;
use project::{Project, ProjectPath, Worktree};
use prompt_store::{PromptBuilder, PromptStore, UserPromptId};
@ -1806,6 +1808,19 @@ impl AssistantPanel {
return false;
}
let is_using_zed_provider = self
.thread
.read(cx)
.thread()
.read(cx)
.configured_model()
.map_or(false, |model| {
model.provider.id().0 == ZED_CLOUD_PROVIDER_ID
});
if !is_using_zed_provider {
return false;
}
let plan = self.user_store.read(cx).current_plan();
if matches!(plan, Some(Plan::ZedPro | Plan::ZedProTrial)) {
return false;