Revert "Keep OpenClaw's gateway probes off the wizard's terminal"
The probes do not take the wizard's terminal out of raw mode: a raw pty stays raw across `openclaw dashboard --json`, and the channel search takes keys normally in foot and Ghostty with the probes running, with or without the change. The break seen at the channel prompt has another cause.
This commit is contained in:
1 parent
64e102aaf2
commit
b71b905548
2 files changed
+3
-18
No files matched your search
@@ -26,11 +26,8 @@ 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: OpenClaw's CLI takes a terminal on stdin out
|
||||
# of raw mode as it exits, which would leave the wizard's prompts unable to
|
||||
# read keys, and the wizard can write its config while prompts remain.
|
||||
gateway_answers() {
|
||||
timeout 10 openclaw dashboard --json </dev/null 2>/dev/null | jq -e '.ok == true' >/dev/null 2>&1
|
||||
timeout 10 openclaw dashboard --json 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
|
||||
@@ -84,7 +81,7 @@ config_applied() {
|
||||
gateway_ready() {
|
||||
config_applied || return 1
|
||||
local json port listener main_pid
|
||||
json=$(timeout 10 openclaw dashboard --json </dev/null 2>/dev/null) || return 1
|
||||
json=$(timeout 10 openclaw dashboard --json 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
|
||||
|
||||
@@ -55,7 +55,6 @@ 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
|
||||
@@ -64,10 +63,7 @@ chmod +x "$tmp_dir/bin/openclaw"
|
||||
|
||||
start=$SECONDS
|
||||
rc=0
|
||||
# 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=$?
|
||||
"$ROOT/bin/omarchy-openclaw-onboard" </dev/null >/dev/null 2>&1 || rc=$?
|
||||
elapsed=$((SECONDS - start))
|
||||
|
||||
grep -q '^openclaw:onboard --flow quickstart --install-daemon --skip-ui$' "$TEST_LOG" ||
|
||||
@@ -80,14 +76,6 @@ 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 it exits, 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