#8475: models: discover local Windsurf/Cursor/Antigravity models
gateway
cli
commands
agents
stale
size: L
Cluster:
Model Management Enhancements
Adds models discover CLI command that discovers local catalog models (Windsurf/Cursor/Antigravity) and can set them as agent fallbacks. Includes wiring and basic OpenRouter scan integration.
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR adds a new `models discover` CLI subcommand and corresponding command implementation. The CLI wiring in `src/cli/models-cli.ts` registers `models discover` with options to filter providers, output JSON, and optionally set discovered models as agent defaults/fallbacks. `src/commands/models.ts` re-exports the new command.
The core logic in `src/commands/models/discover.ts` loads the model catalog (`loadModelCatalog()`), filters entries to providers matching Windsurf/Cursor/Antigravity (or a user substring), prints the discovered model refs, and (with `--set-default`) writes discovered models into `agents.defaults.models` and `agents.defaults.model` config.
<h3>Confidence Score: 3/5</h3>
- This PR is reasonably safe to merge, but `models discover` currently has surprising side effects and config overwrite behavior that should be addressed.
- The change set is small and localized to the models CLI/commands, but the new discover command unconditionally invokes `modelsScanCommand` (which can print and mutate config) and `--set-default` rewrites fallbacks/primary in a way that may clobber user config. These are user-visible behavioral issues rather than compile-time problems.
- src/commands/models/discover.ts
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
**Context used:**
- Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8))
- Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13))
<!-- /greptile_comment -->
Most Similar PRs
#8546: Fix/config UI improvements
by RandomRaine · 2026-02-04
77.1%
#7020: feat: add search/filter to model selection in configure wizard
by GuoxiangZu · 2026-02-02
76.8%
#9583: fix(models): allow models in agents.defaults.models even if not in ...
by hotzen100 · 2026-02-05
76.1%
#9123: Feat/smart router backport and custom model provider
by JuliusYang3311 · 2026-02-04
76.1%
#11115: [AI-assisted] Add /model-set chat command with autocompletion and s...
by dorgonman · 2026-02-07
75.9%
#9739: #9291 fix(models): preserve existing models in models.json when mer...
by ximzzzzz · 2026-02-05
75.9%
#13376: fix: pass model directly to agent for sub-agent runs
by jrbobbyhansen-pixel · 2026-02-10
75.3%
#6440: feat(ui): add model picker dialog with provider filtering
by igorls · 2026-02-01
74.1%
#5945: fix: use configured model for slug generator (AI-assisted)
by HEDELKA · 2026-02-01
73.8%
#7770: feat(routing): Smart Router V2 - Configuration-driven model dispatc...
by zzjj7000 · 2026-02-03
73.6%