Load Profile state from Thread and tie visibility to the thread's model (#30090)

When deciding if a model supports tools or not, we weren't reading from
the configured model in a given thread.

This also stores the profile on the thread, which matches the behavior
of the Model and Max Mode, which we also already store per thread.

Hopefully this helps alleviate some confusion.

Release Notes:

- agent: Save profile selection per-Agent thread
This commit is contained in:
Ben Brandt 2025-05-08 04:36:08 +02:00 committed by GitHub
parent 02ed4aefb8
commit 3615d6d96c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 67 additions and 23 deletions

View file

@ -199,6 +199,10 @@ impl MessageEditor {
)
});
let profile_selector = cx.new(|cx| {
ProfileSelector::new(thread.clone(), thread_store, editor.focus_handle(cx), cx)
});
Self {
editor: editor.clone(),
project: thread.read(cx).project().clone(),
@ -215,8 +219,7 @@ impl MessageEditor {
model_selector,
edits_expanded: false,
editor_is_expanded: false,
profile_selector: cx
.new(|cx| ProfileSelector::new(fs, thread_store, editor.focus_handle(cx), cx)),
profile_selector,
last_estimated_token_count: None,
update_token_count_task: None,
_subscriptions: subscriptions,