Repository navigation
Commit a81275f
committed
fix(catalog): match selectedModels the way the canonical resolver matches it
`filterCatalogVisibleModels` built the per-provider allowlist as a plain
`Set(selectedModels)` and tested it with `allow.has(m.id)` — the native model id,
exactly. The canonical resolution of the same list keys it through the slug
equivalence:
sync.ts:819-821 new Set([...models].map(m => slugEquivalenceKey(routedSlug(provider, m))))
sync.ts:1039 selected === undefined || selected.has(slugEquivalenceKey(slug))
so the two disagree for any provider whose native ids contain a slash:
stored "moonshotai/kimi-k3-free" sync accepts=true catalog filter accepts=true
stored "moonshotai-kimi-k3-free" sync accepts=true catalog filter accepts=false
The second is the Codex-facing slug `routedSlug()` produces and the picker
displays, and `ocx models remove` already accepts it (tests/cli-models.test.ts:332,
"models remove accepts raw and encoded slash selectors"). An allowlist written
from what the user sees therefore blanked the provider's catalog silently, while
`routeModel` decoded the same string back and served the model happily.
Affects providers with slash-bearing native ids: openrouter, zenmux, nvidia,
together, fireworks.
The `disabledModels` loop three lines above is already tolerant of both forms via
`slugEquals`, and slug-codec.ts:20-21 states the rule this restores: "Config
comparisons are tolerant … so legacy raw values keep working regardless of which
form was stored."1 parent c44e43f commit a81275f
2 files changed
Lines changed: 48 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
1560 | 1560 | | |
1561 | 1561 | | |
1562 | 1562 | | |
1563 | | - | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
| 1569 | + | |
1564 | 1570 | | |
1565 | 1571 | | |
1566 | 1572 | | |
| |||
1572 | 1578 | | |
1573 | 1579 | | |
1574 | 1580 | | |
1575 | | - | |
| 1581 | + | |
1576 | 1582 | | |
1577 | 1583 | | |
1578 | 1584 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
0 commit comments