From 90d7ccfd5d0db23b04e4cf48d1f049b211654f12 Mon Sep 17 00:00:00 2001 From: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> Date: Tue, 16 Dec 2025 09:46:08 -0300 Subject: [PATCH] agent_ui: Search models only by name (#44984) We were previously matching the search on both model name and provider ID. In most cases, this would yield an okay result, but if you search for "Opus", for example, you'd see the Sonnet models in the search result, which was very confusing. This was because we were matching to both provider ID and model name. "Sonnet" and "Opus" share the same provider ID, so they both contain "Anthropic" as a prefix. Then, "Opus" contains the letter P, as well as Anthropic, thus the match. Now, we're only matching by model name, which I think most of the time will yield more accurate results. Release Notes: - agent: Improved the model search quality in the model picker. --- crates/agent_ui/src/acp/model_selector.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/crates/agent_ui/src/acp/model_selector.rs b/crates/agent_ui/src/acp/model_selector.rs index f9710ad9b3aac29546dbe66a518a198d9b113385..959e0e72f38feadb39da38b7bbc3eed58dcd775e 100644 --- a/crates/agent_ui/src/acp/model_selector.rs +++ b/crates/agent_ui/src/acp/model_selector.rs @@ -403,9 +403,7 @@ async fn fuzzy_search( let candidates = model_list .iter() .enumerate() - .map(|(ix, model)| { - StringMatchCandidate::new(ix, &format!("{}/{}", model.id, model.name)) - }) + .map(|(ix, model)| StringMatchCandidate::new(ix, model.name.as_ref())) .collect::>(); let mut matches = match_strings( &candidates,