名称: restart-guard
版本: 2.1.0
描述: 具备确定性重启的 OpenClaw 网关守护工具,支持上下线状态机验证、源会话主动确认及向后兼容的配置。
安全重启网关,保留上下文,并确保重启后可主动回报到用户会话。
当任务涉及 OpenClaw 网关重启、看门狗恢复或重启后回报时使用此技能。
自然语言触发(自动执行,无需用户手动运行脚本):
- “可以重启了”
- “现在重启吧”
- “restart now”
- “go ahead and restart”
openclaw CLI 可用。当用户仅表达重启意图且未指定渠道细节时:
- 通过 scripts/auto_restart.py 自动执行全流程。
- 默认 --notify-mode origin。
- 自动推断源会话 key(从环境/上下文/会话中),无需用户额外输入。
- 自动发现外部渠道并持久化 effective_notify_plan。
- 触发前先在源会话预告灾难通知路由与渠道。
- 收到重启事件后,由 net 向用户汇总结果。
python3 <skill-dir>/scripts/discover_channels.py --config <config-path> --json
询问用户:
- 通知模式(推荐 origin,可选 selected、all)
- 若需要,指定渠道与目标
python3 <skill-dir>/scripts/write_context.py \
--config <config-path> \
--reason "config change" \
--verify 'openclaw health --json' 'ok' \
--resume "report restart result to user"
推荐单命令入口:
python3 <skill-dir>/scripts/auto_restart.py \
--config <config-path> \
--reason "配置变更" \
--notify-mode origin
python3 <skill-dir>/scripts/restart.py \
--config <config-path> \
--reason "config change" \
--notify-mode origin \
--origin-session-key <session-key>
选定渠道模式:
python3 <skill-dir>/scripts/restart.py \
--config <config-path> \
--reason "config change" \
--notify-mode selected \
--channel telegram \
--target 726647436
python3 <skill-dir>/scripts/postcheck.py --config <config-path>
restart_guard.result.v1status, restart_idrestart_idorigin_session_keynotify_modechannel_selectioneffective_notify_planstate_timestampsdiagnostics_filedelivery_statusseverityfailure_phaseerror_codedelivery_attemptsdelivery_routedelivery_exhausteddiagnostics_filewebui 不再视为禁用通知;主路径是回发到发起会话。ENHANCED_RESTART_IMPLEMENTATION_SPEC.md。down_detected && start_attempted && up_healthyrestart-diagnostics-<restart_id>.md/json),发送简要摘要,并在预算内重试送达。源会话 -> agent:main:main -> 所有已发现外部渠道。