Skip to content

Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.

fix(install): stop reporting a crashed uninstall as "cancelled", and a broken node as fatal

Ruben Lütkecdbf4bd68fc1
diff --git a/install/install.sh b/install/install.sh
index eaad8711e8..76fab4a577 100755
--- a/install/install.sh
+++ b/install/install.sh
@@ -838,7 +838,14 @@ if [ "$skip_node" -eq 1 ]; then
else
node_ok=0
if command -v node >/dev/null 2>&1; then
- node_major=$(node --version 2>/dev/null | sed -E 's/^v?([0-9]+).*/\1/')
+ # `|| node_major=""` is load-bearing: under `set -e` + `pipefail` a
+ # node that EXISTS but exits non-zero kills the whole installer right
+ # here, silently, two phases before the end. `command -v` only proves
+ # the name resolves - an asdf/volta/nvm shim with no version selected
+ # (126), an x86_64 binary on arm64 (126), or a Gatekeeper-killed one
+ # (137) all pass that test and then fail. Node is OPTIONAL, so a
+ # broken one must degrade to "not found", never abort the install.
+ node_major=$(node --version 2>/dev/null | sed -E 's/^v?([0-9]+).*/\1/') || node_major=""
if [ -n "$node_major" ] && [ "$node_major" -ge 18 ] 2>/dev/null; then
node_ok=1
fi
diff --git a/install/uninstall.sh b/install/uninstall.sh
index cfbfb4f9d6..ca2ee25ff2 100644
--- a/install/uninstall.sh
+++ b/install/uninstall.sh
@@ -133,9 +133,26 @@ else
RC=0
fi
-# The Python step returns 1 when the user cancels at its prompt. Respect that.
-if [ "$RC" -ne 0 ]; then
+# Map the Python step's exit code HONESTLY. It returns 1 when the user
+# declines at its prompt and 2 when the folder is not a Jarvis install - it
+# printed the reason itself in both cases. ANY OTHER code means it CRASHED,
+# most often a venv whose interpreter stopped resolving after a system Python
+# upgrade (on macOS/Homebrew: "dyld: Library not loaded: @rpath/Python3...").
+# Reporting a crash as "cancelled" hides a real failure behind a user-choice
+# message and leaves the install standing with no clue why - which is exactly
+# how a broken uninstall reads as "it just does nothing".
+if [ "$RC" -eq 1 ]; then
note 'Cancelled — nothing was changed.'
+ exit 1
+elif [ "$RC" -eq 2 ]; then
+ exit 2
+elif [ "$RC" -ne 0 ]; then
+ err "The cleanup step failed (exit $RC) — nothing was changed."
+ note 'Its own error is printed above. On macOS the usual cause is a venv'
+ note 'broken by a system/Homebrew Python upgrade.'
+ note 'To remove Jarvis anyway:'
+ note " rm -rf \"$INSTALL_DIR\""
+ note 'Saved API keys then stay in your OS keychain under "personal-jarvis".'
exit "$RC"
fi