Install
openclaw skills install openclaw-rescue-gateway-skill为 OpenClaw 配置稳定可维护的 Rescue Gateway。适用于主 Gateway 已存在、需要第二个 Discord Rescue Bot、需要独立端口和独立 launchd label、需要避免主 gateway stop 误伤 rescue gateway、需要默认 full exec 权限且不...
openclaw skills install openclaw-rescue-gateway-skill当主 Gateway 故障时,Rescue Gateway 提供独立入口。此版本的目标不是“能跑起来”,而是“能长期维护,不和主 Gateway 互相干扰”。
OpenClaw Rescue Bot19001openclaw gateway stop 把 rescue 一起停掉Rescue Gateway 的推荐落地方式是:
~/.openclaw-rescue/openclaw.jsonopenclaw --profile rescue ...ai.openclaw.rescueai.openclaw.gateway.rescue原因:
gateway stop 可能和主 gateway 生命周期串扰| 项目 | 主 Gateway | Rescue Gateway |
|---|---|---|
| Config | ~/.openclaw/openclaw.json | ~/.openclaw-rescue/openclaw.json |
| State | ~/.openclaw | ~/.openclaw-rescue |
| Workspace | ~/.openclaw/workspace | ~/.openclaw-rescue/workspace |
| Port | 18789 | 19001 |
| launchd label | ai.openclaw.gateway | ai.openclaw.gateway.rescue |
端口必须至少错开 20。OpenClaw 会派生浏览器和调试端口,不能重叠。
优先做法:以主配置为模板,写入 ~/.openclaw-rescue/openclaw.json。
关键要求:
channels.discord.token 使用 Rescue Bot tokengateway.port 使用 19001agents.defaults.workspace 使用 ~/.openclaw-rescue/workspaceagents.list[0].agentDir 使用 ~/.openclaw-rescue/agents/rescue/agenttools.exec.security = "full"tools.exec.ask = "off"agents.defaults.elevatedDefault = "full"plugins.entries.acpx.enabled = trueplugins.entries.acpx.config.permissionMode = "approve-all"最小关键片段:
{
"agents": {
"defaults": {
"elevatedDefault": "full",
"workspace": "/Users/YOUR_NAME/.openclaw-rescue/workspace"
},
"list": [
{
"id": "rescue",
"workspace": "/Users/YOUR_NAME/.openclaw-rescue/workspace",
"agentDir": "/Users/YOUR_NAME/.openclaw-rescue/agents/rescue/agent",
"subagents": { "allowAgents": ["*"] }
}
]
},
"bindings": [
{
"agentId": "rescue",
"match": { "channel": "discord" }
}
],
"tools": {
"profile": "full",
"exec": {
"security": "full",
"ask": "off"
}
},
"channels": {
"discord": {
"enabled": true,
"token": "YOUR_RESCUE_BOT_TOKEN"
}
},
"gateway": {
"port": 19001,
"mode": "local",
"bind": "loopback",
"auth": {
"mode": "token",
"token": "YOUR_RESCUE_GATEWAY_TOKEN"
}
},
"plugins": {
"entries": {
"acpx": {
"enabled": true,
"config": {
"permissionMode": "approve-all"
}
}
}
}
}
Rescue agent 使用独立 agentDir,不会自动继承主 agent 的认证。
如果 rescue bot 能登录 Discord,但回复时报:
No API key found for provider "anthropic"No API key found for provider "kimi-coding"就把主 agent 的认证复制过去:
cp ~/.openclaw/agents/main/agent/auth-profiles.json \
~/.openclaw-rescue/agents/rescue/agent/auth-profiles.json
chmod 600 ~/.openclaw-rescue/agents/rescue/agent/auth-profiles.json
不要用官方默认 profile service label。
使用自定义 plist:
~/Library/LaunchAgents/ai.openclaw.gateway.rescue.plistai.openclaw.gateway.rescue--profile rescue gateway --port 19001OPENCLAW_PROFILE=rescueOPENCLAW_STATE_DIR=~/.openclaw-rescueOPENCLAW_CONFIG_PATH=~/.openclaw-rescue/openclaw.jsonOPENCLAW_LAUNCHD_LABEL=ai.openclaw.gateway.rescue关键原因:
openclaw gateway stop 误伤 rescue加载 rescue:
launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/ai.openclaw.gateway.rescue.plist
launchctl enable gui/$(id -u)/ai.openclaw.gateway.rescue
launchctl kickstart -k gui/$(id -u)/ai.openclaw.gateway.rescue
验证:
OPENCLAW_LAUNCHD_LABEL=ai.openclaw.gateway.rescue \
openclaw --profile rescue gateway status
tail -f ~/.openclaw-rescue/logs/gateway.log
成功标志:
[discord] logged in to discord as XXXXX (OpenClaw Rescue Bot)
主 gateway:
openclaw gateway stop
openclaw gateway start
openclaw gateway restart
openclaw gateway status
rescue gateway:
OPENCLAW_LAUNCHD_LABEL=ai.openclaw.gateway.rescue \
openclaw --profile rescue gateway stop
OPENCLAW_LAUNCHD_LABEL=ai.openclaw.gateway.rescue \
openclaw --profile rescue gateway start
OPENCLAW_LAUNCHD_LABEL=ai.openclaw.gateway.rescue \
openclaw --profile rescue gateway restart
OPENCLAW_LAUNCHD_LABEL=ai.openclaw.gateway.rescue \
openclaw --profile rescue gateway status
如果只是 emergency 操作,直接用 launchctl 也可以:
launchctl bootout gui/$(id -u) ~/Library/LaunchAgents/ai.openclaw.gateway.rescue.plist
launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/ai.openclaw.gateway.rescue.plist
openclaw --profile rescue config validate
OPENCLAW_LAUNCHD_LABEL=ai.openclaw.gateway.rescue \
openclaw --profile rescue gateway status
tail -f ~/.openclaw-rescue/logs/gateway.log
tail -f ~/.openclaw-rescue/logs/gateway.err.log
~/.openclaw/openclaw-rescue.json 收口到官方 profile 路径 ~/.openclaw-rescue/openclaw.json~/.openclaw/workspace-rescue 收口到 ~/.openclaw-rescue/workspaceauth-profiles.json 到 rescue agentDirtools.exec.security = "full"tools.exec.ask = "off"agents.defaults.elevatedDefault = "full"plugins.entries.acpx.config.permissionMode = "approve-all"ai.openclaw.gateway.rescue~/.openclaw/openclaw-rescue.json,没有和官方 profile 目录对齐,后续 CLI 管理不统一~/.openclaw/workspace-rescue,workspace 和 profile state 分裂auth-profiles.json,导致模型认证缺失plugins.entries.acpx 配置缺失或不完整,导致执行行为与预期不一致--profile rescue 的关系launchctl unload,不适合当前 OpenClaw 的 service 生命周期openclaw gateway stop 只适合主 gatewayai.openclaw.gateway.rescueopenclaw --profile rescue ... 仍然用于 rescue 的配置、状态和 CLI 操作