fix: Robust brain health verification in setup and improved Lisp error logging
Some checks failed
Deploy-Agent-V15-Stdin / JOB-V15-STDIN (push) Failing after 27s
Some checks failed
Deploy-Agent-V15-Stdin / JOB-V15-STDIN (push) Failing after 27s
This commit is contained in:
@@ -30,7 +30,7 @@ setup_system() {
|
|||||||
echo -e "${BLUE}=== OpenCortex: Initializing System ===${NC}"
|
echo -e "${BLUE}=== OpenCortex: Initializing System ===${NC}"
|
||||||
echo -e "${YELLOW}--- Installing System Dependencies ---${NC}"
|
echo -e "${YELLOW}--- Installing System Dependencies ---${NC}"
|
||||||
if command_exists apt-get; then
|
if command_exists apt-get; then
|
||||||
sudo apt-get update && sudo apt-get install -y sbcl emacs-nox rlwrap netcat-openbsd curl git socat
|
sudo apt-get update && sudo apt-get install -y sbcl emacs-nox rlwrap netcat-openbsd curl git socat libssl-dev libncurses5-dev
|
||||||
fi
|
fi
|
||||||
if [ ! -d "$HOME/quicklisp" ]; then
|
if [ ! -d "$HOME/quicklisp" ]; then
|
||||||
curl -O https://beta.quicklisp.org/quicklisp.lisp
|
curl -O https://beta.quicklisp.org/quicklisp.lisp
|
||||||
@@ -98,7 +98,32 @@ setup_system() {
|
|||||||
done
|
done
|
||||||
mkdir -p "$HOME/.local/bin"
|
mkdir -p "$HOME/.local/bin"
|
||||||
ln -sf "$SCRIPT_DIR/opencortex.sh" "$HOME/.local/bin/opencortex"
|
ln -sf "$SCRIPT_DIR/opencortex.sh" "$HOME/.local/bin/opencortex"
|
||||||
echo -e "${GREEN}✓ Setup complete. You can now run 'opencortex tui'.${NC}"
|
|
||||||
|
echo -e "${YELLOW}--- Finalizing: Awakening the Brain for the first time ---${NC}"
|
||||||
|
# Nuke any existing brain logs
|
||||||
|
> "$SCRIPT_DIR/brain.log"
|
||||||
|
"$SCRIPT_DIR/opencortex.sh" --boot > "$SCRIPT_DIR/brain.log" 2>&1 &
|
||||||
|
|
||||||
|
local success=false
|
||||||
|
for i in {1..30}; do
|
||||||
|
if nc -z localhost $PORT 2>/dev/null; then
|
||||||
|
success=true
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
sleep 2
|
||||||
|
echo -n "."
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ "$success" = true ]; then
|
||||||
|
echo -e "\n${GREEN}✓ Brain is alive and responsive on port $PORT.${NC}"
|
||||||
|
echo -e "${GREEN}✓ Setup complete. You can now run 'opencortex tui'.${NC}"
|
||||||
|
else
|
||||||
|
echo -e "\n${RED}✗ Brain failed to wake up. Error Log from brain.log:${NC}"
|
||||||
|
cat "$SCRIPT_DIR/brain.log"
|
||||||
|
# Kill the background process if it exists
|
||||||
|
pkill -f "sbcl.*opencortex" || true
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ ! -f "$SCRIPT_DIR/src/package.lisp" ] || [ ! -f "$SCRIPT_DIR/.env" ]; then
|
if [ ! -f "$SCRIPT_DIR/src/package.lisp" ] || [ ! -f "$SCRIPT_DIR/.env" ]; then
|
||||||
@@ -116,9 +141,10 @@ if [[ "$1" == "--boot" ]]; then
|
|||||||
done < "$SCRIPT_DIR/.env"
|
done < "$SCRIPT_DIR/.env"
|
||||||
fi
|
fi
|
||||||
exec sbcl --non-interactive \
|
exec sbcl --non-interactive \
|
||||||
--eval "(load \"~/quicklisp/setup.lisp\")" \
|
--eval "(load (merge-pathnames \"quicklisp/setup.lisp\" (user-homedir-pathname)))" \
|
||||||
--eval "(push \"$SCRIPT_DIR/\" asdf:*central-registry*)" \
|
--eval "(setf *debugger-hook* (lambda (c h) (declare (ignore h)) (format t \"~a~%\" c) (uiop:quit 1)))" \
|
||||||
--eval "(ql:quickload :opencortex)" \
|
--eval "(push (truename \"$SCRIPT_DIR/\") asdf:*central-registry*)" \
|
||||||
|
--eval "(ql:quickload :opencortex :silent t)" \
|
||||||
--eval "(opencortex:main)"
|
--eval "(opencortex:main)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ setup_system() {
|
|||||||
echo -e "${BLUE}=== OpenCortex: Initializing System ===${NC}"
|
echo -e "${BLUE}=== OpenCortex: Initializing System ===${NC}"
|
||||||
echo -e "${YELLOW}--- Installing System Dependencies ---${NC}"
|
echo -e "${YELLOW}--- Installing System Dependencies ---${NC}"
|
||||||
if command_exists apt-get; then
|
if command_exists apt-get; then
|
||||||
sudo apt-get update && sudo apt-get install -y sbcl emacs-nox rlwrap netcat-openbsd curl git socat
|
sudo apt-get update && sudo apt-get install -y sbcl emacs-nox rlwrap netcat-openbsd curl git socat libssl-dev libncurses5-dev
|
||||||
fi
|
fi
|
||||||
if [ ! -d "$HOME/quicklisp" ]; then
|
if [ ! -d "$HOME/quicklisp" ]; then
|
||||||
curl -O https://beta.quicklisp.org/quicklisp.lisp
|
curl -O https://beta.quicklisp.org/quicklisp.lisp
|
||||||
@@ -89,7 +89,32 @@ setup_system() {
|
|||||||
done
|
done
|
||||||
mkdir -p "$HOME/.local/bin"
|
mkdir -p "$HOME/.local/bin"
|
||||||
ln -sf "$SCRIPT_DIR/opencortex.sh" "$HOME/.local/bin/opencortex"
|
ln -sf "$SCRIPT_DIR/opencortex.sh" "$HOME/.local/bin/opencortex"
|
||||||
echo -e "${GREEN}✓ Setup complete. You can now run 'opencortex tui'.${NC}"
|
|
||||||
|
echo -e "${YELLOW}--- Finalizing: Awakening the Brain for the first time ---${NC}"
|
||||||
|
# Nuke any existing brain logs
|
||||||
|
> "$SCRIPT_DIR/brain.log"
|
||||||
|
"$SCRIPT_DIR/opencortex.sh" --boot > "$SCRIPT_DIR/brain.log" 2>&1 &
|
||||||
|
|
||||||
|
local success=false
|
||||||
|
for i in {1..30}; do
|
||||||
|
if nc -z localhost $PORT 2>/dev/null; then
|
||||||
|
success=true
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
sleep 2
|
||||||
|
echo -n "."
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ "$success" = true ]; then
|
||||||
|
echo -e "\n${GREEN}✓ Brain is alive and responsive on port $PORT.${NC}"
|
||||||
|
echo -e "${GREEN}✓ Setup complete. You can now run 'opencortex tui'.${NC}"
|
||||||
|
else
|
||||||
|
echo -e "\n${RED}✗ Brain failed to wake up. Error Log from brain.log:${NC}"
|
||||||
|
cat "$SCRIPT_DIR/brain.log"
|
||||||
|
# Kill the background process if it exists
|
||||||
|
pkill -f "sbcl.*opencortex" || true
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ ! -f "$SCRIPT_DIR/src/package.lisp" ] || [ ! -f "$SCRIPT_DIR/.env" ]; then
|
if [ ! -f "$SCRIPT_DIR/src/package.lisp" ] || [ ! -f "$SCRIPT_DIR/.env" ]; then
|
||||||
@@ -107,9 +132,10 @@ if [[ "$1" == "--boot" ]]; then
|
|||||||
done < "$SCRIPT_DIR/.env"
|
done < "$SCRIPT_DIR/.env"
|
||||||
fi
|
fi
|
||||||
exec sbcl --non-interactive \
|
exec sbcl --non-interactive \
|
||||||
--eval "(load \"~/quicklisp/setup.lisp\")" \
|
--eval "(load (merge-pathnames \"quicklisp/setup.lisp\" (user-homedir-pathname)))" \
|
||||||
--eval "(push \"$SCRIPT_DIR/\" asdf:*central-registry*)" \
|
--eval "(setf *debugger-hook* (lambda (c h) (declare (ignore h)) (format t \"~a~%\" c) (uiop:quit 1)))" \
|
||||||
--eval "(ql:quickload :opencortex)" \
|
--eval "(push (truename \"$SCRIPT_DIR/\") asdf:*central-registry*)" \
|
||||||
|
--eval "(ql:quickload :opencortex :silent t)" \
|
||||||
--eval "(opencortex:main)"
|
--eval "(opencortex:main)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user