← Back to PRs

#8475: models: discover local Windsurf/Cursor/Antigravity models

by gitSITTI open 2026-02-04 02:45 View on GitHub →
gateway cli commands agents stale size: L
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