From 3f4ac2b24e272b68abe615ca093b5dae35bd5fa5 Mon Sep 17 00:00:00 2001 From: Dai Ha Date: Sun, 23 Aug 2026 14:03:08 +0200 Subject: [PATCH] CB-635: --check reports whether broker.uriEnv resolves in a login shell An empty uriEnv no longer stops the daemon (#152), so the failure is quiet: bridged starts, falls back to the in-memory reply inbox, and held reports stop surviving a restart. --check is the only thing that says so before the fact. The var name is read out of bridged.yaml so a renamed key cannot make the check lie. --- scripts/redeploy-bridged.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/scripts/redeploy-bridged.sh b/scripts/redeploy-bridged.sh index 0f7b796..ae7c511 100755 --- a/scripts/redeploy-bridged.sh +++ b/scripts/redeploy-bridged.sh @@ -179,6 +179,22 @@ else warn "This only matters once a profile points at llm.ltms.dev — harmless before that." fi +# Third variable, same trap (CB-635). broker.uriEnv names the env var holding the AMQP URI, so the +# password stays out of bridged.yaml — but that moves the failure into the environment. If the +# variable is empty the daemon still starts: since #152 it warns and falls back to the in-memory +# reply inbox, so nothing crashes and replies simply stop surviving a restart. Only this check says +# so before the fact. Read the name out of the config so a renamed key cannot make the check lie. +BROKER_URI_ENV=$(sed -n 's/^[[:space:]]*uriEnv:[[:space:]]*\([A-Za-z_][A-Za-z0-9_]*\).*/\1/p' "$BRIDGED/bridged.yaml" | head -1) +if [ -z "$BROKER_URI_ENV" ]; then + ok "no broker.uriEnv configured — reply inbox is in-memory by design" +elif zsh -lc "[ -n \"\${$BROKER_URI_ENV:-}\" ]" 2>/dev/null; then + ok "$BROKER_URI_ENV (broker.uriEnv) resolves in a login shell" +else + warn "$BROKER_URI_ENV (broker.uriEnv) is EMPTY in a login shell." + warn "The daemon will start and fall back to the IN-MEMORY reply inbox." + warn "Replies stop surviving a restart — a held report is lost, not delayed." +fi + if [ "$CHECK_ONLY" = 1 ]; then say "--check: nothing changed" exit 0