inline assistant: Fix model picker (#29136)

Release Notes:

- inline assistant: Fixed a bug where the default model would be used
even when a specific inline assistant model was configured
This commit is contained in:
Agus Zubiaga 2025-04-20 22:12:57 -03:00 committed by GitHub
parent ceeae790b7
commit 4473b45c3d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 61 additions and 31 deletions

View file

@ -24,6 +24,7 @@ use gpui::{
WeakEntity, Window, point,
};
use language::{Buffer, Point, Selection, TransactionId};
use language_model::ConfiguredModel;
use language_model::{LanguageModelRegistry, report_assistant_event};
use multi_buffer::MultiBufferRow;
use parking_lot::Mutex;
@ -1221,9 +1222,15 @@ impl InlineAssistant {
self.prompt_history.pop_front();
}
let Some(ConfiguredModel { model, .. }) =
LanguageModelRegistry::read_global(cx).inline_assistant_model()
else {
return;
};
assist
.codegen
.update(cx, |codegen, cx| codegen.start(user_prompt, cx))
.update(cx, |codegen, cx| codegen.start(model, user_prompt, cx))
.log_err();
}