# Send Gateway Watchdog to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "gateway-watchdog",
    "name": "Gateway Watchdog",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/guoqunabc/gateway-watchdog",
    "canonicalUrl": "https://clawhub.ai/guoqunabc/gateway-watchdog",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/gateway-watchdog",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=gateway-watchdog",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "SKILL.md",
      "scripts/gateway-watchdog.sh"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/gateway-watchdog"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/gateway-watchdog",
    "downloadUrl": "https://openagent3.xyz/downloads/gateway-watchdog",
    "agentUrl": "https://openagent3.xyz/skills/gateway-watchdog/agent",
    "manifestUrl": "https://openagent3.xyz/skills/gateway-watchdog/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/gateway-watchdog/agent.md"
  }
}
```
## Documentation

### Gateway Watchdog

Detect abnormal error patterns in the OpenClaw Gateway before they cause damage. Works with all channels: Telegram, WhatsApp, Discord, Slack, Signal, iMessage, Feishu, and more.

Born from a real incident: a silent try-catch caused 76,744 failed retries in 8 hours — undetected until the API quota was exhausted.

### What It Detects

CategoryPatternsRate limitingHTTP 429, rate.limit, too many requestsServer errorsHTTP 5xx status codesAuth/permissionHTTP 401/403, unauthorized, forbidden, token expiredNetwork errorsETIMEDOUT, ECONNREFUSED, ECONNRESET, ENOTFOUND, socket hang upDelivery failuressendMessage failed, deliver failed, fetch failedCustomUser-defined via WATCHDOG_EXTRA_PATTERNS env var

### Smart Analysis

Error rate (errors/min) — more meaningful than raw count
Spike detection — alerts when errors jump 3x+ vs last check
Error concentration — flags when 80%+ errors are one type (single fault source)

### Quick Start

bash scripts/gateway-watchdog.sh check     # silent unless errors exceed threshold
bash scripts/gateway-watchdog.sh verbose   # always outputs full report
bash scripts/gateway-watchdog.sh history   # show monitoring history
bash scripts/gateway-watchdog.sh trend     # last 24h error trend

### Heartbeat integration

Add to HEARTBEAT.md:

## Gateway Error Monitoring (every heartbeat)
- Run \`~/.openclaw/workspace/skills/gateway-watchdog/scripts/gateway-watchdog.sh check\`
- If output is non-empty, report to user immediately
- No output = healthy, skip reporting

### Cron (optional)

openclaw cron add \\
  --name "gateway-watchdog" \\
  --schedule "*/30 * * * *" \\
  --task "Run gateway-watchdog.sh verbose. If errors detected, notify user with the report." \\
  --channel last

### Configuration

All via environment variables:

VariableDefaultDescriptionWATCHDOG_THRESHOLD30Error count that triggers alertWATCHDOG_WINDOW30Monitoring window in minutesWATCHDOG_SPIKE_RATIO3Alert when errors jump Nx vs last checkWATCHDOG_EXTRA_PATTERNS(empty)Custom regex patterns (e.g., 99991400|99991403)WATCHDOG_STATE~/.local/state/gateway-watchdog/state.jsonState fileWATCHDOG_LOG~/.local/state/gateway-watchdog/history.logHistory log

### Adding channel-specific patterns

# Feishu-specific error codes
export WATCHDOG_EXTRA_PATTERNS='99991400|99991403|99991404|99991429'

# Telegram-specific
export WATCHDOG_EXTRA_PATTERNS='Too Many Requests|FLOOD_WAIT|bot was blocked'

# Discord-specific
export WATCHDOG_EXTRA_PATTERNS='DiscordAPIError|Missing Permissions|Unknown Channel'

### 🔴 Alert (Chinese locale)

🔴 Gateway 最近 30 分钟出现 150 条异常错误（阈值: 30，5/min）
📈 错误突增: 12 → 150（3倍阈值触发）

错误分类：
  429/限流: 120
  5xx服务端错误: 5
  认证/权限: 0
  网络错误: 5
  消息投递失败: 20

  ⚠️  单一错误类型「429/限流」占比 80%，可能是单一故障源

### 🔴 Alert (English equivalent)

🔴 Gateway detected 150 errors in the last 30 min (threshold: 30, 5/min)
📈 Error spike: 12 → 150 (3x threshold triggered)

Error breakdown:
  429/Rate-limit: 120
  5xx Server errors: 5
  Auth/Permission: 0
  Network errors: 5
  Delivery failures: 20

  ⚠️  Single error type "429/Rate-limit" accounts for 80%+ — likely a single fault source

### 💚 Healthy

No output from check mode.

### Limitations

Requires systemd + journalctl (falls back to ~/.openclaw/logs/ on macOS)
Reactive, not preventive
Cannot pinpoint which extension is failing — check error details for clues

### Security

Read-only: Only reads logs
No credentials: No API keys accessed
No network: No outbound requests
User state only: State in ~/.local/state/gateway-watchdog/ (XDG standard, no elevated permissions needed)
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: guoqunabc
- Version: 1.4.0
## Source health
- Status: healthy
- Source download looks usable.
- Yavira can redirect you to the upstream package for this source.
- Health scope: source
- Reason: direct_download_ok
- Checked at: 2026-04-30T16:55:25.780Z
- Expires at: 2026-05-07T16:55:25.780Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/gateway-watchdog)
- [Send to Agent page](https://openagent3.xyz/skills/gateway-watchdog/agent)
- [JSON manifest](https://openagent3.xyz/skills/gateway-watchdog/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/gateway-watchdog/agent.md)
- [Download page](https://openagent3.xyz/downloads/gateway-watchdog)