Files
hermes-agent/apps
Teknium 187e5b2b95 fix(desktop): stop phantom local default on remote-gateway desktops; keep the main agent named Hermes
Follow-up to #88523/#88542 from a community report (main agent listed twice,
both rows unnamed @default handles). Two distinct bugs, both specific to
remote-gateway-primary desktops:

1. Phantom "This device" default (electron): the roster enumeration dialed
   ensureRegistryBackend for the registry's local entry unconditionally. On a
   remote-primary desktop that forces resolveRegistryLocalRoute into the
   forced-local branch — SPAWNING a local backend the user never asked for.
   That backend enumerates a `default` profile, so a second default agent
   appears AND the duplicate-handle rule forces -device suffixes onto the
   real one. New shouldDeferLocalEnumeration() treats the forced-local route
   as connect-on-demand (same courtesy as undialed SSH sources): the local
   entry only enumerates when it is the delegate route (local-primary
   desktops, byte-identical behavior) or a forced-local child is already
   pooled (the user opened one).

2. Main agent renamed to a connection label (plugin): displayName keyed the
   "show the connection label for a default row" rule off sourceScoped —
   which annotation also sets on ACTIVE-source rows. A remote-gateway user's
   main agent rendered as an IP-derived label (or bare handle) instead of
   "Hermes"/their title. Key it off remoteSource: only THIN rows from
   another source trade the friendly name for their source label.

Tests: shouldDeferLocalEnumeration route matrix (delegate always enumerates;
forced-local defers until a conn:local:: child exists; bare-key remote
descriptor doesn't count), displayName regression (active default stays
Hermes/title; thin remote default still shows its source label).
2026-08-17 11:33:05 -07:00
..