From 23d0a68d7bd1557c8188024eef4ac55981aa5a24 Mon Sep 17 00:00:00 2001 From: Michael Sitarzewski Date: Tue, 29 Sep 2026 17:53:28 -0500 Subject: [PATCH] fix(openclaw): one failed registration no longer costs the others #915 made registration failures visible (main swallowed them with `|| true` and reported success). But it returned at the first failure, so every agent after it went unregistered. In real OpenClaw 2026.9.6 with one registration forced to fail, batch 2 registered only 1 of the 2 agents that could have succeeded. Keep registering the rest, name every failure in one message at the end, and still exit non-zero. Verified against real OpenClaw (node:24, official npm package): the failure case now registers both good agents and exits 1; the normal install and the re-run are unchanged. #915's own test still passes. Co-Authored-By: Claude Opus 5.5 (1M context) --- scripts/install.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/install.sh b/scripts/install.sh index f6ad61f9..f8ccb7fa 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -954,6 +954,7 @@ install_openclaw() { local dest; dest="$(resolve_dest openclaw "${HOME}/.openclaw/agency-agents")" local count=0 local existing_agents="" + local failed_names="" # a string, not an array: bash 3.2 + set -u rejects "${empty[@]}" [[ -d "$src" ]] || { err "integrations/openclaw missing. Run convert.sh first."; return 1; } mkdir -p "$dest" if command -v openclaw >/dev/null 2>&1; then @@ -980,7 +981,9 @@ install_openclaw() { if [[ "$existing_agents" != *$'\n'"$name"$'\n'* ]]; then if ! openclaw agents add "$name" --workspace "$dest/$name" --non-interactive; then err "OpenClaw: failed to register '$name'; the copied workspace is not active." - return 1 + # Keep registering the rest: one bad registration must not cost the others. + failed_names="${failed_names:+$failed_names }$name" + continue fi fi fi @@ -994,6 +997,10 @@ install_openclaw() { if command -v openclaw >/dev/null 2>&1; then warn "OpenClaw: run 'openclaw gateway restart' to activate new agents" fi + if [[ -n "$failed_names" ]]; then + err "OpenClaw: not registered: $failed_names. Their workspaces are copied; re-run to retry registration." + return 1 + fi } install_cursor() {