zed/script
Jacob Wolf 065d7ae597
agent_ui: Improve model and configuration option search (#64147)
# Objective
Fixes #64144. 

Improve search in agent model and configuration option pickers.

Previously, searches could fail when punctuation differed between the
query and model name, such as `GPT 5.6` versus `GPT-5.6`. Configuration
options also could not be found by provider/group, description, or value
identifier, and results were limited to 100 entries.

## Solution

Use the existing `fuzzy_nucleo` matcher for agent model and
configuration option searches.

Include relevant metadata in each search candidate:

- Model name and provider/group
- Configuration option name, group, description, and value identifier

Return all matching configuration options while preserving their
existing ordering when scores are equal.

Rank matches against option/model names independently of their metadata,
then append metadata-only matches without duplicates. This keeps
descriptions and identifiers searchable without letting their lengths
demote exact name matches or reorder equally relevant names.

Run the shared pure-data search pipeline on the background executor,
including candidate construction, ranking, and result cloning. This
prevents large catalogs and descriptions from monopolizing foreground
task polls without changing the ranking rule.

## Testing

- Added and ran automated tests with the following:
	- Searches with punctuation differences, such as `GPT 5.6`
	- Searches by provider/group
- Searches across configuration option names, descriptions, groups, and
identifiers
	- Searches returning more than 100 configuration options
	- Existing fuzzy-match ordering behavior
- Exact option-name matches ahead of partial-name and metadata-only
matches
	- Stable name ordering despite different metadata lengths
	- Combined queries spanning names and metadata

Follow-up validation on the ranking fix:

- `cargo test -p agent_ui --lib`: all 521 tests passed. Both new
configuration-option ranking regression tests failed before the fix and
passed afterward.
- `./script/clippy -p agent_ui`: passed, including the available
cargo-shear and typo checks.
- `rustfmt --check --edition 2024 crates/agent_ui/src/config_options.rs
crates/agent_ui/src/model_selector.rs`: passed.
- `git diff --check`: passed.

Additionally compiled the app with `cargo run`, launched OpenCode agent
in ACP mode, and searched `GPT 5.6`, which produces `OpenAI/GPT-5.6 Sol`
and `OpenRouter/GPT-5.6 Sol`. See video below.

## Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

## Background-search validation

- `cargo test -p agent_ui --lib`: all 522 tests passed. The new
background-preparation test failed on the foreground implementation and
now passes across 20 scheduler seeds.
- `./script/clippy -p agent_ui -p agent_ui_benchmarks`: passed,
including cargo-shear and typo checks.
- `cargo fmt -p agent_ui -p agent_ui_benchmarks --check`, `git diff
--check`, and `./script/check-licenses`: passed.
- `./script/bench-agent-model-search --test`: all 20 workloads passed
before and after the change. The runner rejects any `test-support`
feature in the benchmark package graph.
- Ran quick mode before measured runs. Recorded `--save-baseline
foreground-preparation` on `b6157587dbfe96`, then ran the identical
benchmark with `--baseline foreground-preparation` on `4617d47567401e`.

Apple Silicon, Rust 1.98.1, `release-fast`, 15 Criterion samples, 200 ms
warm-up, 500 ms measurement. Representative broad-query results:

| Synthetic catalog | Total completion before → after | Foreground
task-poll p95 before → after |
| --- | --- | --- |
| 10,000 options, 128-byte descriptions | 10.35 → 12.49 ms | 7.36 → 0.46
ms |
| 10,000 options, 1,024-byte descriptions | 42.16 → 43.95 ms | 30.26 →
0.66 ms |

For the larger-description workload, foreground p99/max fell from
33.10/33.10 ms to 1.35/1.35 ms. Median foreground instructions fell from
879.9 million to 11.8 million, while total instructions stayed
approximately 2.14 billion. Observed synthetic 120 FPS budget overruns
fell from 66 to zero for this workload.

This improves foreground responsiveness rather than reducing total work.
Other Rust builds were active on the machine, so completion-time
estimates are noisy and no throughput speedup is claimed. The benchmark
measures the production search module with synthetic ACP-like options,
not provider requests, picker rendering, or live keystrokes. Its
foreground report includes warm-up/calibration, and budget overruns are
not literal display-dropped frames.

## Showcase


https://github.com/user-attachments/assets/04c1a59e-8454-49f8-af6c-47e1107f9416

---

Release Notes:

- Improved fuzzy searching for agent model and configuration option
pickers across Zed Agent and third-party ACP-compatible agents,
preserving name relevance and keeping search preparation off the UI
thread.

---------

Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
2026-10-20 13:06:38 +00:00
..
danger Require release notes to be present (#64238) 2026-09-15 13:38:45 +00:00
flatpak Add (flatpak) and (snap) suffixes to Zed version in system info (#32903) 2025-06-17 20:39:35 +00:00
lib Require release notes to be present (#64238) 2026-09-15 13:38:45 +00:00
licenses cloud_api_client: Implement Wasm support (#61328) 2026-07-21 13:20:31 +00:00
terms legal: Use absolute URLs for Terms of Service and Privacy Policy links (#62684) 2026-08-17 09:35:54 +00:00
update_top_ranking_issues Update dependency urllib3 to v2.8.0 [SECURITY] (#64995) 2026-10-02 07:57:16 +00:00
analyze_highlights.py Use a proper name for highlights.scm (#43412) 2025-11-24 16:15:38 +00:00
bench-agent-model-search agent_ui: Improve model and configuration option search (#64147) 2026-10-20 13:06:38 +00:00
bootstrap collab: Add automatic install of minio deb or rpm to script/bootstrap (#32968) 2025-06-18 19:07:57 +00:00
bootstrap.ps1 windows: Make collab run on Windows (#23117) 2025-01-17 09:39:13 +02:00
build-docker
bump-extension-cli Enforce adding a message to extension CLI bumps (#58786) 2026-06-10 23:51:59 +00:00
bump-gpui-version gpui: Update dependency package names (#40143) 2025-10-14 04:43:28 +00:00
bump-nightly ci: Build nightly more frequently (#53800) 2026-05-15 09:08:55 +00:00
bump-zed-version ci: Add workflow for bumping Zed versions (#54485) 2026-04-23 00:56:18 +02:00
bundle-freebsd linux: Make desktop file executable (#35597) 2025-08-04 15:35:19 -04:00
bundle-linux Fix incorrect LLD used when bundling (#65183) 2026-10-05 15:03:19 +00:00
bundle-mac Reduce release binary sizes (#65168) 2026-10-07 14:56:09 +00:00
bundle-windows.ps1 Keep the grid top-anchored when growing on Windows (#63699) 2026-09-22 12:38:36 +00:00
cargo Better cargo wrapper (#49946) 2026-02-24 05:13:04 +00:00
cargo-timing-info.js Add a cargo wrapper to report build times (#49632) 2026-02-23 09:46:28 -07:00
check-keymaps Remove more storybook leftovers (#60337) 2026-07-03 08:27:48 +00:00
check-licenses Relicense Zed source code under GPL (#57948) 2026-05-28 20:19:17 +00:00
check-links Move some configuration files out of the repository root (#64303) 2026-09-16 14:08:49 +00:00
check-todos Add CI check that cmd- is not in linux keymaps + check other mods (#32334) 2025-06-08 09:34:07 +00:00
cherry-pick Remove cherry-pick-bot config (#59703) 2026-06-22 13:00:51 +00:00
clear-target-dir-if-larger-than ci: Clean workspace members more eagerly (#53427) 2026-04-09 00:21:02 +02:00
clear-target-dir-if-larger-than.ps1 ci: Clean workspace members more eagerly (#53427) 2026-04-09 00:21:02 +02:00
clippy Move some configuration files out of the repository root (#64303) 2026-09-16 14:08:49 +00:00
clippy.ps1 Windows tests on self-hosted runners (#29764) 2025-06-16 17:29:36 -04:00
collab-flamegraph Fix nix build (#26270) 2025-03-10 01:06:11 -07:00
community-pr-track-mapping.json Fix Auth and Zed.dev community PR routing (#64650) 2026-09-23 14:15:20 +00:00
crate-dep-graph Fix nix build (#26270) 2025-03-10 01:06:11 -07:00
create-draft-release Avoid re-creating releases when re-running workflows (#42573) 2025-11-12 21:50:15 -07:00
debug-cli cli: Allow opening non-existent paths (#43250) 2025-11-24 11:30:19 +02:00
deploy-collab Fix nix build (#26270) 2025-03-10 01:06:11 -07:00
determine-release-channel
determine-release-channel.ps1 windows: Publish nightly (#24800) 2025-07-09 08:57:03 +08:00
digital-ocean-db.sh Add a script to connect to the database. (#32023) 2025-06-04 09:23:23 -06:00
docs-strip-preview-callouts Fix and improve docs automation scripts (#50120) 2026-02-25 19:02:37 -06:00
docs-suggest Improve agent pull request hygiene (#49469) 2026-02-18 08:46:47 -06:00
docs-suggest-publish git_graph: Remove feature flag (#52972) 2026-04-02 15:26:37 +00:00
download-wasi-sdk extension: Bump wasi-sdk to version 34 (#63816) 2026-09-09 15:16:15 +00:00
draft-release-notes Add initial support for having GPUI release notes (#64203) 2026-09-15 12:43:19 +00:00
drop-test-dbs Fix nix build (#26270) 2025-03-10 01:06:11 -07:00
exit-ci-if-dev-drive-is-full.ps1 windows: Fix tests on Windows (#22616) 2025-02-05 14:30:09 +00:00
freebsd Fix capitalization of libX11 in FreeBSD dependencies (#48159) 2026-02-02 23:55:03 +01:00
generate-action-metadata Remove zed dependency from docs_preprocessor (#45130) 2025-12-18 21:59:05 -05:00
generate-licenses Pin cargo-about to 0.8.2 (#44012) 2025-12-02 17:54:08 +00:00
generate-licenses-csv Pin cargo-about to 0.8.2 (#44012) 2025-12-02 17:54:08 +00:00
generate-licenses.ps1 Fail windows bundle when cargo about fails (#48056) 2026-01-30 19:55:29 -07:00
generate-merge-conflict-benchmark git_ui: Batch merge conflict anchor resolution (#63394) 2026-08-31 15:07:24 +00:00
generate-terms-rtf Fix invalid Unicode in terms & conditions (#42906) 2025-11-19 13:00:35 -05:00
get-crate-version Fix nix build (#26270) 2025-03-10 01:06:11 -07:00
get-crate-version.ps1 windows: Publish nightly (#24800) 2025-07-09 08:57:03 +08:00
get-pull-requests-since
get-release-notes-since
get-released-version Use cloud.zed.dev for install.sh (#42399) 2025-11-10 23:55:19 +00:00
github-assign-contributor-issue.py Add a broken POC for guild auto-assignment (#55205) 2026-04-29 13:59:31 +00:00
github-check-new-issue-for-duplicates.py Consolidate GitHub helpers for community scripts (#63198) 2026-09-04 11:40:05 +00:00
github-clean-issue-types.py Add a one-off cleanup script for GH issue types (#42515) 2025-11-12 11:40:31 +01:00
github-community-pr-board.py Handle reopened PRs on the community PR board (#63755) 2026-09-04 12:47:05 +00:00
github-find-top-duplicated-bugs.py Post comments on duplicate bug reports (#49482) 2026-02-18 17:15:15 +00:00
github-guild-board.py Consolidate GitHub helpers for community scripts (#63198) 2026-09-04 11:40:05 +00:00
github-pr-cleanup.py Automate cleanup of unsigned and stale draft pull requests (#62936) 2026-08-21 07:53:28 +00:00
github-pr-status A script to help with PR naggery (#32025) 2025-06-04 09:23:14 -06:00
github-track-duplicate-bot-effectiveness.py Duplicate Bot tracking: handle issues deleted mid-run (#65222) 2026-10-06 09:03:03 +00:00
github-triage-queue-board.py Consolidate GitHub helpers for community scripts (#63198) 2026-09-04 11:40:05 +00:00
github-welcome-first-contribution.py Post a comment on first-timers' pull requests (#65390) 2026-10-12 10:58:42 +00:00
github_helpers.py Community board automations: ignore case for Track (#65224) 2026-10-06 09:03:01 +00:00
histogram
import-themes Fix nix build (#26270) 2025-03-10 01:06:11 -07:00
install-cmake
install-linux Fix install linux (#43205) 2025-11-21 09:12:19 -07:00
install-rustup.ps1 Windows tests on self-hosted runners (#29764) 2025-06-16 17:29:36 -04:00
install.sh Stop bundling GLib in Linux release archives (#61593) 2026-08-20 10:20:14 +00:00
kube-shell Fix nix build (#26270) 2025-03-10 01:06:11 -07:00
linux Add llvm to Arch dependencies in script/linux (#65462) 2026-10-13 23:07:07 +00:00
metal-debug Fix nix build (#26270) 2025-03-10 01:06:11 -07:00
mitm-proxy.sh Improve script/mitm-proxy.sh to support podman (#25834) 2025-02-28 22:37:03 +00:00
new-crate Relicense Zed source code under GPL (#57948) 2026-05-28 20:19:17 +00:00
prettier Improve autofix (#44930) 2025-12-15 22:19:18 -07:00
prompts Fix nix build (#26270) 2025-03-10 01:06:11 -07:00
randomized-test-ci
randomized-test-minimize
remote-server
reset_db Fix reset_db script (#29067) 2025-04-18 19:28:14 +00:00
run-background-agent-mvp-local Update AI docs for retired hosted models (#49486) 2026-02-18 10:36:38 -06:00
run-local-minio collab: Add automatic install of minio deb or rpm to script/bootstrap (#32968) 2025-06-18 19:07:57 +00:00
run-unit-evals Fetch the unit eval commit before checking it out (#42636) 2025-11-13 15:21:53 +00:00
seed-db Fix nix build (#26270) 2025-03-10 01:06:11 -07:00
select-sentry-crash-candidates background-agent: Scaffold week-one crash MVP pipeline (#49299) 2026-02-16 20:32:51 -06:00
sentry-fetch Add prompts and scripts for automatic crash repro and fix (#49063) 2026-02-12 12:42:41 -08:00
setup-dev-driver.ps1 windows: Use dev drive instead of ReFS (#25858) 2025-03-01 22:43:10 +08:00
setup-sccache Improve sccache cache reuse (#60968) 2026-07-15 20:35:16 +00:00
setup-sccache.ps1 Improve sccache cache reuse (#60968) 2026-07-15 20:35:16 +00:00
shellcheck-scripts
snap-build Add scripts and configuration for building snap package (#25064) 2025-02-19 10:28:23 -07:00
snap-try Add scripts and configuration for building snap package (#25064) 2025-02-19 10:28:23 -07:00
squawk ACP debug tools pane (#36768) 2025-08-22 19:32:49 +00:00
test-docs-suggest-batch Add documentation suggestion automation (#49194) 2026-02-18 06:39:09 -06:00
test-wsl-sandbox.ps1 Add Windows terminal sandboxing via WSL (#58971) 2026-06-17 21:07:29 +00:00
triage_watcher.jl Add script/triage_watcher.jl (#45384) 2025-12-19 18:09:40 +00:00
trigger-docs-build script: Trigger docs release (#56953) 2026-05-18 15:35:35 +00:00
trigger-release Fix nix build (#26270) 2025-03-10 01:06:11 -07:00
uninstall.sh
update-json-schemas Update bundled JSON schemas (2026-04-29) (#58948) 2026-06-25 17:30:12 +00:00
upload-extension-cli
upload-nightly Add more harness to the CI scripts (#53816) 2026-04-13 22:28:20 +03:00
upload-nightly.ps1 Add SSH remote server for Windows (#47460) 2026-01-24 13:15:01 -05:00
verify-macos-document-icon macOS: Bundle placeholder Document.icns so Finder can display Zed file icons (#44833) 2025-12-17 16:42:31 -06:00
what-is-deployed Fix nix build (#26270) 2025-03-10 01:06:11 -07:00
zed-local Fix script/zed-local on Windows (#38832) 2025-09-25 09:03:27 -04:00