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:
1 parent
de8645490b
commit
9ace84e6c3
2 files changed
+19
-3
No files matched your search
@@ -55,6 +55,7 @@ onboard)
|
||||
while :; do sleep 0.2; done
|
||||
;;
|
||||
dashboard)
|
||||
printf 'dashboard-stdin:%s\n' "$(readlink /proc/$$/fd/0)" >>"$TEST_LOG"
|
||||
[[ -f $HOME/.openclaw/openclaw.json ]] && echo '{"ok":true,"port":18789}' || { echo '{"ok":false}'; exit 1; }
|
||||
;;
|
||||
esac
|
||||
@@ -63,7 +64,10 @@ chmod +x "$tmp_dir/bin/openclaw"
|
||||
|
||||
start=$SECONDS
|
||||
rc=0
|
||||
"$ROOT/bin/omarchy-openclaw-onboard" </dev/null >/dev/null 2>&1 || rc=$?
|
||||
# A file stands in for the terminal the wizard reads, so where each probe's
|
||||
# stdin points can be told apart from it.
|
||||
: >"$tmp_dir/terminal"
|
||||
"$ROOT/bin/omarchy-openclaw-onboard" <"$tmp_dir/terminal" >/dev/null 2>&1 || rc=$?
|
||||
elapsed=$((SECONDS - start))
|
||||
|
||||
grep -q '^openclaw:onboard --flow quickstart --install-daemon --skip-ui$' "$TEST_LOG" ||
|
||||
@@ -76,6 +80,14 @@ grep -q '^terminated$' "$TEST_LOG" ||
|
||||
(( elapsed < 30 )) || fail "a wizard that lingers after the gateway is up is stopped and counts as success" "took ${elapsed}s"
|
||||
pass "a wizard that lingers after the gateway is up is stopped and counts as success"
|
||||
|
||||
# OpenClaw's CLI takes a terminal on stdin out of raw mode as the timeout kills
|
||||
# it, so a probe that inherited the wizard's terminal would leave its prompts
|
||||
# unable to read keys. The wizard writes its config while prompts remain.
|
||||
grep -q '^dashboard-stdin:' "$TEST_LOG" || fail "gateway probes never read from the wizard's terminal" "no probe ran"
|
||||
! grep '^dashboard-stdin:' "$TEST_LOG" | grep -vqx 'dashboard-stdin:/dev/null' ||
|
||||
fail "gateway probes never read from the wizard's terminal" "$(grep '^dashboard-stdin:' "$TEST_LOG" | sort -u)"
|
||||
pass "gateway probes never read from the wizard's terminal"
|
||||
|
||||
# The wizard only starts being stopped once the gateway actually answers: a
|
||||
# stub that never writes the config is left alone and must be ended by its own
|
||||
# exit, not the watcher.
|
||||
|
||||
Reference in new issue
Block a user