Clear LLM token and model list on sign out - #57724
Merged
Merged
Conversation
maxdeviant
reviewed
May 26, 2026
| llm_token: &LlmApiToken, | ||
| organization_id: Option<OrganizationId>, | ||
| ) -> Result<String> { | ||
| self.ensure_authenticated_for_llm_token(llm_token).await?; |
Member
There was a problem hiding this comment.
Do we need these checks if we instead proactively clear the LLM token on sign-out?
Contributor
Author
There was a problem hiding this comment.
I think we need this check. Otherwise, we would call LlmApiToken::cached which would try to fetch the token again (and likely succeed unless the token is expired)
Member
There was a problem hiding this comment.
I guess what I mean is that the flow for sign-out is:
- We call the sign-out method here:
zed/crates/client/src/client.rs
Line 1638 in ee5c7b6
- This calls
cloud_client.clear_credentialsto clear the client access token
- We can now longer get a new LLM token at this point, as the credentials have been cleared
- We call
self.disconnect, which sets the status toStatus::SignedOut
So if we react to the Status change and clear out the existing LlmApiToken, then there should be no other way to get a new one short of signing back in.
Contributor
Author
There was a problem hiding this comment.
I see, thanks. Removed the checks..
Without an explicit auth check, the test becomes too complex
maxdeviant
approved these changes
Jun 3, 2026
TomPlanche
pushed a commit
to TomPlanche/zed
that referenced
this pull request
Jun 8, 2026
Closes #FR-20 Release Notes: - Fixed Zed provider models remaining available after sign-out
This was referenced Jun 10, 2026
This was referenced Jun 18, 2026
Closed
liusuren123
pushed a commit
to liusuren123/zed
that referenced
this pull request
Jun 24, 2026
Closes #FR-20 Release Notes: - Fixed Zed provider models remaining available after sign-out
This was referenced Jul 1, 2026
This was referenced Jul 10, 2026
jonx
pushed a commit
to jonx/zed-aros
that referenced
this pull request
Jul 17, 2026
Closes #FR-20 Release Notes: - Fixed Zed provider models remaining available after sign-out
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #FR-20
Release Notes: