Skip to content
This repository was archived by the owner on May 6, 2026. It is now read-only.

Commit 7a6ad67

Browse files
author
yysjasmine
committed
Fix Linux OpenClaw dashboard launch
1 parent 5b06701 commit 7a6ad67

4 files changed

Lines changed: 88 additions & 10 deletions

File tree

linux/install.sh

Lines changed: 85 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -416,11 +416,87 @@ _ap_resolve_cli() {
416416
return 1
417417
}
418418

419+
_ap_is_wsl() {
420+
grep -qi microsoft /proc/version 2>/dev/null || grep -qi wsl /proc/sys/kernel/osrelease 2>/dev/null
421+
}
422+
423+
_ap_dashboard_url() {
424+
local openclaw_cli="$1"
425+
local out line url
426+
427+
out="$("$openclaw_cli" dashboard --no-open 2>/dev/null || true)"
428+
while IFS= read -r line; do
429+
case "$line" in
430+
Dashboard\ URL:*)
431+
url="${line#Dashboard URL: }"
432+
printf '%s\n' "$url"
433+
return 0
434+
;;
435+
esac
436+
done <<< "$out"
437+
438+
return 1
439+
}
440+
441+
_ap_dashboard_url_with_session() {
442+
local url="$1"
443+
if [ -z "$url" ]; then
444+
return 1
445+
fi
446+
case "$url" in
447+
*session=*)
448+
printf '%s\n' "$url"
449+
;;
450+
*#*)
451+
printf '%s&session=main\n' "$url"
452+
;;
453+
*)
454+
printf '%s#session=main\n' "$url"
455+
;;
456+
esac
457+
}
458+
459+
_ap_open_dashboard_url() {
460+
local url="$1"
461+
local ps_url
462+
463+
if command -v wslview >/dev/null 2>&1; then
464+
wslview "$url" >/dev/null 2>&1
465+
return $?
466+
fi
467+
468+
if _ap_is_wsl && command -v powershell.exe >/dev/null 2>&1; then
469+
ps_url="${url//\'/\'\'}"
470+
powershell.exe -NoProfile -WindowStyle Hidden -Command "Start-Process '$ps_url'" >/dev/null 2>&1
471+
return $?
472+
fi
473+
474+
if command -v xdg-open >/dev/null 2>&1 && { [ -n "${DISPLAY:-}" ] || [ -n "${WAYLAND_DISPLAY:-}" ]; }; then
475+
xdg-open "$url" >/dev/null 2>&1
476+
return $?
477+
fi
478+
479+
return 1
480+
}
481+
419482
_ap_schedule_dashboard() {
420483
local openclaw_cli="$1"
421-
# Give the gateway a few seconds to bind before opening the browser
422-
# (dashboard itself doesn't probe, so we sleep for the user's sake).
423-
( sleep 3 && "$openclaw_cli" dashboard >/dev/null 2>&1 ) &
484+
local dashboard_url=""
485+
486+
dashboard_url="$(_ap_dashboard_url "$openclaw_cli" || true)"
487+
if [ -z "$dashboard_url" ]; then
488+
echo "[!] Could not resolve the OpenClaw dashboard URL automatically."
489+
echo "[!] After startup, run: openclaw dashboard"
490+
return 1
491+
fi
492+
493+
dashboard_url="$(_ap_dashboard_url_with_session "$dashboard_url")"
494+
echo "[*] OpenClaw dashboard URL: $dashboard_url"
495+
496+
(
497+
sleep 3
498+
_ap_open_dashboard_url "$dashboard_url" || true
499+
) >/dev/null 2>&1 &
424500
disown 2>/dev/null || true
425501
}
426502

@@ -448,16 +524,18 @@ if _ap_has openclaw && _ap_has hermes; then
448524
echo "[*] Starting openclaw gateway in the background (log: $_openclaw_log)..."
449525
nohup "$_OPENCLAW_CLI" gateway --verbose >"$_openclaw_log" 2>&1 &
450526
disown 2>/dev/null || true
451-
_ap_schedule_dashboard "$_OPENCLAW_CLI"
452-
echo "[*] Opening OpenClaw dashboard in your browser shortly..."
527+
if _ap_schedule_dashboard "$_OPENCLAW_CLI"; then
528+
echo "[*] Attempting to open OpenClaw dashboard in your browser..."
529+
fi
453530
echo "[*] Starting hermes in this window..."
454531
exec "$_HERMES_CLI"
455532
elif _ap_has hermes; then
456533
echo "[*] Starting hermes in this window..."
457534
exec "$_HERMES_CLI"
458535
elif _ap_has openclaw; then
459-
_ap_schedule_dashboard "$_OPENCLAW_CLI"
460-
echo "[*] Opening OpenClaw dashboard in your browser shortly..."
536+
if _ap_schedule_dashboard "$_OPENCLAW_CLI"; then
537+
echo "[*] Attempting to open OpenClaw dashboard in your browser..."
538+
fi
461539
echo "[*] Starting openclaw gateway in this window..."
462540
exec "$_OPENCLAW_CLI" gateway --verbose
463541
fi

macos/build-pkg.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
88
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
99
BUILD_DIR="$SCRIPT_DIR/build"
1010
DIST_DIR="$PROJECT_ROOT/dist"
11-
VERSION="1.0.8"
11+
VERSION="1.0.9"
1212
SCRIPTS_DIR="$BUILD_DIR/scripts"
1313

1414
rm -rf "$BUILD_DIR"

macos/distribution.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
<pkg-ref id="com.agentpack.pkg"/>
1818
</choice>
1919
<pkg-ref id="com.agentpack.pkg"
20-
version="1.0.8"
20+
version="1.0.9"
2121
onConclusion="none">AgentPack.pkg</pkg-ref>
2222
</installer-gui-script>

windows/installer.iss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
; Requires Inno Setup 6.x
33

44
#define MyAppName "Agent Pack"
5-
#define MyAppVersion "1.0.8"
5+
#define MyAppVersion "1.0.9"
66
#define MyAppPublisher "Agent Pack"
77
#define MyAppURL "https://github.com/SenseTime-FVG/agent_pack"
88

0 commit comments

Comments
 (0)