From c5ccd710890df3b665a0596b2610d8609fe4b1b8 Mon Sep 17 00:00:00 2001 From: Mark McKeen Date: Sun, 29 Mar 2026 09:51:44 -0600 Subject: [PATCH] fix: handle terminal shell fallback and loopback dashboard UX - probe sandbox with /bin/sh, /busybox/sh, and env fallback - stop opening loopback-only OpenClaw dashboard URLs in browser - keep operator message for proxy/rebind requirement --- app/components/SandboxList.tsx | 2 +- app/lib/openshellHost.ts | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/app/components/SandboxList.tsx b/app/components/SandboxList.tsx index c62e04e..16799e9 100644 --- a/app/components/SandboxList.tsx +++ b/app/components/SandboxList.tsx @@ -183,7 +183,7 @@ export default function SandboxList({ setDashboardMessage(data.loopbackOnly ? `OpenClaw Dashboard detected at ${data.dashboardUrl}. It is loopback-only, so the next step is adding a proxy/open-in-new-tab bridge.` : `OpenClaw Dashboard: ${data.dashboardUrl}`) - if (data.dashboardUrl) { + if (data.dashboardUrl && !data.loopbackOnly) { window.open(data.dashboardUrl, '_blank', 'noopener,noreferrer') } } catch (error) { diff --git a/app/lib/openshellHost.ts b/app/lib/openshellHost.ts index 1245add..2bfc453 100644 --- a/app/lib/openshellHost.ts +++ b/app/lib/openshellHost.ts @@ -20,9 +20,21 @@ export async function dockerExecInOpenShell(command: string) { } export async function probeSandboxShell(podName: string) { - return dockerExecInOpenShell( - `kubectl -n ${OPENSHELL_NAMESPACE} exec ${podName} -- sh -lc 'echo OPENSHELL_OK && pwd && whoami'` - ) + const attempts = [ + `kubectl -n ${OPENSHELL_NAMESPACE} exec ${podName} -- /bin/sh -lc 'echo OPENSHELL_OK && pwd && whoami'`, + `kubectl -n ${OPENSHELL_NAMESPACE} exec ${podName} -- /busybox/sh -lc 'echo OPENSHELL_OK && pwd && whoami'`, + `kubectl -n ${OPENSHELL_NAMESPACE} exec ${podName} -- env`, + ] + + let lastError: unknown + for (const command of attempts) { + try { + return await dockerExecInOpenShell(command) + } catch (error) { + lastError = error + } + } + throw lastError instanceof Error ? lastError : new Error('Failed to probe sandbox shell') } export function getOpenClawDashboardUrl() {