fix: catalog sync, validation, and models list#124
Conversation
Four related fixes for the catalog subsystem: 1. validateCatalog now skips models with unknown providers instead of failing fatally (upstream catalog has dirty data). 2. ListProviderModels uses the pre-built ProviderModels index instead of iterating Models with a key prefix, which doesn't work with the current catalog format where model keys use native provider names. 3. catalog sync now migrates the downloaded JSON to SQLite so that models list and other SQLite-backed commands can find it. 4. models list without --provider now shows all catalog providers that have models, instead of only showing configured routing providers (which have no models of their own). 5. Missing catalog is now a printed message instead of a fatal error.
Code Review Roast 🔥Verdict: No Issues Found | Recommendation: Merge Oh wait, this PR is actually clean. I need to sit down. I had my flamethrower warmed up and everything. 📊 Overall: Like finding a unicorn in production — I didn't think clean PRs existed anymore, but here we are. Files Reviewed (1 file)
Previous Review Summaries (4 snapshots, latest commit 3ae12c1)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 3ae12c1)Verdict: No Issues Found | Recommendation: Merge Oh wait, this PR is actually clean. I need to sit down. I had my flamethrower warmed up and everything. 📊 Overall: Like finding a unicorn in production — I didn't think clean PRs existed anymore, but here we are. Files Reviewed (1 file)
Previous review (commit c5455df)Verdict: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)
🏆 Best part: The previous compile-error ( 💀 Worst part: The if-body at lines 392–394 is now at the same indent level as the if-statement (4 tabs), when it should be at 5 tabs. The fix moved the header up but forgot the body. 📊 Overall: Like a mechanic who fixed the engine alignment but left the hood slightly ajar. The catalog fixes are genuinely good. Files Reviewed (1 file)
Fix these issues in Kilo Cloud Previous review (commit 4ab0308)Verdict: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)
🏆 Best part: The 💀 Worst part: After fixing the compile error, you left the indentation one tab short on the now-corrected lines. 📊 Overall: Like a mechanic who fixed the engine but left the hood slightly ajar. The catalog fixes are genuinely good — JSON→SQLite migration on sync and graceful unknown-provider handling are solid wins. Files Reviewed (5 files)
Fix these issues in Kilo Cloud Previous review (commit 5db0a19)Verdict: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)
🏆 Best part: The catalog migration logic actually solves a real pain point — syncing JSON but not migrating to SQLite was a user-facing disaster that this PR finally fixes. 💀 Worst part: 📊 Overall: Like a chef who perfectly seasons the steak but sets the kitchen on fire. The catalog fixes are solid; the broken Files Reviewed (5 files)
Reviewed by step-3.7-flash · Input: 32.4K · Output: 4.2K · Cached: 121.5K Review guidance: REVIEW.md from base branch |
The openGUI signature is func(string) error on all platforms; the cancel argument was a merge artifact from the GUI crash fix branch.
|
All issues addressed:
|
… logging - Add structured logging when catalog fails to load in models list command - Fix map iteration safety by collecting invalid model keys before deletion - Replace boolean flag with slice to track models pending removal from catalog - Add clarifying comment about package-level variable mutation in test - Prevent potential runtime errors from concurrent map modification
What
Four fixes for the catalog and
models listcommand:catalog syncnow migrates JSON to SQLite — previously it only downloaded the JSON file, somodels list(which reads from SQLite) would always show "catalog not found".validateCatalog()handles orphan models gracefully — the upstream catalog may contain models for providers not yet in the catalog. Instead of failing the entire sync, orphan models are now skipped with a warning. Currently 7 models are affected:deepreinforce/ornith-1.0-31bdeepreinforce/ornith-1.0-35bdeepreinforce/ornith-1.0-397bdeepreinforce/ornith-1.0-9bmeituan/longcat-2.0microsoft/mai-code-1-flashtencent/hy3-previewThese reference providers (
deepreinforce,meituan,microsoft,tencent) not yet present in the upstreamprovidersmap.ListProviderModels()uses the pre-built index — the new catalog format uses aProviderModelsmap built during load. Previously it fell through to astrings.HasPrefixscan that did not match the new key format, returning 0 models.models listwithout--providershows catalog providers — instead of returning routing intermediaries with no models, it now lists all catalog providers that have models.Testing
catalog syncthenmodels listshows all providers