From 9f27dbd592f0ee020835cd0a4ffe475a8fcc277d Mon Sep 17 00:00:00 2001 From: operator Date: Mon, 5 Oct 2026 01:53:23 +0000 Subject: [PATCH] feat(main-loop): expand fleet dual monitoring to dev, verify box-relay paths and sidechat brain execution --- bin/box-ctl.py | 5 +++-- bin/box-relay.sh | 24 +++++++++++++++++++++--- bin/exec-constrained.py | 8 +++++++- bin/self_main_loop.py | 3 ++- 4 files changed, 33 insertions(+), 7 deletions(-) diff --git a/bin/box-ctl.py b/bin/box-ctl.py index eb806bb..4a796eb 100755 --- a/bin/box-ctl.py +++ b/bin/box-ctl.py @@ -51,9 +51,10 @@ THREAD_OPS = ("list", "pin", "unpin", "archive", "unarchive") # chat unless --allow-main-chat is passed explicitly. NOTIFY_SIDECHATS = { "646": "646 tasks", - "opm": "heartbeat", - "pip": "646-pip-coord", + "opm": "main-loop brain", + "pip": "pip tasks", "muse": "muse tasks", + "dev": "onboarding-dev", } VALID_ON_FAILURE = {"retry", "alert", "ignore"} KNOWN_PLACEHOLDERS = {"job_id", "job_name", "datetime", "date", "last_run"} diff --git a/bin/box-relay.sh b/bin/box-relay.sh index b55d8a5..5c8619d 100755 --- a/bin/box-relay.sh +++ b/bin/box-relay.sh @@ -30,6 +30,10 @@ if [ -z "$AGENT" ]; then AGENT="muse" elif echo "$HOSTNAME" | grep -qi "opm"; then AGENT="opm" + elif echo "$HOSTNAME" | grep -qi "dev"; then + AGENT="dev" + elif echo "$HOSTNAME" | grep -qi "def"; then + AGENT="def" else AGENT="646" fi @@ -71,6 +75,9 @@ except Exception as e: key="$HOME/.ssh/id_ed25519" fi local ident="operator-$AGENT" + if [ "$AGENT" = "super" ]; then + ident="super" + fi local ts ts=$(date +%s) local nonce @@ -212,9 +219,20 @@ case "$cmd" in call_exec "thread.list" "$args" ;; view) - thread_id="${1:?usage: box thread view [limit]}" + target_agent="$AGENT" + while [ $# -gt 0 ]; do + case "$1" in + --agent) target_agent="$2"; shift 2 ;; + *) break ;; + esac + done + if [ $# -ge 2 ] && echo " 646 opm pip muse dev def " | grep -q " $1 "; then + target_agent="$1" + shift + fi + thread_id="${1:?usage: box thread view [] [limit]}" limit="${2:-15}" - args=$(python3 -c "import json, sys; print(json.dumps({'agent': sys.argv[1], 'thread': sys.argv[2], 'limit': int(sys.argv[3])}))" "$AGENT" "$thread_id" "$limit") + args=$(python3 -c "import json, sys; print(json.dumps({'agent': sys.argv[1], 'thread': sys.argv[2], 'limit': int(sys.argv[3])}))" "$target_agent" "$thread_id" "$limit") call_exec "thread.view" "$args" ;; *) @@ -229,7 +247,7 @@ case "$cmd" in call_exec "exec.ping" "{}" ;; ops) - curl -sk -sS "$EXEC_URL/ops" | python3 -m json.tool + curl -sk -sS "${EXEC_URL%/exec}/ops" | python3 -m json.tool ;; help|--help|-h) cat <