From ef677265d2360573a142eaeac74a028db5bcba56 Mon Sep 17 00:00:00 2001 From: Xipong <217837358+Xipong@users.noreply.github.com> Date: Wed, 9 Sep 2026 01:19:54 +0300 Subject: [PATCH] fix(desktop): reuse detected SSH platform --- apps/desktop/electron/main.ts | 1 + apps/desktop/electron/remote-lifecycle.test.ts | 9 ++++++++- apps/desktop/electron/remote-lifecycle.ts | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/apps/desktop/electron/main.ts b/apps/desktop/electron/main.ts index b2f47f6a0d..442b28ce92 100644 --- a/apps/desktop/electron/main.ts +++ b/apps/desktop/electron/main.ts @@ -10712,6 +10712,7 @@ async function bootstrapSshConnectionInner(profile, sshConfig, reuseToken, sourc const lifecycle = platform.os === 'Windows' ? connectWindowsRemote : remoteLifecycle.connect result = await lifecycle({ ssh, + platform, profile: resolveRemoteSshDashboardProfile(sshConfig.remoteProfile, profile), remoteHermesPath: sshConfig.remoteHermesPath || '', ownershipId: sshOwnershipKey(profile), diff --git a/apps/desktop/electron/remote-lifecycle.test.ts b/apps/desktop/electron/remote-lifecycle.test.ts index b75487eb39..583f4edcab 100644 --- a/apps/desktop/electron/remote-lifecycle.test.ts +++ b/apps/desktop/electron/remote-lifecycle.test.ts @@ -999,7 +999,14 @@ test('connect() spawns fresh when there is no lockfile, adopts the served token' [/cat .*\.log/, 'HERMES_DASHBOARD_READY port=51999\n'] ]) - const result = await connect(connectDeps(ssh, { adoptServedToken: async () => 'the-served-token' })) + const result = await connect( + connectDeps(ssh, { + adoptServedToken: async () => 'the-served-token', + platform: { os: 'Linux', arch: 'x86_64' } + }) + ) + + assert.equal(ssh.calls.filter(command => command === 'uname -s; uname -m').length, 0) assert.equal(result.reused, false) assert.equal(result.remotePort, 51999) assert.equal(result.localPort, 50001) diff --git a/apps/desktop/electron/remote-lifecycle.ts b/apps/desktop/electron/remote-lifecycle.ts index 112fdddda3..a9b2d9b4fd 100644 --- a/apps/desktop/electron/remote-lifecycle.ts +++ b/apps/desktop/electron/remote-lifecycle.ts @@ -1396,7 +1396,7 @@ async function connect(deps) { const log = msg => rememberLog(`[ssh-lifecycle] ${msg}`) assertBootstrapNotSuperseded(signal) - const platform = await probeRemotePlatform(ssh) + const platform = deps.platform ?? (await probeRemotePlatform(ssh)) log(`remote platform ${platform.os}/${platform.arch}`) const hermesHome = await probeRemoteHermesHome(ssh) await assertRemoteInstallUpdateClear(ssh, hermesHome)