Revert "ai: Auto select user model when there's no default" - #36932
Merged
Merged
Conversation
This reverts commit b349a8f.
bennetbo
enabled auto-merge (squash)
August 26, 2025 13:32
JosephTLyons
pushed a commit
that referenced
this pull request
Aug 26, 2025
Reverts #36722 Release Notes: - N/A
tidely
pushed a commit
to tidely/zed
that referenced
this pull request
Sep 10, 2025
…stries#36932) Reverts zed-industries#36722 Release Notes: - N/A
FrGoIs
pushed a commit
to FrGoIs/zed
that referenced
this pull request
Sep 29, 2025
…stries#36932) Reverts zed-industries#36722 Release Notes: - N/A
Anthony-Eid
added a commit
to Anthony-Eid/zed
that referenced
this pull request
Apr 16, 2026
Reimplements zed-industries#36722 while avoiding the race that required the revert in zed-industries#36932. When no default model is configured, pick an environment fallback by authenticating all providers. Always prefer the Zed cloud provider when it's authenticated, and wait for its models to load before picking another provider as the fallback, so we don't flicker from Zed models to Anthropic while sign-in is in flight. The fallback is recomputed whenever provider state changes, so the selection becomes correct as soon as models arrive. Release Notes: - Added automatic selection of a language model provider when none is configured.
5 tasks
Anthony-Eid
added a commit
that referenced
this pull request
Apr 16, 2026
Reimplements #36722 while fixing the race that required the revert in #36932. When no default model is configured, this picks an environment fallback by authenticating all providers. It always prefers the Zed cloud provider when it's authenticated, and waits for its models to load before picking another provider as the fallback, so we don't flicker from Zed models to Anthropic while sign-in is in flight. The fallback is recomputed whenever provider state changes (via `ProviderStateChanged`/`AddedProvider`/`RemovedProvider` events), so the selection becomes correct as soon as cloud models arrive. ### What changed vs. the original PR - `language_models::init` now owns `authenticate_all_providers` (previously done in `LanguageModelPickerDelegate` and `agent`'s `LanguageModels`). - After all authentications settle, and on any subsequent provider state change, `update_environment_fallback_model` recomputes the fallback. - The fallback logic prefers Zed cloud: if the cloud provider is authenticated, only use it (waiting for its models to load). Otherwise, fall through to the first authenticated provider with a default or recommended model. - `LanguageModelRegistry::default_model()` falls back to `environment_fallback_model` when no explicit default is set. - Existing `Thread`s that are empty are updated to the new default when `DefaultModelChanged` fires, so a blank thread started before sign-in switches to Zed models once the user signs in. Release Notes: - agent: Automatically select a model when there's no selected model or configured default
eholk
pushed a commit
that referenced
this pull request
Apr 20, 2026
Reimplements #36722 while fixing the race that required the revert in #36932. When no default model is configured, this picks an environment fallback by authenticating all providers. It always prefers the Zed cloud provider when it's authenticated, and waits for its models to load before picking another provider as the fallback, so we don't flicker from Zed models to Anthropic while sign-in is in flight. The fallback is recomputed whenever provider state changes (via `ProviderStateChanged`/`AddedProvider`/`RemovedProvider` events), so the selection becomes correct as soon as cloud models arrive. ### What changed vs. the original PR - `language_models::init` now owns `authenticate_all_providers` (previously done in `LanguageModelPickerDelegate` and `agent`'s `LanguageModels`). - After all authentications settle, and on any subsequent provider state change, `update_environment_fallback_model` recomputes the fallback. - The fallback logic prefers Zed cloud: if the cloud provider is authenticated, only use it (waiting for its models to load). Otherwise, fall through to the first authenticated provider with a default or recommended model. - `LanguageModelRegistry::default_model()` falls back to `environment_fallback_model` when no explicit default is set. - Existing `Thread`s that are empty are updated to the new default when `DefaultModelChanged` fires, so a blank thread started before sign-in switches to Zed models once the user signs in. Release Notes: - agent: Automatically select a model when there's no selected model or configured default (cherry picked from commit e92a40a)
kathbigra
pushed a commit
to kathbigra/zed
that referenced
this pull request
May 10, 2026
…#54125) Reimplements zed-industries#36722 while fixing the race that required the revert in zed-industries#36932. When no default model is configured, this picks an environment fallback by authenticating all providers. It always prefers the Zed cloud provider when it's authenticated, and waits for its models to load before picking another provider as the fallback, so we don't flicker from Zed models to Anthropic while sign-in is in flight. The fallback is recomputed whenever provider state changes (via `ProviderStateChanged`/`AddedProvider`/`RemovedProvider` events), so the selection becomes correct as soon as cloud models arrive. ### What changed vs. the original PR - `language_models::init` now owns `authenticate_all_providers` (previously done in `LanguageModelPickerDelegate` and `agent`'s `LanguageModels`). - After all authentications settle, and on any subsequent provider state change, `update_environment_fallback_model` recomputes the fallback. - The fallback logic prefers Zed cloud: if the cloud provider is authenticated, only use it (waiting for its models to load). Otherwise, fall through to the first authenticated provider with a default or recommended model. - `LanguageModelRegistry::default_model()` falls back to `environment_fallback_model` when no explicit default is set. - Existing `Thread`s that are empty are updated to the new default when `DefaultModelChanged` fires, so a blank thread started before sign-in switches to Zed models once the user signs in. Release Notes: - agent: Automatically select a model when there's no selected model or configured default
Zenor27
pushed a commit
to Zenor27/zed
that referenced
this pull request
Jul 4, 2026
…#54125) Reimplements zed-industries#36722 while fixing the race that required the revert in zed-industries#36932. When no default model is configured, this picks an environment fallback by authenticating all providers. It always prefers the Zed cloud provider when it's authenticated, and waits for its models to load before picking another provider as the fallback, so we don't flicker from Zed models to Anthropic while sign-in is in flight. The fallback is recomputed whenever provider state changes (via `ProviderStateChanged`/`AddedProvider`/`RemovedProvider` events), so the selection becomes correct as soon as cloud models arrive. ### What changed vs. the original PR - `language_models::init` now owns `authenticate_all_providers` (previously done in `LanguageModelPickerDelegate` and `agent`'s `LanguageModels`). - After all authentications settle, and on any subsequent provider state change, `update_environment_fallback_model` recomputes the fallback. - The fallback logic prefers Zed cloud: if the cloud provider is authenticated, only use it (waiting for its models to load). Otherwise, fall through to the first authenticated provider with a default or recommended model. - `LanguageModelRegistry::default_model()` falls back to `environment_fallback_model` when no explicit default is set. - Existing `Thread`s that are empty are updated to the new default when `DefaultModelChanged` fires, so a blank thread started before sign-in switches to Zed models once the user signs in. Release Notes: - agent: Automatically select a model when there's no selected model or configured default
jonx
pushed a commit
to jonx/zed-aros
that referenced
this pull request
Jul 17, 2026
…#54125) Reimplements zed-industries#36722 while fixing the race that required the revert in zed-industries#36932. When no default model is configured, this picks an environment fallback by authenticating all providers. It always prefers the Zed cloud provider when it's authenticated, and waits for its models to load before picking another provider as the fallback, so we don't flicker from Zed models to Anthropic while sign-in is in flight. The fallback is recomputed whenever provider state changes (via `ProviderStateChanged`/`AddedProvider`/`RemovedProvider` events), so the selection becomes correct as soon as cloud models arrive. ### What changed vs. the original PR - `language_models::init` now owns `authenticate_all_providers` (previously done in `LanguageModelPickerDelegate` and `agent`'s `LanguageModels`). - After all authentications settle, and on any subsequent provider state change, `update_environment_fallback_model` recomputes the fallback. - The fallback logic prefers Zed cloud: if the cloud provider is authenticated, only use it (waiting for its models to load). Otherwise, fall through to the first authenticated provider with a default or recommended model. - `LanguageModelRegistry::default_model()` falls back to `environment_fallback_model` when no explicit default is set. - Existing `Thread`s that are empty are updated to the new default when `DefaultModelChanged` fires, so a blank thread started before sign-in switches to Zed models once the user signs in. Release Notes: - agent: Automatically select a model when there's no selected model or configured default
jolutz
pushed a commit
to jolutz/zed
that referenced
this pull request
Aug 8, 2026
…stries#36932) Reverts zed-industries#36722 Release Notes: - N/A
jolutz
pushed a commit
to jolutz/zed
that referenced
this pull request
Aug 8, 2026
…#54125) Reimplements zed-industries#36722 while fixing the race that required the revert in zed-industries#36932. When no default model is configured, this picks an environment fallback by authenticating all providers. It always prefers the Zed cloud provider when it's authenticated, and waits for its models to load before picking another provider as the fallback, so we don't flicker from Zed models to Anthropic while sign-in is in flight. The fallback is recomputed whenever provider state changes (via `ProviderStateChanged`/`AddedProvider`/`RemovedProvider` events), so the selection becomes correct as soon as cloud models arrive. ### What changed vs. the original PR - `language_models::init` now owns `authenticate_all_providers` (previously done in `LanguageModelPickerDelegate` and `agent`'s `LanguageModels`). - After all authentications settle, and on any subsequent provider state change, `update_environment_fallback_model` recomputes the fallback. - The fallback logic prefers Zed cloud: if the cloud provider is authenticated, only use it (waiting for its models to load). Otherwise, fall through to the first authenticated provider with a default or recommended model. - `LanguageModelRegistry::default_model()` falls back to `environment_fallback_model` when no explicit default is set. - Existing `Thread`s that are empty are updated to the new default when `DefaultModelChanged` fires, so a blank thread started before sign-in switches to Zed models once the user signs in. Release Notes: - agent: Automatically select a model when there's no selected model or configured default
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.
Reverts #36722
Release Notes: