2.2 KiB
2.2 KiB
MAIN_HEARTBEAT.md
Purpose
This file defines the main agent heartbeat. You are not tied to any board.
Required inputs
- BASE_URL (e.g. http://localhost:8000) — see USER.md or TOOLS.md
- AUTH_TOKEN (agent token) — see USER.md or TOOLS.md
- AGENT_NAME
- AGENT_ID
If any required input is missing, stop and request a provisioning update.
API source of truth (OpenAPI)
Use OpenAPI role tags for main-agent endpoints.
curl -s "$BASE_URL/openapi.json" -o /tmp/openapi.json
jq -r '
.paths | to_entries[] | .key as $path
| .value | to_entries[]
| select((.value.tags // []) | index("agent-main"))
| ((.value.summary // "") | gsub("\\s+"; " ")) as $summary
| ((.value.description // "") | split("\n")[0] | gsub("\\s+"; " ")) as $desc
| "\(.key|ascii_upcase)\t\($path)\t\($summary)\t\($desc)"
' /tmp/openapi.json | sort
Mission Control Response Protocol (mandatory)
- All outputs must be sent to Mission Control via HTTP.
- Always include:
X-Agent-Token: $AUTH_TOKEN - Do not respond in OpenClaw chat.
Schedule
- If a heartbeat schedule is configured, send a lightweight check‑in only.
- Do not claim or move board tasks unless explicitly instructed by Mission Control.
- If you have any pending
LEAD REQUEST: ASK USERmessages in OpenClaw chat, handle them promptly (see MAIN_AGENTS.md).
Heartbeat checklist
- Check in:
- Use the
agent-mainheartbeat endpoint (POST /api/v1/agent/heartbeat). - If check-in fails due to 5xx/network, stop and retry next heartbeat.
- During that failure window, do not write memory updates (
MEMORY.md,SELF.md, daily memory files).
Memory Maintenance (every 2-3 days)
- Read recent
memory/YYYY-MM-DD.mdfiles. - Update
MEMORY.mdwith durable facts/decisions. - Update
SELF.mdwith evolving preferences and identity. - Prune stale content.
Common mistakes (avoid)
- Posting updates in OpenClaw chat.
- Claiming board tasks without instruction.
When to say HEARTBEAT_OK
You may say HEARTBEAT_OK only when:
- Heartbeat check-in succeeded, and
- Any pending high-priority gateway-main duty for this cycle was handled (if present), and
- No outage rule was violated (no memory writes during 5xx/network failure window).
Do not say HEARTBEAT_OK if check-in failed.