Files
MATTERMOST_OPENCLAW_LIVESTATUS/hooks/status-watcher-hook/HOOK.md
sol 868574d939 fix: remove dead delete+recreate and pin code, add poll fallback test
Phase 1 cleanup:
- Remove deletePost() method (dead code, replaced by PUT in-place updates)
- Remove _postInfo Map tracking (no longer needed)
- Remove pin/unpin API calls from watcher-manager.js (incompatible with PUT updates)
- Add JSDoc note on (edited) label limitation in _flushUpdate()
- Add integration test: test/integration/poll-fallback.test.js
- Fix addSession() lastOffset===0 falsy bug (0 was treated as 'no offset')
- Fix pre-existing test failures: add lastOffset:0 where tests expect backlog reads
- Fix pre-existing session-monitor test: create stub transcript files
- Fix pre-existing status-formatter test: update indent check for blockquote format
- Format plugin/ files with Prettier (pre-existing formatting drift)
2026-03-07 20:31:32 +00:00

1.4 KiB

name, description, metadata
name description metadata
status-watcher-hook Auto-starts the Live Status v4 watcher daemon on gateway startup
openclaw
emoji events
📡
gateway:startup

status-watcher-hook

Auto-starts the Live Status v4 daemon when the OpenClaw gateway starts.

Description

On gateway startup, this hook checks whether the status-watcher daemon is already running (via PID file). If not, it spawns watcher-manager.js start as a detached background process, then exits immediately. The daemon continues running independently of this hook handler.

Required Environment Variables

The following environment variables must be set for the watcher to function:

MM_BOT_TOKEN     Mattermost bot token
MM_BASE_URL      Mattermost base URL (e.g. https://slack.solio.tech)

Optional (defaults shown):

TRANSCRIPT_DIR            /home/node/.openclaw/agents
THROTTLE_MS               500
IDLE_TIMEOUT_S            60
MAX_STATUS_LINES          20
MAX_ACTIVE_SESSIONS       20
MAX_MESSAGE_CHARS         15000
HEALTH_PORT               9090
LOG_LEVEL                 info
PID_FILE                  /tmp/status-watcher.pid
CIRCUIT_BREAKER_THRESHOLD 5
CIRCUIT_BREAKER_COOLDOWN_S 30

Installation

This hook is deployed automatically by install.sh or deploy-to-agents.sh. To deploy manually:

cp -r hooks/status-watcher-hook /home/node/.openclaw/workspace/hooks/

The hook activates on the next gateway startup.