fix: restart backend under systemd and use .sproutclaw agent dir

Restart via systemctl when running as a service, set SPROUTCLAW_CODING_AGENT_DIR
for the RPC subprocess, and add a frontend poll timeout for failed restarts.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-24 10:29:28 +08:00
parent 767a776a3e
commit bd2251e89a
7 changed files with 123 additions and 32 deletions

11
build.sh Executable file
View File

@@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
OUT="$SCRIPT_DIR/backend/dist/sproutclaw-web-backend"
echo "[build] compiling Go backend -> $OUT"
cd "$SCRIPT_DIR/backend"
/usr/local/go/bin/go build -o "$OUT" ./cmd/server
chmod +x "$OUT"
echo "[build] done: $OUT"