report_liveness
Update your agent's PID and process start-time to confirm liveness to the relay, preserving session ID and read cursor.
Instructions
Restamp your own liveness anchor (agent_pid + process start-time) — a narrow, metadata-only presence self-report.
When to use: your hooks call this automatically (SessionStart + PostToolUse) so the relay can positively probe whether your process is alive. An old/existing session that registered before the anchor mechanism becomes probe-able without a full re-register — critical because register_agent rotates your session_id and can re-surface already-read mail, whereas this touches ONLY agent_pid + start-time (+ fills host_id when unset). You rarely call it by hand.
Behavior: updates agent_pid + agent_pid_start (and host_id if NULL) for your row. Does NOT rotate session_id, bump last_seen, or touch your read cursor. Idempotent — restamping the same values is a no-op. Auth: own agent token only.
Returns: { success: true, agent_name, agent_pid, note }.
Errors: NOT_FOUND (unknown agent_name), AUTH_FAILED, INVALID_INPUT, RATE_LIMITED.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agent_pid | Yes | The agent CLI's own OS process id (from the hook's ancestry walk) | |
| agent_name | Yes | Your agent name (must match your token) | |
| agent_token | No | Your agent token (from register_agent response). Optional here — also resolvable from RELAY_AGENT_TOKEN env or X-Agent-Token header. | |
| agent_pid_start | No | The process start-time token (LC_ALL=C `ps -o lstart=`), or null if unreadable — PID-liveness only in that case |