Skip to content

fix: catalog sync, validation, and models list#124

Open
stefanoverna wants to merge 1 commit into
routatic:mainfrom
stefanoverna:fix/catalog-sync-and-models-list
Open

fix: catalog sync, validation, and models list#124
stefanoverna wants to merge 1 commit into
routatic:mainfrom
stefanoverna:fix/catalog-sync-and-models-list

Conversation

@stefanoverna

@stefanoverna stefanoverna commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

What

Four fixes for the catalog and models list command:

  1. catalog sync now migrates JSON to SQLite — previously it only downloaded the JSON file, so models list (which reads from SQLite) would always show "catalog not found".

  2. 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-31b
    • deepreinforce/ornith-1.0-35b
    • deepreinforce/ornith-1.0-397b
    • deepreinforce/ornith-1.0-9b
    • meituan/longcat-2.0
    • microsoft/mai-code-1-flash
    • tencent/hy3-preview

    These reference providers (deepreinforce, meituan, microsoft, tencent) not yet present in the upstream providers map.

  3. ListProviderModels() uses the pre-built index — the new catalog format uses a ProviderModels map built during load. Previously it fell through to a strings.HasPrefix scan that did not match the new key format, returning 0 models.

  4. models list without --provider shows catalog providers — instead of returning routing intermediaries with no models, it now lists all catalog providers that have models.

Testing

  • All 72 catalog tests pass
  • All 32 main command tests pass (31 existing + 1 updated)
  • Manually verified: catalog sync then models list shows all providers

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.
fmt.Println("\nPress Ctrl+C to stop.")
}
// Open GUI (macOS: native webview, Linux/Windows: print URL)
if err := openGUI(guiURL, cancel); err != nil {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 The Roast: You changed the call to openGUI(guiURL, cancel) with two arguments, but all three platform-specific implementations (start_gui_darwin.go:12, start_gui_darwin_nocgo.go:9, start_gui_other.go:9) still have the signature func openGUI(guiURL string) error. This PR won't compile on any platform — not even the macOS one with the fancy native webview. That's like sending your kids to school without pants and calling it a fashion statement.

🩹 The Fix: Revert the call back to openGUI(guiURL) on this line, since none of the openGUI implementations were updated to accept cancel. Or, if you actually meant to plumb cancel through, update all three start_gui_* files to match.

Suggested change
if err := openGUI(guiURL, cancel); err != nil {
if err := openGUI(guiURL); err != nil {

📏 Severity: critical


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@kilo-code-bot

kilo-code-bot Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Code Review Roast 🔥

Verdict: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
🚨 critical 1
⚠️ warning 0
💡 suggestion 0
🤏 nitpick 0
Issue Details (click to expand)
File Line Roast
cmd/routatic-proxy/main.go 391 openGUI is called with 2 args but all platform implementations still take 1 — guaranteed compile failure

🏆 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: openGUI(guiURL, cancel) in main.go:391 — you changed the call signature but forgot to update any of the three platform-specific implementations. This PR won't compile on Linux, macOS with CGO, or macOS without CGO. You broke the build everywhere.

📊 Overall: Like a chef who perfectly seasons the steak but sets the kitchen on fire. The catalog fixes are solid; the broken openGUI call should have been caught by any go build before pushing.

Files Reviewed (5 files)
  • cmd/routatic-proxy/catalog.go - 1 issue
  • cmd/routatic-proxy/main.go - 1 issue
  • cmd/routatic-proxy/main_models_test.go
  • internal/catalog/load.go
  • internal/catalog/resolve.go

Fix these issues in Kilo Cloud


Reviewed by step-3.7-flash · Input: 157.8K · Output: 15.4K · Cached: 1.6M

Review guidance: REVIEW.md from base branch main (truncated)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant