- 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
31 lines
604 B
Bash
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
|