From 2b5b6e3003af0da1a93f521c14789059851de519 Mon Sep 17 00:00:00 2001 From: Brian Krabach Date: Tue, 31 Mar 2026 01:31:09 -0700 Subject: [PATCH] feat: skip connect and terminal mount for remote sessions in openSession When opts.sourceUrl is non-empty (remote session), skip the POST /api/sessions/{name}/connect call and skip window._openTerminal(name). Remote terminal connections are deferred to Phase 3. Local sessions (empty sourceUrl) continue to work as before. Co-authored-by: Amplifier --- muxplex/frontend/app.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/muxplex/frontend/app.js b/muxplex/frontend/app.js index a8310e7..740f7ae 100644 --- a/muxplex/frontend/app.js +++ b/muxplex/frontend/app.js @@ -1086,9 +1086,12 @@ async function openSession(name, opts = {}) { if (fab) fab.classList.add('hidden'); // Connect to session (kill old ttyd, spawn new one for this session) + var sourceUrl = opts.sourceUrl || ''; try { if (!opts.skipConnect) { - await api('POST', `/api/sessions/${name}/connect`); + if (!sourceUrl) { + await api('POST', `/api/sessions/${name}/connect`); + } } } catch (err) { showToast(err.message || 'Connection failed'); @@ -1099,7 +1102,7 @@ async function openSession(name, opts = {}) { await animDone; // Mount terminal NOW — /connect has completed, new ttyd is serving the correct session - if (window._openTerminal) window._openTerminal(name); + if (!sourceUrl && window._openTerminal) window._openTerminal(name); } /**