From 4d5af78d3589e868cbbb7a05ca407fabf56f79ad Mon Sep 17 00:00:00 2001 From: Ethan Munoz Date: Tue, 5 May 2026 23:34:14 +0200 Subject: [PATCH] fix(migrate-v2): probe correct OneCLI health endpoint (/api/health) migrate-v2.sh probes ${ONECLI_URL_CHECK}/health (with ONECLI_URL_CHECK defaulting to http://127.0.0.1:10254, the OneCLI web port). That path returns 404, so the detection branch never matches an already-running OneCLI instance and the script falls through to the install path. The web app's health endpoint is /api/health (apps/web/src/app/api/health/route.ts) and has been since the OneCLI repo was made public. /health was never exposed by the web on :10254 nor by the gateway on :10255 (the gateway uses /healthz). Verified against a running OneCLI v1.21.0: GET :10254/api/health -> 200 {"status":"ok","version":"1.21.0",...} GET :10254/health -> 404 (Next.js fallback HTML) GET :10255/healthz -> 200 GET :10255/health -> 400 (gateway parses non-/healthz as CONNECT) Closes #2285 --- migrate-v2.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migrate-v2.sh b/migrate-v2.sh index 2325eddd4..ef3bda8e3 100644 --- a/migrate-v2.sh +++ b/migrate-v2.sh @@ -450,7 +450,7 @@ ONECLI_OK=false ONECLI_URL_FROM_ENV=$(grep '^ONECLI_URL=' .env 2>/dev/null | head -1 | sed 's/^ONECLI_URL=//') ONECLI_URL_CHECK="${ONECLI_URL_FROM_ENV:-http://127.0.0.1:10254}" -if curl -sf "${ONECLI_URL_CHECK}/health" >/dev/null 2>&1; then +if curl -sf "${ONECLI_URL_CHECK}/api/health" >/dev/null 2>&1; then step_ok "OneCLI running at $(dim "$ONECLI_URL_CHECK")" ONECLI_OK=true log "OneCLI: running at $ONECLI_URL_CHECK"