fix(desktop): resolve active v2 registry SSH scope

This commit is contained in:
Mabolla
2026-08-20 20:07:55 +03:00
committed by Teknium
parent 120430be47
commit d2c8727db5
+19
View File
@@ -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)
}