language_models: Fix is_authenticated state for Cloud provider (#54826)

This PR fixes an issue introduced in
https://github.com/zed-industries/zed/pull/54397 where the Zed Cloud
provider would not be reflected as "authenticated" if a connection to
Collab was attempted, but could not be established.

This was especially noticable when running Zed against a local version
of Cloud and not having Collab running.

This restores the original logic prior to that change.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2026-04-27 04:59:36 -04:00 committed by GitHub
parent db76d15718
commit 2cc960c991
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,6 +1,5 @@
use ai_onboarding::YoungAccountBanner;
use anyhow::Result;
use client::Status;
use client::{Client, RefreshLlmTokenListener, UserStore, global_llm_token, zed_urls};
use cloud_api_client::LlmApiToken;
use cloud_api_types::OrganizationId;
@ -250,8 +249,7 @@ impl LanguageModelProvider for CloudLanguageModelProvider {
fn is_authenticated(&self, cx: &App) -> bool {
let state = self.state.read(cx);
let status = *state.client.status().borrow();
matches!(status, Status::Authenticated | Status::Connected { .. })
!state.is_signed_out(cx)
}
fn authenticate(&self, cx: &mut App) -> Task<Result<(), AuthenticateError>> {