fix(guanghu-os): accept healthy code projection responses

This commit is contained in:
冰朔 2026-08-16 01:21:09 +08:00
commit 8c2e11201e
2 changed files with 4 additions and 3 deletions

View file

@ -62,7 +62,7 @@ wait_http() {
local code
for ((i=0; i<attempts; i++)); do
code=$(/usr/bin/curl -sS -o /dev/null -w '%{http_code}' --max-time 2 "${url}" 2>/dev/null || true)
[[ $code == "$expected" ]] && { log "READY ${name} http=${code}"; return 0; }
[[ ",$expected," == *",$code,"* ]] && { log "READY ${name} http=${code}"; return 0; }
sleep 1
done
fatal "service_not_ready:${name}:last_http_${code:-none}"
@ -136,7 +136,7 @@ start_bridge() {
CODE_CHANNEL_PORT=3340 CODE_RATE_LIMIT_MAX=600 CODE_BROWSE_RATE_LIMIT_MAX=120 \
/usr/bin/node "$APP_HUB"
wait_http app-hub http://127.0.0.1:8088/api/status 200 30
wait_http code-projection http://127.0.0.1:8088/code/ 303 30
wait_http code-projection http://127.0.0.1:8088/code/ 200,303 30
start_guanghu navigation-bridge /usr/bin/env GUANGHU_AI_HOST=127.0.0.1 \
GUANGHU_AI_PORT=3922 GUANGHU_REPOSITORY_MAP=/opt/guanghu/ai-discovery/repository-route-map.json \

View file

@ -18,7 +18,8 @@ grep -Fq 'mount -o remount,rw /' "$subject"
grep -Fq 'start_guanghu repository-bridge' "$subject"
grep -Fq 'start_guanghu app-hub' "$subject"
grep -Fq 'start_guanghu navigation-bridge' "$subject"
grep -Fq 'wait_http code-projection http://127.0.0.1:8088/code/ 303' "$subject"
grep -Fq '[[ ",$expected," == *",$code,"* ]]' "$subject"
grep -Fq 'wait_http code-projection http://127.0.0.1:8088/code/ 200,303' "$subject"
grep -Fq 'wait_http navigation-bridge http://127.0.0.1:3922/v1/anchor 200' "$subject"
if grep -Eq '(^|[[:space:]])(systemd|/sbin/init)([[:space:]]|$)' "$subject"; then
echo 'full Linux init must remain dormant' >&2