bug(cli): duplicate React keys in CommandAutocomplete — "clear" and "help" collisions #193
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
The
CommandAutocompletecomponent renders duplicate React keys, triggering warnings:This happens because the autocomplete renders commands from both the local registry (
CommandRegistry.LOCAL_COMMANDS) and the gateway manifest (commands:manifest). Both sources includeclear,help,status, andnew— the local commands and the gateway-registered commands have the same names, creating key collisions when rendered together.Location
packages/cli/src/tui/components/command-autocomplete.tsxline 12 — usescmd.nameas React keypackages/cli/src/tui/commands/registry.ts—getAll()merges local + gateway commands without deduplicationRoot Cause
CommandRegistry.getAll()concatenatesLOCAL_COMMANDSandgatewayManifest.commandswithout deduplicating. Several commands exist in both:clear— local (display clear) + gateway (context clear)help— local + gatewaystatus— local + gatewaynew— local + gatewayThe
CommandAutocompletecomponent then maps over this merged list usingcmd.nameas the React key, causing collisions.Fix Options
getAll()— gateway commands take precedence over local commands with the same name. Local-only commands remain.key={\${cmd.scope}-${cmd.name}`}` to differentiate by source.Option 3 is recommended.
Stack Trace