From 453d30159914b16d2bc34c23e31b5347489a921b Mon Sep 17 00:00:00 2001 From: Robert Karl Date: Sat, 17 Oct 2026 23:28:24 -0700 Subject: [PATCH] frontend: /health advertises service=strata and loaded=true for upstream clients Upstream's tools/strata_bench.py (is_strata, wait_ready) only talks to a server whose /health has service == "strata" and loaded; the fork answered llama.cpp's {status, busy} only, so the step-9 fork arms never left the readiness wait (fork-flash-next on the pod sat ready for 30 min, then was killed as 'failed to start'). Add service, loaded, model, max_context; keep status and busy. e2e.sh checks the two required fields. Co-Authored-By: Claude Fable 5.1 --- frontend/strata_context.cpp | 6 +++++- frontend/tests/e2e.sh | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/strata_context.cpp b/frontend/strata_context.cpp index 5b0c22b..f597853 100644 --- a/frontend/strata_context.cpp +++ b/frontend/strata_context.cpp @@ -975,7 +975,11 @@ void strata_context::init_routes(server_http_context & http) { res->error(format_error_response("the engine is not running", ERROR_TYPE_UNAVAILABLE)); return res; } - res->ok({{"status", "ok"}, {"busy", I->slot.active()}}); + // llama.cpp's shape ("status") plus the fields upstream PolyStrata clients (tools/strata_bench.py, + // its is_strata / wait_ready) look for: "service" and "loaded". The engine only serves once loaded. + res->ok({{"status", "ok"}, {"busy", I->slot.active()}, + {"service", "strata"}, {"loaded", true}, + {"model", I->model_name}, {"max_context", I->n_ctx}}); return res; }; diff --git a/frontend/tests/e2e.sh b/frontend/tests/e2e.sh index abbddb8..29d830b 100755 --- a/frontend/tests/e2e.sh +++ b/frontend/tests/e2e.sh @@ -33,6 +33,8 @@ done # /health and /v1/models h=$(curl -s "$URL/health"); check $([ "$(echo "$h" | j 'd["status"]')" = ok ] && echo 0 || echo 1) "/health: $h" +# upstream PolyStrata clients (tools/strata_bench.py) require these two to treat the server as a loaded strata server +check $([ "$(echo "$h" | j 'd["service"]')" = strata ] && [ "$(echo "$h" | j 'd["loaded"]')" = True ] && echo 0 || echo 1) "/health: service=strata loaded=true" m=$(curl -s "$URL/v1/models"); check $([ "$(echo "$m" | j 'd["data"][0]["id"]')" = fake ] && echo 0 || echo 1) "/v1/models id: $(echo "$m" | j '{k: d["data"][0].get(k) for k in ("id", "context_length")}')" # non-streaming chat