Anurag commited on
Commit
303e1b9
Β·
unverified Β·
2 Parent(s): d5203bfbb608e7

Introduce AUTO_DOCTOR toggle and make gateway failure fatal outside dev mode

Browse files
Files changed (2) hide show
  1. env-builder.js +9 -0
  2. start.sh +14 -5
env-builder.js CHANGED
@@ -482,6 +482,15 @@ const FIELDS = [
482
  "common": 1,
483
  "tag": "build"
484
  },
 
 
 
 
 
 
 
 
 
485
  {
486
  "g": "Startup",
487
  "icon": "⚑",
 
482
  "common": 1,
483
  "tag": "build"
484
  },
485
+ {
486
+ "g": "Startup",
487
+ "icon": "🩺",
488
+ "k": "AUTO_DOCTOR",
489
+ "lbl": "Auto-fix config on boot (openclaw doctor --fix)",
490
+ "type": "toggle",
491
+ "ph": "false",
492
+ "tag": "advanced"
493
+ },
494
  {
495
  "g": "Startup",
496
  "icon": "⚑",
start.sh CHANGED
@@ -1438,7 +1438,9 @@ if [ -n "${HUGGINGCLAW_OPENCLAW_PLUGINS:-}" ]; then
1438
  fi
1439
 
1440
  # ── Fix config before running startup commands ──
1441
- openclaw doctor --fix || true
 
 
1442
 
1443
  # ── Arbitrary startup commands from HF Variables/Secrets ──
1444
  # Recommended: use one variable, HUGGINGCLAW_RUN, as a full bash script. If the
@@ -1581,7 +1583,9 @@ while true; do
1581
  fi
1582
  fi
1583
 
1584
- openclaw doctor --fix || true
 
 
1585
  echo "Launching OpenClaw gateway on port 7860..."
1586
 
1587
  GATEWAY_ARGS=(gateway run --port 7860 --bind lan)
@@ -1618,9 +1622,14 @@ while true; do
1618
  echo "Gateway failed to start. Last 30 lines of log:"
1619
  echo "────────────────────────────────────────────"
1620
  tail -30 /home/node/.openclaw/gateway.log
1621
- echo "Gateway failed β€” JupyterLab and env-builder still running. Retrying in 10s..."
1622
- sleep 10
1623
- continue
 
 
 
 
 
1624
  fi
1625
 
1626
  # 11. Start WhatsApp Guardian after the gateway is accepting connections
 
1438
  fi
1439
 
1440
  # ── Fix config before running startup commands ──
1441
+ if [ "${AUTO_DOCTOR:-false}" = "true" ]; then
1442
+ openclaw doctor --fix || true
1443
+ fi
1444
 
1445
  # ── Arbitrary startup commands from HF Variables/Secrets ──
1446
  # Recommended: use one variable, HUGGINGCLAW_RUN, as a full bash script. If the
 
1583
  fi
1584
  fi
1585
 
1586
+ if [ "${AUTO_DOCTOR:-false}" = "true" ]; then
1587
+ openclaw doctor --fix || true
1588
+ fi
1589
  echo "Launching OpenClaw gateway on port 7860..."
1590
 
1591
  GATEWAY_ARGS=(gateway run --port 7860 --bind lan)
 
1622
  echo "Gateway failed to start. Last 30 lines of log:"
1623
  echo "────────────────────────────────────────────"
1624
  tail -30 /home/node/.openclaw/gateway.log
1625
+ if [ "$DEV_MODE_ENABLED" = "true" ]; then
1626
+ echo "Gateway failed β€” DEV_MODE active, retrying in 10s..."
1627
+ sleep 10
1628
+ continue
1629
+ else
1630
+ echo "Gateway failed β€” exiting."
1631
+ exit 1
1632
+ fi
1633
  fi
1634
 
1635
  # 11. Start WhatsApp Guardian after the gateway is accepting connections