feat(join-hive): confirm the auto-spawned Pi after daemon restart

Per Hermes' review of the cred-capture flow: after the daemon restart that
loads the pulled keys, poll colibri status (up to 10s) for a live agent so the
operator sees confirmation that the Pi auto-spawn actually came up — instead of
just "daemon restarted". Prints "Pi agent is live." or a check hint.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Sam & Claude 2026-06-21 18:59:15 +02:00
parent f9e47ab516
commit 34259e3312

View file

@ -155,6 +155,19 @@ if provider_env_has_bw_creds; then
sleep 1
_t=$(( _t + 1 ))
done
# Confirm the auto-spawned Pi came up (colibri auto-spawn on boot).
if have colibri; then
_p=0
while [ "$_p" -lt 10 ]; do
if colibri --socket "$SOCKET" status 2>/dev/null | grep -q '"agents":[1-9]'; then
echo " Pi agent is live."
break
fi
sleep 1
_p=$(( _p + 1 ))
done
[ "$_p" -lt 10 ] || echo " NOTE: no Pi agent yet — check: colibri status"
fi
else
echo " WARNING: daemon restart failed."
echo " Run: mdo -u root service colibri_daemon restart"