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
This commit is contained in:
Mark McKeen
2026-03-29 09:51:44 -06:00
parent dad980f18f
commit c5ccd71089
2 changed files with 16 additions and 4 deletions
+15 -3
View File
@@ -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() {