Skip to content

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

Merged
samueltuyizere merged 6 commits into
routatic:mainfrom
stefanoverna:fix/catalog-sync-and-models-list
Jul 23, 2026
Merged

fix: catalog sync, validation, and models list#124
samueltuyizere merged 6 commits 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.
Comment thread cmd/routatic-proxy/main.go Outdated
@kilo-code-bot

kilo-code-bot Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

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)
  • cmd/routatic-proxy/main.go
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)
  • cmd/routatic-proxy/main.go

Previous review (commit c5455df)

Verdict: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
🚨 critical 0
⚠️ warning 0
💡 suggestion 1
🤏 nitpick 0
Issue Details (click to expand)
File Line Roast
cmd/routatic-proxy/main.go 392 if-body at lines 392–394 still at 4 tabs after the if-statement was bumped to 4 tabs — gofmt violation introduced by partial fix

🏆 Best part: The previous compile-error (openGUI 2-arg call) and the gofmt indentation on lines 390–391 are properly fixed this time. You didn't half-ass it — well, almost.

💀 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. gofmt would catch this on the first pass.

📊 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)
  • cmd/routatic-proxy/main.go - 1 issue

Fix these issues in Kilo Cloud

Previous review (commit 4ab0308)

Verdict: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
🤏 nitpick 1
🚨 critical 0
⚠️ warning 0
💡 suggestion 0
Issue Details (click to expand)
File Line Roast
cmd/routatic-proxy/main.go 389 // Open GUI comment and if err := openGUI(guiURL) block indented at 3 tabs inside a 4-tab scope — gofmt violation left by the fix commit

🏆 Best part: The openGUI(guiURL, cancel) compile-error from the previous review is properly dead — you fixed it in a second patch instead of arguing about it. Unusual for a reviewer, but I'll take it.

💀 Worst part: After fixing the compile error, you left the indentation one tab short on the now-corrected lines. gofmt would yell about this — it reads like the same short-attention-span merge conflict that introduced the 2-arg bug in the first place.

📊 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)
  • cmd/routatic-proxy/catalog.go - 0 issues
  • cmd/routatic-proxy/main.go - 1 issue (gofmt indentation at lines 389–390)
  • cmd/routatic-proxy/main_models_test.go - 0 issues
  • internal/catalog/load.go - 0 issues
  • internal/catalog/resolve.go - 0 issues

Fix these issues in Kilo Cloud

Previous review (commit 5db0a19)

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: 32.4K · Output: 4.2K · Cached: 121.5K

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

The openGUI signature is func(string) error on all platforms; the cancel
argument was a merge artifact from the GUI crash fix branch.
@stefanoverna

Copy link
Copy Markdown
Contributor Author

All issues addressed:

  1. openGUI(guiURL, cancel) → fixed: removed the stray cancel argument. The catalog branch no longer touches openGUI at all — the signature change belonged to a different PR. Build and all 32 tests pass.

Comment thread cmd/routatic-proxy/main.go
Comment thread cmd/routatic-proxy/main.go Outdated
stefanoverna and others added 3 commits July 23, 2026 11:20
… 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
@samueltuyizere
samueltuyizere merged commit b2dd52f into routatic:main Jul 23, 2026
3 checks passed
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.

2 participants