mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-27 01:11:40 +00:00
fix(tui): stable React keys in /model picker rows
Use provider.slug (and a composite key for model rows) instead of the rendered string, so dupes in the backend response can't collapse two rows into one or trigger key-collision warnings.
This commit is contained in:
parent
db59c190c1
commit
52124384de
1 changed files with 2 additions and 2 deletions
|
|
@ -181,7 +181,7 @@ export function ModelPicker({ gw, onCancel, onSelect, sessionId, t }: ModelPicke
|
|||
const idx = off + i
|
||||
|
||||
return (
|
||||
<Text color={providerIdx === idx ? t.color.cornsilk : t.color.dim} key={row}>
|
||||
<Text color={providerIdx === idx ? t.color.cornsilk : t.color.dim} key={providers[idx]?.slug ?? `row-${idx}`}>
|
||||
{providerIdx === idx ? '▸ ' : ' '}
|
||||
{i + 1}. {row}
|
||||
</Text>
|
||||
|
|
@ -212,7 +212,7 @@ export function ModelPicker({ gw, onCancel, onSelect, sessionId, t }: ModelPicke
|
|||
const idx = off + i
|
||||
|
||||
return (
|
||||
<Text color={modelIdx === idx ? t.color.cornsilk : t.color.dim} key={row}>
|
||||
<Text color={modelIdx === idx ? t.color.cornsilk : t.color.dim} key={`${provider?.slug ?? 'prov'}:${idx}:${row}`}>
|
||||
{modelIdx === idx ? '▸ ' : ' '}
|
||||
{i + 1}. {row}
|
||||
</Text>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue