Add user picked model to be used as a default for open router provider when generating comments and thread summary - #47475
Merged
Conversation
zapp88
force-pushed
the
37525-default-model
branch
from
January 23, 2026 14:00
e85226d to
e39b26f
Compare
zapp88
marked this pull request as draft
January 23, 2026 14:41
zapp88
force-pushed
the
37525-default-model
branch
from
January 23, 2026 14:42
5dba98f to
9da3f2d
Compare
The `default_fast` method now returns `None` instead of providing a hardcoded model, and the redundant `default_fast()` method on `Model` is consolidated into `default()`.
zapp88
marked this pull request as ready for review
January 23, 2026 15:08
benbrandt
approved these changes
Feb 12, 2026
benbrandt
enabled auto-merge (squash)
February 12, 2026 13:00
benbrandt
disabled auto-merge
February 12, 2026 13:00
benbrandt
enabled auto-merge (squash)
February 12, 2026 13:01
morgankrey
added a commit
that referenced
this pull request
Feb 19, 2026
Auto-applied queued documentation suggestions from: - PR #48908 - PR #48909 - PR #48910 - PR #48912 - PR #48930 - PR #44794 - PR #48763 - PR #45073 - PR #48495 - PR #49374 - PR #49139 - PR #48780 - PR #48619 - PR #48978 - PR #48962 - PR #48988 - PR #47860 - PR #49015 - PR #47095 - PR #47475 - PR #48542 - PR #46766 - PR #47754 - PR #48807 - PR #44506 - PR #49051 - PR #49069 - PR #48842 - PR #48851 - PR #48736 - PR #47673 - PR #49094 - PR #49098 - PR #49622 Generated with script/docs-suggest-publish for human review in draft PR.
morgankrey
added a commit
that referenced
this pull request
Feb 25, 2026
Auto-applied queued documentation suggestions from: - PR #48908 - PR #48909 - PR #48910 - PR #48912 - PR #48930 - PR #44794 - PR #48763 - PR #45073 - PR #48495 - PR #49374 - PR #49139 - PR #48780 - PR #48619 - PR #48978 - PR #48962 - PR #48988 - PR #47860 - PR #49015 - PR #47095 - PR #47475 - PR #48542 - PR #46766 - PR #47754 - PR #48807 - PR #44506 - PR #49051 - PR #49069 - PR #48842 - PR #48851 - PR #48736 - PR #47673 - PR #49094 - PR #49098 - PR #49622 - PR #49554 - PR #49710 - PR #49716 - PR #49732 - PR #49788 - PR #49876 - PR #49902 - PR #49910 - PR #49390 - PR #50027 Generated with script/docs-suggest-publish for human review in draft PR.
morgankrey
added a commit
that referenced
this pull request
Feb 25, 2026
Auto-applied documentation from: - PR #48619: agent single_file_review default change - PR #48978: enriched symbol names in outline - PR #49015: audio device selection for collab - PR #47095: MCP error handling - PR #47475: OpenRouter default model requirement Skipped (already documented): - PR #49139, PR #48780, PR #48988, PR #47860
morgankrey
added a commit
that referenced
this pull request
Feb 25, 2026
Auto-applied queued documentation suggestions from: - PR #48908 - PR #48909 - PR #48910 - PR #48912 - PR #48930 - PR #44794 - PR #48763 - PR #45073 - PR #48495 - PR #49374 - PR #49139 - PR #48780 - PR #48619 - PR #48978 - PR #48962 - PR #48988 - PR #47860 - PR #49015 - PR #47095 - PR #47475 - PR #48542 - PR #46766 - PR #47754 - PR #48807 - PR #44506 - PR #49051 - PR #49069 - PR #48842 - PR #48851 - PR #48736 - PR #47673 - PR #49094 - PR #49098 - PR #49622 - PR #49554 - PR #49710 - PR #49716 - PR #49732 - PR #49788 - PR #49876 - PR #49902 - PR #49910 - PR #49390 - PR #50027 Generated with script/docs-suggest-publish for human review in draft PR.
morgankrey
added a commit
that referenced
this pull request
Feb 25, 2026
Auto-applied documentation from: - PR #48619: agent single_file_review default change - PR #48978: enriched symbol names in outline - PR #49015: audio device selection for collab - PR #47095: MCP error handling - PR #47475: OpenRouter default model requirement Skipped (already documented): - PR #49139, PR #48780, PR #48988, PR #47860
jonx
pushed a commit
to jonx/zed-aros
that referenced
this pull request
Jul 17, 2026
…r when generating comments and thread summary (zed-industries#47475) Closes zed-industries#37525 By default, thread summary uses default_fast_model (if set), otherwise default_model, which resolves to openrouter/auto for openrouter provider. This may cause the summary to be generated by a different model than the one used by the agent, potentially leading — in cases such as Claude Opus 4.5 — to summary costs exceeding main agent execution costs. The current logic in registry.rs prioritizes default_fast_model over default_model, which overrides the user-selected model (assigned only to default_model). Setting default_fast_model = None for the OpenRouter provider preserves the fallback to openrouter/auto when no model is chosen, while respecting the user's explicit model selection when one is provided. ```rust pub fn set_default_model(&mut self, model: Option<ConfiguredModel>, cx: &mut Context<Self>) { match (self.default_model.as_ref(), model.as_ref()) { (Some(old), Some(new)) if old.is_same_as(new) => {} (None, None) => {} _ => cx.emit(Event::DefaultModelChanged), } self.default_fast_model = maybe!({ let provider = &model.as_ref()?.provider; let fast_model = provider.default_fast_model(cx)?; Some(ConfiguredModel { provider: provider.clone(), model: fast_model, }) }); // This sets default fast model (in our case openrouter/auto) self.default_model = model; //This sets default_model to user selected model } ``` And latter on : ```rust pub fn thread_summary_model(&self) -> Option<ConfiguredModel> { #[cfg(debug_assertions)] if std::env::var("ZED_SIMULATE_NO_LLM_PROVIDER").is_ok() { return None; } self.thread_summary_model .clone() .or_else(|| self.default_fast_model.clone()) // We pick fast_model over default model here .or_else(|| self.default_model.clone()) } ``` Which results in user choice being ignored. Proposed behavior: Use the model explicitly selected by the user in Zed agent configuration. If no model is specified, fall back to the configured default. The resolution is to set in : provider/open_router.rs ```rust fn default_fast_model(&self, _cx: &App) -> Option<Arc<dyn LanguageModel>> { None } ``` This will have a consequence of default_fast_model not being provided and falling back to user choice - but once the fast model is set via for example a configuration property - the default_fast_model is picked over default_model Release Notes: - open_router: Use user's default model when comments and thread summary
jolutz
pushed a commit
to jolutz/zed
that referenced
this pull request
Aug 8, 2026
…r when generating comments and thread summary (zed-industries#47475) Closes zed-industries#37525 By default, thread summary uses default_fast_model (if set), otherwise default_model, which resolves to openrouter/auto for openrouter provider. This may cause the summary to be generated by a different model than the one used by the agent, potentially leading — in cases such as Claude Opus 4.5 — to summary costs exceeding main agent execution costs. The current logic in registry.rs prioritizes default_fast_model over default_model, which overrides the user-selected model (assigned only to default_model). Setting default_fast_model = None for the OpenRouter provider preserves the fallback to openrouter/auto when no model is chosen, while respecting the user's explicit model selection when one is provided. ```rust pub fn set_default_model(&mut self, model: Option<ConfiguredModel>, cx: &mut Context<Self>) { match (self.default_model.as_ref(), model.as_ref()) { (Some(old), Some(new)) if old.is_same_as(new) => {} (None, None) => {} _ => cx.emit(Event::DefaultModelChanged), } self.default_fast_model = maybe!({ let provider = &model.as_ref()?.provider; let fast_model = provider.default_fast_model(cx)?; Some(ConfiguredModel { provider: provider.clone(), model: fast_model, }) }); // This sets default fast model (in our case openrouter/auto) self.default_model = model; //This sets default_model to user selected model } ``` And latter on : ```rust pub fn thread_summary_model(&self) -> Option<ConfiguredModel> { #[cfg(debug_assertions)] if std::env::var("ZED_SIMULATE_NO_LLM_PROVIDER").is_ok() { return None; } self.thread_summary_model .clone() .or_else(|| self.default_fast_model.clone()) // We pick fast_model over default model here .or_else(|| self.default_model.clone()) } ``` Which results in user choice being ignored. Proposed behavior: Use the model explicitly selected by the user in Zed agent configuration. If no model is specified, fall back to the configured default. The resolution is to set in : provider/open_router.rs ```rust fn default_fast_model(&self, _cx: &App) -> Option<Arc<dyn LanguageModel>> { None } ``` This will have a consequence of default_fast_model not being provided and falling back to user choice - but once the fast model is set via for example a configuration property - the default_fast_model is picked over default_model Release Notes: - open_router: Use user's default model when comments and thread summary
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 #37525
By default, thread summary uses default_fast_model (if set), otherwise default_model, which resolves to openrouter/auto for openrouter provider. This may cause the summary to be generated by a different model than the one used by the agent, potentially leading — in cases such as Claude Opus 4.5 — to summary costs exceeding main agent execution costs.
The current logic in registry.rs prioritizes default_fast_model over default_model, which overrides the user-selected model (assigned only to default_model). Setting default_fast_model = None for the OpenRouter provider preserves the fallback to openrouter/auto when no model is chosen, while respecting the user's explicit model selection when one is provided.
And latter on :
Which results in user choice being ignored.
Proposed behavior:
Use the model explicitly selected by the user in Zed agent configuration.
If no model is specified, fall back to the configured default.
The resolution is to set in : provider/open_router.rs
This will have a consequence of default_fast_model not being provided and falling back to user choice - but once the fast model is set via for example a configuration property - the default_fast_model is picked over default_model
Release Notes: