feat(models): 'ox alpha' now finds x-preview-f-free in every model picker

The OpenCode Zen wire slug for the Ox Alpha stealth model is opaque
(x-preview-f-free); users searching the picker for 'ox' or 'ox-alpha'
found nothing. Adds the search alias across all four synced alias
tables (CLI, desktop, web, TUI) plus tests. Wire id is unchanged and
still what renders and gets sent to the provider, matching the k3 →
kimi-k3 precedent. No canonical-dedup collision with opencode-go's
keyed ox-alpha-free slug.
This commit is contained in:
Teknium
2026-08-21 13:20:37 -07:00
parent 76f6ba3706
commit 1bf8bd2c7d
6 changed files with 41 additions and 2 deletions

View File

@@ -9,7 +9,10 @@
* web/src/lib/model-search-text.ts, and hermes_cli/model_search.py.
*/
const MODEL_SEARCH_ALIASES: Record<string, readonly string[]> = {
k3: ['kimi-k3', 'kimi']
k3: ['kimi-k3', 'kimi'],
// OpenCode Zen serves the "Ox Alpha" stealth model under an opaque
// preview slug; let users find it by its public codename.
'x-preview-f-free': ['ox-alpha', 'ox']
}
/** Haystack for fuzzy/substring model search; never changes the wire id. */

View File

@@ -13,6 +13,9 @@ from __future__ import annotations
# Lowercased wire id → extra tokens appended to the search haystack only.
_MODEL_SEARCH_ALIASES: dict[str, tuple[str, ...]] = {
"k3": ("kimi-k3", "kimi"),
# OpenCode Zen serves the "Ox Alpha" stealth model under an opaque
# preview slug; let users find it by its public codename.
"x-preview-f-free": ("ox-alpha", "ox"),
}
# Lowercased wire id → canonical public slug it aliases. Used by picker

View File

@@ -16,3 +16,17 @@ def test_filter_indices_surfaces_k3_for_kimi_query():
assert "k3" in ranked
def test_model_search_text_adds_ox_alpha_aliases():
assert model_search_text("x-preview-f-free") == "x-preview-f-free ox-alpha ox"
assert model_search_text("X-Preview-F-Free") == "X-Preview-F-Free ox-alpha ox"
def test_filter_indices_surfaces_ox_alpha_preview_slug():
models = ["x-preview-f-free", "gpt-5.6-sol", "kimi-k3"]
haystacks = [model_search_text(m) for m in models]
for query in ("ox", "ox-alpha"):
ranked = [models[i] for i in _filter_indices(haystacks, query)]
assert "x-preview-f-free" in ranked, query

View File

@@ -13,6 +13,11 @@ describe('modelSearchText', () => {
expect(modelSearchText('k3')).toBe('k3 kimi-k3 kimi')
expect(modelSearchText('K3')).toBe('K3 kimi-k3 kimi')
})
it('adds ox-alpha aliases for the Ox Alpha preview wire id', () => {
expect(modelSearchText('x-preview-f-free')).toBe('x-preview-f-free ox-alpha ox')
expect(modelSearchText('X-Preview-F-Free')).toBe('X-Preview-F-Free ox-alpha ox')
})
})
describe('model picker search with aliases', () => {
@@ -32,4 +37,12 @@ describe('model picker search with aliases', () => {
const ranked = fuzzyRank(models, 'glm', modelSearchText).map(r => r.item)
expect(ranked).toEqual([])
})
it('surfaces the Ox Alpha preview slug when the user searches ox', () => {
const zenModels = ['x-preview-f-free', 'gpt-5.6-sol', 'kimi-k3']
const ranked = fuzzyRank(zenModels, 'ox', modelSearchText).map(r => r.item)
expect(ranked).toContain('x-preview-f-free')
const rankedFull = fuzzyRank(zenModels, 'ox-alpha', modelSearchText).map(r => r.item)
expect(rankedFull).toContain('x-preview-f-free')
})
})

View File

@@ -9,7 +9,10 @@
* hermes_cli/model_search.py.
*/
const MODEL_SEARCH_ALIASES: Record<string, readonly string[]> = {
k3: ['kimi-k3', 'kimi']
k3: ['kimi-k3', 'kimi'],
// OpenCode Zen serves the "Ox Alpha" stealth model under an opaque
// preview slug; let users find it by its public codename.
'x-preview-f-free': ['ox-alpha', 'ox']
}
/** Haystack for fuzzy/substring model search; never changes the wire id. */

View File

@@ -10,6 +10,9 @@
*/
const MODEL_SEARCH_ALIASES: Record<string, readonly string[]> = {
k3: ["kimi-k3", "kimi"],
// OpenCode Zen serves the "Ox Alpha" stealth model under an opaque
// preview slug; let users find it by its public codename.
"x-preview-f-free": ["ox-alpha", "ox"],
};
/** Haystack for fuzzy/substring model search; never changes the wire id. */