Change:
} export async function connectRemoteAgentManagement(options: IConnectionOptions, remoteAuthority: string, clientId: string): Promise<ManagementPersistentConnection> { <del> try { const reconnectionToken = generateUuid(); const simpleOptions = await resolveConnectionOptions(options, reconnectionToken, null); const { protocol } = await doConnectRemoteAgentManagement(simpleOptions, CancellationToken.None); return new ManagementPersistentConnection(options, remoteAuthority, clientId, reconnectionToken, protocol); } catch (err) { options.logService.error(`[remote-connection] An error occurred in the very first connect attempt, it will be treated as a permanent error! Error:`); options.logService.error(err); PersistentConnection.triggerPermanentFailure(0, 0, RemoteAuthorityResolverError.isHandled(err)); throw err; } </del> <ins> return createInitialConnection( options, async (simpleOptions) => { const { protocol } = await doConnectRemoteAgentManagement(simpleOptions, CancellationToken.None); return new ManagementPersistentConnection(options, remoteAuthority, clientId, simpleOptions.reconnectionToken, protocol); } ); </ins> } export async function connectRemoteAgentExtensionHost(options: IConnectionOptions, startArguments: IRemoteExtensionHostStartParams): Promise<ExtensionHostPersistentConnection> { <del> try { const reconnectionToken = generateUuid(); const simpleOptions = await resolveConnectionOptions(options, reconnectionToken, null); const { protocol, debugPort } = await doConnectRemoteAgentExtensionHost(simpleOptions, startArguments, CancellationToken.None); return new ExtensionHostPersistentConnection(options, startArguments, reconnectionToken, protocol, debugPort); } catch (err) { options.logService.error(`[remote-connection] An error occurred in the very first connect attempt, it will be treated as a permanent error! Error:`); options.logService.error(err); PersistentConnection.triggerPermanentFailure(0, 0, RemoteAuthorityResolverError.isHandled(err)); throw err; </del> <ins> return createInitialConnection( options, async (simpleOptions) => { const { protocol, debugPort } = await doConnectRemoteAgentExtensionHost(simpleOptions, startArguments, CancellationToken.None); return new ExtensionHostPersistentConnection(options, startArguments, simpleOptions.reconnectionToken, protocol, debugPort); } ); } /** * Will attempt to connect 5 times. If it fails 5 consecutive times, it will give up. */ async function createInitialConnection<T extends PersistentConnection>(options: IConnectionOptions, connectionFactory: (simpleOptions: ISimpleConnectionOptions) => Promise<T>): Promise<T> { const MAX_ATTEMPTS = 5; for (let attempt = 1; ; attempt++) { try { const reconnectionToken = generateUuid(); const simpleOptions = await resolveConnectionOptions(options, reconnectionToken, null); const result = await connectionFactory(simpleOptions); return result; } catch (err) { if (attempt < MAX_ATTEMPTS) { options.logService.error(`[remote-connection][attempt ${attempt}] An error occurred in initial connection! Will retry... Error:`); options.logService.error(err); } else { options.logService.error(`[remote-connection][attempt ${attempt}]  An error occurred in initial connection! It will be treated as a permanent error. Error:`); options.logService.error(err); PersistentConnection.triggerPermanentFailure(0, 0, RemoteAuthorityResolverError.isHandled(err)); throw err; } } </ins> } }

Discussion:
When connecting to a remote, if the initial connection fails, we will give up. The idea was that retrying would be useless, since the initial setup might have failed. But it is possible that perhaps it was an intermittent network error.
One of the annoyances I have is all my open editors tabs are closed. I have to try and remember what editor tabs I had open which often leads to lost time and effort trying to recall. I did create a ticket for this, which is how I found this as it was suggested, Ideally, even if can't connect need the ability to save/restore the prior editor tabs that were open or currently opened.
This can be verified running from source with the test resolver, using a change like the following: Then, run and from the bottom left open the test resolver. The resulting window should connect despite the resolver returning errors or resolving with an address which leads to a connection error.