Lightweight pull-based daemon that monitors sub-agent health. Writes a status file every N seconds. The heartbeat handler reads it — no push, no noise.
overseer.sh (bash, runs in background)
├── /proc/<pid> → gateway alive? CPU? threads?
├── openclaw sessions list → sub-agent count + ages
├── find -newer marker → filesystem activity
└── writes /tmp/overseer/status.json (atomic mv)
heartbeat (agent, every 3min)
└── reads /tmp/overseer/status.json → summarize or HEARTBEAT_OK
Key principle: The overseer does all data collection. The heartbeat handler does zero tool calls if the status file is fresh and healthy.
setsid scripts/overseer.sh \
--workdir /path/to/repo \
--interval 180 \
--max-stale 4 \
--voice \
&>/dev/null &
cat /tmp/overseer/status.json
| Field | Meaning |
|---|---|
| --- | --- |
subagents.count | Active sub-agent sessions |
subagents.details[].stale | Consecutive cycles with no filesystem changes |
subagents.details[].status | active / idle / warning / stuck |
gateway.health.alive | Is openclaw-gateway running? |
filesystem.changes_since_last | Files modified since last check |
| stale count | Time | Status | Action |
|---|---|---|---|
| --- | --- | --- | --- |
| 0-1 | 0-3 min | active/idle | Normal |
| 2-3 | 6-9 min | warning | Voice alert (if --voice) |
| ≥4 | ≥12 min | stuck | Agent should investigate/kill |
When HEARTBEAT.md fires:
/tmp/overseer/status.json — if missing or stale (>10 min), restart overseersubagents.count == 0 for 2+ cycles → overseer auto-exits → reply HEARTBEAT_OKactive → brief one-line status → HEARTBEAT_OKstuck → report which labels are stuck → consider killing via subagents kill| Flag | Default | Description |
|---|---|---|
| --- | --- | --- |
--interval | 180 | Seconds between checks |
--workdir | cwd | Directory to watch for file changes |
--labels | (all) | Comma-separated labels to filter |
--max-stale | 4 | Cycles before marking stuck |
--voice | off | Local TTS alerts via jarvis command |
/proc//status for CPU, memory, threads, FD count. Pure kernel data.openclaw sessions list call per cycle. Parses grep output.find -newer marker — detects any file writes in the workdir.mv into place). Any reader sees a complete file.flock ensures only one overseer instance runs at a time.jarvis)cat command)👉 https://github.com/globalcaos/tinkerclaw
_Clone it. Fork it. Break it. Make it yours._
共 3 个版本