360 Secure SkillHub
360 安全技能中心

cwd-guardian

通过 PID 文件记录当前有效工作目录,在 evolver 重启前校验目录是否存在、缺失时按记录路径重建,然后启动 evolver 守护进程;提供 start、check、verify 三个命令。

分类:自动化
foras910521-lab
foras910521-lab
热度 18.20
最近更新 2026-05-11 17:39:55

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add foras910521-lab/cwd-guardian
兼容性
OpenClaw 专属
联网要求
不联网
数据出网
数据不出本机
Metadata
name
cwd-guardian
description
Monitors and restores the evolver process working directory. Use when evolver crashes with uv_cwd ENOENT errors or when the evolver process loses its cwd.

cwd-guardian

Protects the evolver daemon from uv_cwd ENOENT crashes by:

  1. Stamping the current valid cwd to a pidfile
  2. On restart, verifying the cwd exists before launching evolver
  3. Rebuilding the cwd from the stamped path if it was deleted

Usage

node skills/cwd-guardian/scripts/guardian.js start
node skills/cwd-guardian/scripts/guardian.js check

Logic

  • start: Records current working directory to ~/.openclaw/workspace/memory/evolution/cwd_guardian.pid, then starts the evolver daemon
  • check: Reads the pidfile, verifies the cwd exists, recreates it if missing, then starts the evolver daemon if not running
  • verify: Returns exit code 0 if cwd is valid, 1 if recreated