feat(ops): expand command suite with watchdog.alerts, relay.health, and swarm.results
This commit is contained in:
+10
-2
@@ -343,8 +343,13 @@ case "$cmd" in
|
||||
list)
|
||||
call_exec "swarm.list" "{}"
|
||||
;;
|
||||
results)
|
||||
sid="${1:?usage: box swarm results <swarm_id>}"
|
||||
args=$(python3 -c "import json, sys; print(json.dumps({'swarm_id': sys.argv[1]}))" "$sid")
|
||||
call_exec "swarm.results" "$args"
|
||||
;;
|
||||
*)
|
||||
echo "Usage: box swarm spawn|status|list ..."
|
||||
echo "Usage: box swarm spawn|status|results|list ..."
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
@@ -435,7 +440,10 @@ case "$cmd" in
|
||||
call_exec "chrome.errors" "{}"
|
||||
;;
|
||||
watchdog-alerts)
|
||||
call_exec "cdp.latency" "{}"
|
||||
call_exec "watchdog.alerts" "{}"
|
||||
;;
|
||||
relay-health)
|
||||
call_exec "relay.health" "{}"
|
||||
;;
|
||||
ping)
|
||||
call_exec "exec.ping" "{}"
|
||||
|
||||
@@ -456,6 +456,14 @@ def _chrome_errors_build(a):
|
||||
return [sys.executable, os.path.join(BIN_DIR, 'box-ctl.py'), 'chrome-errors']
|
||||
|
||||
|
||||
def _watchdog_alerts_build(a):
|
||||
return [sys.executable, os.path.join(BIN_DIR, 'box-ctl.py'), 'watchdog-alerts']
|
||||
|
||||
|
||||
def _relay_health_build(a):
|
||||
return [sys.executable, os.path.join(BIN_DIR, 'box-ctl.py'), 'relay-health']
|
||||
|
||||
|
||||
def _subagent_spawn_validate(raw):
|
||||
if not isinstance(raw, dict):
|
||||
raise OpError('args must be an object')
|
||||
@@ -888,6 +896,16 @@ OPS = {
|
||||
'timeout': 30, 'side_effecting': False,
|
||||
'desc': 'Scan chrome log files for FATAL/crash/OOM errors since watermark (read-only)',
|
||||
},
|
||||
'watchdog.alerts': {
|
||||
'validate': _health_validate, 'build': _watchdog_alerts_build,
|
||||
'timeout': 30, 'side_effecting': False,
|
||||
'desc': 'Check for new browser relaunch watchdog alerts since watermark (read-only)',
|
||||
},
|
||||
'relay.health': {
|
||||
'validate': _health_validate, 'build': _relay_health_build,
|
||||
'timeout': 30, 'side_effecting': False,
|
||||
'desc': 'Check systemd relay service status across all node ports (read-only)',
|
||||
},
|
||||
'subagent.spawn': {
|
||||
'validate': _subagent_spawn_validate, 'build': _subagent_spawn_build,
|
||||
'timeout': 120, 'side_effecting': True,
|
||||
|
||||
Reference in New Issue
Block a user