agent: Fix new thread model selection when starting new thread (#34708)
Release Notes: - agent: Fixed an issue where clicking on "Start New Thread" in the agent configuration would not always switch to the correct provider/model
This commit is contained in:
parent
fd8480a9dc
commit
4002801034
1 changed files with 15 additions and 1 deletions
|
@ -53,7 +53,8 @@ use gpui::{
|
|||
};
|
||||
use language::LanguageRegistry;
|
||||
use language_model::{
|
||||
ConfigurationError, LanguageModelProviderTosView, LanguageModelRegistry, ZED_CLOUD_PROVIDER_ID,
|
||||
ConfigurationError, ConfiguredModel, LanguageModelProviderTosView, LanguageModelRegistry,
|
||||
ZED_CLOUD_PROVIDER_ID,
|
||||
};
|
||||
use project::{Project, ProjectPath, Worktree};
|
||||
use prompt_store::{PromptBuilder, PromptStore, UserPromptId};
|
||||
|
@ -1347,6 +1348,19 @@ impl AgentPanel {
|
|||
}
|
||||
|
||||
self.new_thread(&NewThread::default(), window, cx);
|
||||
if let Some((thread, model)) =
|
||||
self.active_thread(cx).zip(provider.default_model(cx))
|
||||
{
|
||||
thread.update(cx, |thread, cx| {
|
||||
thread.set_configured_model(
|
||||
Some(ConfiguredModel {
|
||||
provider: provider.clone(),
|
||||
model,
|
||||
}),
|
||||
cx,
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue