mirror of
https://github.com/zed-industries/zed.git
synced 2026-10-27 09:21:46 +00:00
# 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> |
||
|---|---|---|
| .. | ||
| danger | ||
| flatpak | ||
| lib | ||
| licenses | ||
| terms | ||
| update_top_ranking_issues | ||
| analyze_highlights.py | ||
| bench-agent-model-search | ||
| bootstrap | ||
| bootstrap.ps1 | ||
| build-docker | ||
| bump-extension-cli | ||
| bump-gpui-version | ||
| bump-nightly | ||
| bump-zed-version | ||
| bundle-freebsd | ||
| bundle-linux | ||
| bundle-mac | ||
| bundle-windows.ps1 | ||
| cargo | ||
| cargo-timing-info.js | ||
| check-keymaps | ||
| check-licenses | ||
| check-links | ||
| check-todos | ||
| cherry-pick | ||
| clear-target-dir-if-larger-than | ||
| clear-target-dir-if-larger-than.ps1 | ||
| clippy | ||
| clippy.ps1 | ||
| collab-flamegraph | ||
| community-pr-track-mapping.json | ||
| crate-dep-graph | ||
| create-draft-release | ||
| debug-cli | ||
| deploy-collab | ||
| determine-release-channel | ||
| determine-release-channel.ps1 | ||
| digital-ocean-db.sh | ||
| docs-strip-preview-callouts | ||
| docs-suggest | ||
| docs-suggest-publish | ||
| download-wasi-sdk | ||
| draft-release-notes | ||
| drop-test-dbs | ||
| exit-ci-if-dev-drive-is-full.ps1 | ||
| freebsd | ||
| generate-action-metadata | ||
| generate-licenses | ||
| generate-licenses-csv | ||
| generate-licenses.ps1 | ||
| generate-merge-conflict-benchmark | ||
| generate-terms-rtf | ||
| get-crate-version | ||
| get-crate-version.ps1 | ||
| get-pull-requests-since | ||
| get-release-notes-since | ||
| get-released-version | ||
| github-assign-contributor-issue.py | ||
| github-check-new-issue-for-duplicates.py | ||
| github-clean-issue-types.py | ||
| github-community-pr-board.py | ||
| github-find-top-duplicated-bugs.py | ||
| github-guild-board.py | ||
| github-pr-cleanup.py | ||
| github-pr-status | ||
| github-track-duplicate-bot-effectiveness.py | ||
| github-triage-queue-board.py | ||
| github-welcome-first-contribution.py | ||
| github_helpers.py | ||
| histogram | ||
| import-themes | ||
| install-cmake | ||
| install-linux | ||
| install-rustup.ps1 | ||
| install.sh | ||
| kube-shell | ||
| linux | ||
| metal-debug | ||
| mitm-proxy.sh | ||
| new-crate | ||
| prettier | ||
| prompts | ||
| randomized-test-ci | ||
| randomized-test-minimize | ||
| remote-server | ||
| reset_db | ||
| run-background-agent-mvp-local | ||
| run-local-minio | ||
| run-unit-evals | ||
| seed-db | ||
| select-sentry-crash-candidates | ||
| sentry-fetch | ||
| setup-dev-driver.ps1 | ||
| setup-sccache | ||
| setup-sccache.ps1 | ||
| shellcheck-scripts | ||
| snap-build | ||
| snap-try | ||
| squawk | ||
| test-docs-suggest-batch | ||
| test-wsl-sandbox.ps1 | ||
| triage_watcher.jl | ||
| trigger-docs-build | ||
| trigger-release | ||
| uninstall.sh | ||
| update-json-schemas | ||
| upload-extension-cli | ||
| upload-nightly | ||
| upload-nightly.ps1 | ||
| verify-macos-document-icon | ||
| what-is-deployed | ||
| zed-local | ||