mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-28 06:51:16 +08: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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user