Keep OpenClaw's gateway probes off the wizard's terminal

The wizard writes its config while prompts remain, so the watcher starts probing a gateway that is not up yet; each probe hangs until its 10 second timeout, and OpenClaw's CLI, killed by it, takes the terminal it inherited on stdin out of raw mode on the way out. The wizard does not set raw mode again, so from then on its prompts echo keys instead of reading them: the first letter typed at the channel search landed and the next one was printed below the prompt. The probes now read from /dev/null. This is the change reverted earlier on a test that only ever saw probes that exited on their own, never one the timeout killed.
This commit is contained in:
Spencer Bull committed 2026-09-28 01:40:39 -05:00
1 parent de8645490b
commit 9ace84e6c3
2 files changed
+19 -3

No files matched your search

+6 -2
View File
@@ -26,8 +26,12 @@ settle_seconds=${OMARCHY_OPENCLAW_ONBOARD_SETTLE_SECONDS:-3}
# setup; the prompts before that take as long as the user takes.
gateway_timeout=${OMARCHY_OPENCLAW_ONBOARD_GATEWAY_TIMEOUT:-180}
# Probes never get the terminal. The wizard writes its config while prompts
# remain, a probe of a gateway not yet up then hangs until the timeout, and
# OpenClaw's CLI takes a terminal on stdin out of raw mode as it is killed,
# which leaves the wizard's next prompt echoing keys instead of reading them.
gateway_answers() {
timeout 10 openclaw dashboard --json 2>/dev/null | jq -e '.ok == true' >/dev/null 2>&1
timeout 10 openclaw dashboard --json </dev/null 2>/dev/null | jq -e '.ok == true' >/dev/null 2>&1
}
# A gateway already answering means OpenClaw is set up, and this run must not
@@ -81,7 +85,7 @@ config_applied() {
gateway_ready() {
config_applied || return 1
local json port listener main_pid
json=$(timeout 10 openclaw dashboard --json 2>/dev/null) || return 1
json=$(timeout 10 openclaw dashboard --json </dev/null 2>/dev/null) || return 1
jq -e '.ok == true' <<<"$json" >/dev/null 2>&1 || return 1
port=$(jq -r '.port // empty' <<<"$json" 2>/dev/null)
[[ -n $port ]] || return 1