Files
zCode-CLI-X/restart.sh
admin 050dc6ebe3 fix: bulletproof command handler + auto-restart + README overhaul
- sendStreamingMessage: replaced broken simulated streaming with reliable
  HTML send + stripped plain text fallback (was silently failing)
- Added global unhandledRejection guard (catches async errors that
  sequentialize middleware would swallow)
- restart.sh: auto-restart loop on crash (3s delay) instead of bare node
- README: comprehensive update with self-learning memory, curiosity engine,
  memory architecture diagram, updated command table, updated comparison
2026-05-05 14:49:49 +00:00

31 lines
604 B
Bash

#!/bin/bash
# restart.sh — safe bot restart with process tracking
# Usage: bash restart.sh
cd "$(dirname "$0")"
# Kill any existing zcode process
pkill -f "bin/zcode.js" 2>/dev/null
sleep 1
# Ensure log directory exists
mkdir -p logs
# Start with auto-restart loop
(
while true; do
node bin/zcode.js --no-cli >> logs/zcode.log 2>&1
EXIT=$?
echo "[$(date -Iseconds)] Process exited ($EXIT), restarting in 3s..." >> logs/zcode.log
sleep 3
done
) &
disown
sleep 2
echo "=== Process ==="
ps aux | grep "bin/zcode" | grep -v grep
echo "=== Recent logs ==="
tail -10 logs/zcode.log