Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
acp: Fix stale ACP reasoning-effort options when model switch keeps same config IDs (#50246)
Nikhil Pandeycbbcb1e10165
diff --git a/crates/agent_ui/src/config_options.rs b/crates/agent_ui/src/config_options.rsindex 387069cd167..458411d4d3a 100644--- a/crates/agent_ui/src/config_options.rs+++ b/crates/agent_ui/src/config_options.rs@@ -49,7 +49,7 @@ impl ConfigOptionsView {if let Some(mut rx) = rx {while let Ok(()) = rx.recv().await {this.update_in(cx, |this, window, cx| {- this.refresh_selectors_if_needed(window, cx);+ this.rebuild_selectors(window, cx);cx.notify();}).log_err();@@ -184,15 +184,10 @@ impl ConfigOptionsView {.collect()}- fn refresh_selectors_if_needed(&mut self, window: &mut Window, cx: &mut Context<Self>) {- let current_ids = Self::config_option_ids(&self.config_options);- if current_ids != self.config_option_ids {- self.config_option_ids = current_ids;- self.rebuild_selectors(window, cx);- }- }-fn rebuild_selectors(&mut self, window: &mut Window, cx: &mut Context<Self>) {+ // Config option updates can mutate option values for existing IDs (for example,+ // reasoning levels after a model switch). Rebuild to refresh cached picker entries.+ self.config_option_ids = Self::config_option_ids(&self.config_options);self.selectors = Self::build_selectors(&self.config_options,&self.agent_server,