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
This commit is contained in:
admin
2026-05-05 14:49:49 +00:00
Unverified
parent a84df42932
commit 050dc6ebe3
4 changed files with 171 additions and 33 deletions

View File

@@ -1,11 +1,30 @@
#!/bin/bash
cd /home/uroma2/zcode-cli-x
# 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
node bin/zcode.js --no-cli &
# 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 3
sleep 2
echo "=== Process ==="
ps aux | grep "bin/zcode" | grep -v grep
echo "=== Recent logs ==="
tail -25 logs/zcode.log
tail -10 logs/zcode.log