deploy: match Unknown-channel warnings by pipeline format

Agent tool-call echoes also hit this journal and can contain the literal
string; require '| WARNING | - | Unknown channel:' to avoid false
positives in the channel check.

(cherry picked from commit 4c0a1c2812)
This commit is contained in:
nanobot committed 2026-11-22 19:00:13 +08:00
1 parent 84d8e6069f
commit beccb382df
1 file changed
+5 -2
+5 -2
View File
@@ -98,9 +98,12 @@ verify_deps() {
channels_check() { # $1 = since timestamp; 0 if all expected channels are up
local since="$1" journal enabled ch
journal=$(journal_since "$since")
if grep -q "Unknown channel" <<<"$journal"; then
# Match the actual warning-pipeline format, not bare 'Unknown channel' —
# the gateway also logs agent tool calls to this journal, and those echo
# the literal string when the agent greps for it (false positives).
if grep -qF '| WARNING | - | Unknown channel:' <<<"$journal"; then
log "CHANNEL CHECK FAILED: 'Unknown channel' logged since restart:"
grep "Unknown channel" <<<"$journal" | head -3 | sed 's/^/[deploy] /'
grep -F '| WARNING | - | Unknown channel:' <<<"$journal" | head -3 | sed 's/^/[deploy] /'
return 1
fi
enabled=$(grep -o "Channels enabled:.*" <<<"$journal" | tail -1 | sed 's/Channels enabled: *//' || true)