Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions bin/baudbot
Original file line number Diff line number Diff line change
Expand Up @@ -369,27 +369,31 @@ print_broker_connection_status() {
local health_summary=""
local connection_state=""
local components_line=""
local bridge_running=0

if ! broker_mode_configured "$agent_user"; then
echo -e "${BOLD}broker connection:${RESET} not configured"
return 0
fi

if [ "$(id -u)" -eq 0 ]; then
sudo -u "$agent_user" tmux has-session -t slack-bridge 2>/dev/null || {
echo -e "${BOLD}broker connection:${RESET} disconnected (bridge tmux session not running)"
return 0
}
if pgrep -u "$agent_user" -f "node broker-bridge.mjs" >/dev/null 2>&1; then
bridge_running=1
fi
elif [ "$(id -un)" = "$agent_user" ]; then
tmux has-session -t slack-bridge 2>/dev/null || {
echo -e "${BOLD}broker connection:${RESET} disconnected (bridge tmux session not running)"
return 0
}
if pgrep -u "$agent_user" -f "node broker-bridge.mjs" >/dev/null 2>&1; then
bridge_running=1
fi
else
echo -e "${BOLD}broker connection:${RESET} configured (run with sudo for runtime status)"
return 0
fi

if [ "$bridge_running" -ne 1 ]; then
echo -e "${BOLD}broker connection:${RESET} disconnected (broker bridge process not running)"
return 0
fi

if [ ! -r "$health_file" ]; then
echo -e "${BOLD}broker connection:${RESET} starting"
echo -e "${BOLD}broker health:${RESET} unavailable (waiting for bridge health file)"
Expand Down
3 changes: 3 additions & 0 deletions bin/doctor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ fi

if command -v varlock &>/dev/null || [ -x "$BAUDBOT_HOME/.varlock/bin/varlock" ]; then
pass "varlock is installed"
if [ -f "$BAUDBOT_HOME/.varlock/config.json" ] && grep -q '"anonymousId"' "$BAUDBOT_HOME/.varlock/config.json"; then
warn "$BAUDBOT_HOME/.varlock/config.json includes anonymousId (export VARLOCK_TELEMETRY_DISABLED=1 or remove this field)"
fi
else
fail "varlock not found"
fi
Expand Down
4 changes: 4 additions & 0 deletions start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ cd ~
# Set PATH
export PATH="$HOME/.varlock/bin:$HOME/opt/node-v22.14.0-linux-x64/bin:$PATH"

# Work around varlock telemetry config crash by opting out at runtime.
# This avoids loading anonymousId from user config and keeps startup deterministic.
export VARLOCK_TELEMETRY_DISABLED=1

# Validate and load secrets via varlock
varlock load --path ~/.config/ || {
echo "❌ Environment validation failed — check ~/.config/.env against .env.schema"
Expand Down