mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-28 06:21:33 +00:00
fix(tui): disambiguate /model picker rows when provider display names collide
If the gateway returns two providers that resolve to the same display name (e.g. `kimi-coding` and `kimi-coding-cn` both → "Kimi For Coding"), the picker now appends the slug so users can tell them apart, in both the provider list and the selected-provider header. No-op when names are already unique. Refs #10526 — the Python backend dedupe from #10599 skips one alias, but user-defined providers, canonical overlays, and future regressions can still surface as indistinguishable rows in the picker. This is a client-side safety net on top of that.
This commit is contained in:
parent
0175ff7516
commit
4aa52590d8
3 changed files with 84 additions and 3 deletions
17
ui-tui/src/domain/providers.ts
Normal file
17
ui-tui/src/domain/providers.ts
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
export const providerDisplayNames = (providers: readonly { name: string; slug: string }[]): string[] => {
|
||||
const counts = new Map<string, number>()
|
||||
|
||||
for (const p of providers) {
|
||||
counts.set(p.name, (counts.get(p.name) ?? 0) + 1)
|
||||
}
|
||||
|
||||
return providers.map(p => {
|
||||
const dup = (counts.get(p.name) ?? 0) > 1
|
||||
|
||||
if (!dup || !p.slug || p.slug === p.name) {
|
||||
return p.name
|
||||
}
|
||||
|
||||
return `${p.name} (${p.slug})`
|
||||
})
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue