graceful-restart优雅重启 Gateway。解决重启后丢失会话上下文的问题,重启前设置一次性 cron 任务,重启后自动发送消息到主会话恢复任务。默认 10 秒后唤醒。依赖 openclaw CLI。触发词:重启、restart。
Install via ClawdBot CLI:
clawdbot install scotthuang/graceful-restart当用户要求重启 Gateway 时,自动触发此 skill。
Gateway 重启后,会丢失上一轮会话的任务上下文,导致:
自动执行"重启后自唤醒"流程:
Problem: After Gateway restarts, OpenClaw loses the previous session context - the main session is interrupted and cannot resume automatically.
Solution: Auto-restart Gateway with self-wakeup. Sets a one-time cron task (default 10s) before restart, then sends a message to main session after Gateway recovers to resume tasks.
⚠️ Important: Must use this skill, NOT exec:
# ✅ Correct
node ~/.openclaw/workspace/skills/graceful-restart/graceful-restart.js --task "config changed"
# ❌ Wrong
exec openclaw gateway restart # Don't do this!
Trigger: "重启", "restart Gateway"
用户说"重启"时,自动执行:
[自动触发 graceful-restart skill]
或者用户可以指定任务:
重启 Gateway,继续之前的任务:安装 Python 包
node ~/.openclaw/workspace/skills/graceful-restart/graceful-restart.js
node ~/.openclaw/workspace/skills/graceful-restart/graceful-restart.js --task "继续安装 Python 包"
node ~/.openclaw/workspace/skills/graceful-restart/graceful-restart.js --task "继续安装 Python 包" --delay 60
使用 --session main + --system-event:
--delete-after-run 确保一次性任务自动清理使用此 skill 后,建议在 SOUL.md 中添加自动触发规则(见上方)。
Gateway 重启必须使用此 skill,禁止直接用 exec 执行:
✅ 正确:
node ~/.openclaw/workspace/skills/graceful-restart/graceful-restart.js --task "配置已修改,需要重启后生效"
❌ 错误:
exec openclaw gateway restart # 禁止!
这样写
Generated Mar 1, 2026
During software deployment, configuration changes require Gateway restarts. This skill ensures automated restarts without losing session context, allowing seamless continuation of deployment tasks like package installations or service updates.
For system administrators managing Gateway instances, this skill facilitates scheduled maintenance restarts. It prevents interruption of ongoing monitoring or troubleshooting sessions, enabling automatic resumption of tasks post-restart.
In cloud environments, Gateway instances may need restarts for updates or scaling. This skill maintains session continuity, allowing cloud engineers to resume configuration or automation workflows without manual intervention after restarts.
Developers testing AI agents integrated with Gateway can use this skill to restart the Gateway during debugging. It preserves session contexts for tasks like model training or API testing, reducing downtime and manual reinitialization.
Offer this skill as part of a premium subscription for DevOps tools. Charge monthly fees for features like customizable delay times and advanced session recovery, targeting enterprises with frequent Gateway usage.
Sell perpetual licenses to large organizations for integrating the skill into their internal systems. Include support and customization services, such as adapting to specific session management protocols.
Provide a basic version for free with default settings, then monetize through add-ons like extended delay options, multi-session support, or analytics dashboards for monitoring restart efficiency.
💬 Integration Tip
Ensure the openclaw CLI is properly installed and configured before use, and test the skill in a staging environment to verify session recovery works as expected.
Transform AI agents from task-followers into proactive partners that anticipate needs and continuously improve. Now with WAL Protocol, Working Buffer, Autonomous Crons, and battle-tested patterns. Part of the Hal Stack 🦞
Use the ClawdHub CLI to search, install, update, and publish agent skills from clawdhub.com. Use when you need to fetch new skills on the fly, sync installed skills to latest or a specific version, or publish new/updated skill folders with the npm-installed clawdhub CLI.
Clawdbot documentation expert with decision tree navigation, search scripts, doc fetching, version tracking, and config snippets for all Clawdbot features
Interact with Moltbook social network for AI agents. Post, reply, browse, and analyze engagement. Use when the user wants to engage with Moltbook, check their feed, reply to posts, or track their activity on the agent social network.
OpenClaw CLI wrapper — gateway, channels, models, agents, nodes, browser, memory, security, automation.
MoltGuard — runtime security plugin for OpenClaw agents by OpenGuardrails. Helps users install, register, activate, and check the status of MoltGuard. Use wh...