From d2c8727db5c45ce00fe60eddd29b2fc7cbecf6c7 Mon Sep 17 00:00:00 2001 From: Mabolla <133767935+Mabolla@users.noreply.github.com> Date: Thu, 20 Aug 2026 20:07:55 +0300 Subject: [PATCH] fix(desktop): resolve active v2 registry SSH scope --- apps/desktop/electron/active-ssh-route.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 apps/desktop/electron/active-ssh-route.ts diff --git a/apps/desktop/electron/active-ssh-route.ts b/apps/desktop/electron/active-ssh-route.ts new file mode 100644 index 0000000000..2351a959f1 --- /dev/null +++ b/apps/desktop/electron/active-ssh-route.ts @@ -0,0 +1,19 @@ +import { backendScopeKey, type ConnectionRegistry } from './connection-registry' + +/** + * Return the live SSH pool scope for the registry connection currently used by + * the Sessions workspace. Non-SSH sources deliberately return null so callers + * can preserve the legacy v1 routing fallback. + */ +export function activeRegistrySshScope( + registry: ConnectionRegistry, + profile: null | string | undefined +): null | string { + const connection = registry.connections.find(candidate => candidate.id === registry.lastUsed) + + if (!connection || connection.kind !== 'ssh') { + return null + } + + return backendScopeKey(connection.id, profile) +}