diff --git a/internal/catalog/catalog.go b/internal/catalog/catalog.go index 78e277858..56ebad02d 100644 --- a/internal/catalog/catalog.go +++ b/internal/catalog/catalog.go @@ -655,6 +655,9 @@ func loadGen() (map[string]mdProvider, int) { // deepinfra/…, xiaomi/…) votes its levels once, not // once a host. vote := func(who, own, by string, x mdModel) { + if routerIDs[who] { + return + } spelt[who]++ if x.Name != "" && x.Name != own && x.Name != who { if named[who] == nil { @@ -1922,6 +1925,17 @@ func mostGiven(by map[int]int) int { return best } +// routerIDs are ids that name a vendor's router, not a model: OpenRouter's +// openrouter/auto, model-oracle-ai's auto, Kilo's kilo-auto/free and the +// rest are each their own, and a plugin's "auto" (豆包工作 picks Doubao's +// model) is none of them. Without a path they were taken for one model, +// and every provider's "auto" was given that model's levels, images and +// window: pi offered thinking levels and image input for 豆包工作's auto. +// What a provider's own list says of its router (ListedBy) still holds. +// Only ids no vendor gives a model are here: "fast" and "balanced" are +// trustedrouter's and Kilo's routers, but a vendor may name a model so. +var routerIDs = map[string]bool{"auto": true, "default": true, "free": true} + // bareID is a model's id without the vendor's prefix, lowercase. func bareID(id string) string { id = strings.ToLower(id) diff --git a/internal/catalog/renamed_test.go b/internal/catalog/renamed_test.go index 0d602096f..fa6b36d15 100644 --- a/internal/catalog/renamed_test.go +++ b/internal/catalog/renamed_test.go @@ -304,8 +304,13 @@ func TestRenameNeverTakesAModelForAnother(t *testing.T) { if ContextOf("openai/gpt-5.5") != 400000 || OutputOf("gpt-5.5") != 128000 || !SeesImages("gpt-5.5") { t.Error("gpt-5.5 changed") } - if got := EffortsOf("auto"); !slices.Contains(got, "xhigh") { - t.Errorf("EffortsOf(auto) = %v", got) + // a router's id is no one model: another vendor's "auto" takes none of + // model-oracle-ai's, whose own list still has its levels + if e, c, i := EffortsOf("auto"), ContextOf("auto"), SeesImages("auto"); e != nil || c != 0 || i || Thinks("auto") { + t.Errorf("auto took a router's: efforts %v, context %d, images %v", e, c, i) + } + if got, _ := ListedBy([]string{"model-oracle-ai"}, "auto"); !slices.Contains(got, "xhigh") { + t.Errorf("ListedBy(model-oracle-ai, auto) = %v", got) } if got := strings.Join(EffortsOf("opus-5"), ","); got != "minimal" { t.Errorf("EffortsOf(opus-5) = %q", got)