凌晨3点,你的 Agent 突然罢工了。别慌,这篇手册就是你的救命稻草。实战问题,逐一击破。
# 清除缓存重试
npm cache clean --force
npm install -g openclaw@latest
# 如果权限不够
sudo npm install -g openclaw@latest
# 或者用 pnpm
pnpm install -g openclaw@latest# 检查安装路径
which openclaw
npm list -g openclaw
# 手动添加到 PATH
export PATH="$PATH:$(npm prefix -g)/bin"
echo 'export PATH="$PATH:$(npm prefix -g)/bin"' >> ~/.bashrc# 检查 Gateway 状态
openclaw gateway status
# 查看日志
journalctl -u openclaw -f
# 检查端口占用
lsof -i :3000
# 重启 Gateway
openclaw gateway restart# 热重载(推荐)
openclaw gateway reload
# 完全重启
openclaw gateway restart
# 验证配置
openclaw config validate# 1. 刷新 Skill 列表
openclaw skills refresh
# 2. 检查 Skill 状态
openclaw skills check
# 3. 重启 Gateway
openclaw gateway restart# 调整超时设置
openclaw config set skills.timeout 120000
# 或在 SKILL.md 中指定 timeout: 120s# 配置自动重试
openclaw config set models.retry.maxAttempts 5
openclaw config set models.retry.backoffMs 2000
# 配置模型降级
openclaw config set models.fallback.enabled true
openclaw config set models.fallback.chain "gpt-4o,claude-sonnet,gemini-pro"# 查看当前模型配置
openclaw config get models
# 调整温度
openclaw config set models.temperature 0.7
# 使用更强的模型
openclaw config set models.default "claude-opus-4"# 配置镜像源
openclaw config set registry.mirror "https://clawhub-mirror.example.com"
# 或使用代理
export HTTPS_PROXY=http://127.0.0.1:7890# 查看性能指标
openclaw status --verbose
# 清理缓存
openclaw cache clear
# 减少并发
openclaw config set concurrency.max 5
# 启用响应缓存
openclaw config set cache.enabled true~/.openclaw/ 目录,特别是 agents/ 和 config/ 子目录。