Merge f1354e813ed9ccf4e688b08b391fc74b5c92d054 into 598f1826d8b2bc969aace2c6459824737667218c

This commit is contained in:
w-sss 2026-03-21 12:40:20 +08:00 committed by GitHub
commit da2e4345df
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2243,6 +2243,45 @@ refresh_gateway_service_if_loaded() {
run_quiet_step "Probing gateway service" "$claw" gateway status --deep || true
}
install_gateway_daemon_if_needed() {
if [[ "${SKIP_GATEWAY_DAEMON:-0}" == "1" ]]; then
ui_info "Skipping gateway daemon installation (SKIP_GATEWAY_DAEMON=1)"
return 0
fi
local claw="${OPENCLAW_BIN:-}"
if [[ -z "$claw" ]]; then
claw="$(resolve_openclaw_bin || true)"
fi
if [[ -z "$claw" ]]; then
ui_info "Skipping gateway daemon install (openclaw not on PATH yet)"
return 0
fi
if is_gateway_daemon_loaded "$claw"; then
ui_info "Gateway daemon already installed; skipping install"
return 0
fi
ui_info "Installing gateway daemon service"
if run_quiet_step "Installing gateway daemon" "$claw" daemon install; then
ui_success "Gateway daemon service installed"
else
ui_warn "Gateway daemon install failed; user can run 'openclaw daemon install' manually"
return 0
fi
if run_quiet_step "Starting gateway daemon" "$claw" daemon start; then
ui_success "Gateway daemon service started"
else
ui_warn "Gateway daemon start failed; user can run 'openclaw daemon start' manually"
return 0
fi
sleep 2
run_quiet_step "Probing gateway daemon" "$claw" daemon status --deep || true
}
verify_installation() {
if [[ "${VERIFY_INSTALL}" != "1" ]]; then
return 0
@ -2400,7 +2439,13 @@ main() {
fi
fi
refresh_gateway_service_if_loaded
# Install gateway daemon for fresh installs (not upgrades)
if [[ "$is_upgrade" != "true" ]]; then
install_gateway_daemon_if_needed
else
# Only refresh gateway service on upgrades (not fresh installs)
refresh_gateway_service_if_loaded
fi
# Step 6: Run doctor for migrations on upgrades and git installs
local run_doctor_after=false