agent: Don't render usage callouts when not using the Zed provider (#30025)

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

Release Notes:

- Agent Beta: Changed usage callouts to only be displayed when using a
model through the Zed provider.
This commit is contained in:
Marshall Bowers 2025-05-06 13:50:26 -04:00 committed by GitHub
parent 80236d0bb9
commit 7a9165d5ce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -26,7 +26,10 @@ use gpui::{
Task, TextStyle, WeakEntity, linear_color_stop, linear_gradient, point, pulsating_between,
};
use language::{Buffer, Language};
use language_model::{ConfiguredModel, LanguageModelRequestMessage, MessageContent, RequestUsage};
use language_model::{
ConfiguredModel, LanguageModelRequestMessage, MessageContent, RequestUsage,
ZED_CLOUD_PROVIDER_ID,
};
use language_model_selector::ToggleModelSelector;
use multi_buffer;
use project::Project;
@ -1071,6 +1074,17 @@ impl MessageEditor {
return None;
}
let is_using_zed_provider = self
.thread
.read(cx)
.configured_model()
.map_or(false, |model| {
model.provider.id().0 == ZED_CLOUD_PROVIDER_ID
});
if !is_using_zed_provider {
return None;
}
let user_store = self.user_store.read(cx);
let ubb_enable = user_store