fix: provide auto fallback when Kiro catalog is missing - #3
Conversation
|
Hi @Dipak-Chauhan, thanks for this PR! While the problem you're addressing is real, it's temporary and after some thought I've decided not to add a plugin-side fallback. The way I designed the model fetching deliberately keeps a single metadata authority: models.dev owns model registration and metadata, the SDK provides runtime availability and reasoning efforts, and the plugin only intersects the two. Once the models.dev PR that adds the Kiro catalogue lands (which should be soon), this would become stale code that has to be kept in sync with models.dev in case the auto model changes. The way model loading works in opencode right now, config injected by the plugin shadows the matching catalog fields (the ??= guard only protects against user config, not the catalog), so any future change to auto's metadata on models.dev would be silently masked. |
Summary
kiro/autofallbackProblem
The live models.dev catalog currently has no
kiroentry. With a stored Kiro credential, the existing config hook inserts an empty provider only as a crash guard. OpenCode later removes that provider because it has no models, soopencode models kirofails withProvider not found: kiro.This also creates a dependency cycle with the pending models.dev restoration: anomalyco/models.dev#2559
Validation
npm run typechecknpm run buildnpm test -- --run(64 tests passed)OPENCODE_MODELS_PATHunset and this checkout loaded by path:opencode models kirolistedkiro/autoopencode run -m kiro/autocompleted through Kiro ACPThe fallback intentionally includes only
auto; models.dev remains the source of truth for the complete and fast-changing Kiro model lineup.