← Back to library

把 configure/agents-add 取消退出码改为非 0,避免脚本误判成功

社区修复了向导取消返回 0 的问题,适合用于自动化安装链路,防止 set -e 场景下误继续执行。

GITHUBDiscovered 2026-02-12Author 0xRaini
Prerequisites
  • You use shell scripts/CI jobs to run `openclaw configure` or `openclaw agents add`.
  • Pipeline currently assumes cancel = success or lacks explicit exit-code checks.
Steps
  1. Pin/upgrade OpenClaw to a version that includes the non-zero cancel-exit fix.
  2. Update automation scripts to stop on non-zero and branch into manual recovery path.
  3. Add a test case that intentionally cancels wizard flow and asserts job failure.
  4. Document cancellation behavior in runbooks to reduce operator confusion.
Commands
set -e
openclaw configure
openclaw agents add
Verify

When wizard is cancelled, shell receives non-zero exit and subsequent steps do not execute.

Caveats
  • Exact released version containing this fix should be confirmed from upstream changelog(需验证).
  • Legacy scripts that relied on cancel=0 may need migration.
Source attribution

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

Open original source ↗
Visit original post