d16e2366df
Under a global SSH/remote gateway, resolveProfileBackendRoute routes every profile to the shared primary backend (case 3) and getConnection() returns the primary descriptor tagged with the profile. ensureGatewayForProfile still dialed a per-profile secondary socket at that descriptor; over SSH the duplicate dial fails (per-backend tunnel/ticket) and the closed socket became the ACTIVE gateway — every profile except the primary showed 'Hermes gateway is not connected' even though the primary socket was open. Detect the shared-primary route and activate the primary socket instead; $activeGatewayProfile still tracks the selected profile so per-request ?profile= scoping is unchanged. Hover pre-warm no-ops on this route. Local pooled profiles and per-profile remote overrides are untouched (pinned by test).