← Back to library

设备配对清理实战:用 `openclaw devices remove/clear` 降低失效配对噪音

问题/场景:长期运行后会累积失效或重复配对记录,影响排障与审计。前置条件:已升级到包含 v2026.2.19 设备清理命令的版本,且有 CLI 管理权限。实施步骤:先盘点设备,再按单设备移除,最后在确认无误后批量 clear 并拒绝 pending。关键命令:`openclaw devices remove`、`openclaw devices clear --yes --pending`。验证:`openclaw devices` 输出仅保留有效设备。风险与边界:批量清理不可逆,生产环境需先导出清单。来源:OpenClaw v2026.2.19 release notes。

GITHUBDiscovered 2026-02-21Author steipete
Prerequisites
  • OpenClaw is upgraded to v2026.2.19 or later and CLI can manage devices.
  • You can identify active vs stale paired devices before cleanup.
Steps
  1. Run device listing and mark candidates as `active`, `stale`, or `pending`.
  2. Use single-device remove for stale records first to validate your classification logic.
  3. After manual spot-check, run guarded clear with `--yes` and optional `--pending` as needed.
  4. Re-run listing and confirm all expected active devices can still receive invoke/notifications.
Commands
openclaw devices
openclaw devices remove <deviceId>
openclaw devices clear --yes --pending
Verify

Device inventory becomes minimal and clean, while active devices continue to pair and respond normally.

Caveats
  • `clear --yes` is destructive for pairing records; keep a rollback note before execution.
  • Command flags may evolve; verify exact syntax with local `openclaw help` in your installed version(需验证).
Source attribution

This tip is aggregated from community/public sources and preserved with attribution.

Open original source ↗
Visit original post