From 356a35e9b096674de13f288c973a5d64ceda6b6c Mon Sep 17 00:00:00 2001 From: Lyon <88232613+pikasTech@users.noreply.github.com> Date: Mon, 22 Jun 2026 19:53:26 +0800 Subject: [PATCH] fix(api): keep live health probes within web budget (#1916) --- internal/cloud/server-rest-payloads.ts | 2 +- internal/cloud/server.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/cloud/server-rest-payloads.ts b/internal/cloud/server-rest-payloads.ts index 3b753fcf..f7a376dc 100644 --- a/internal/cloud/server-rest-payloads.ts +++ b/internal/cloud/server-rest-payloads.ts @@ -108,7 +108,7 @@ async function observeLiveBuildService(service, options) { const metadataRecords = liveBuildRecordsFromMetadata(service); const metadataRecord = metadataRecords[0] ?? null; if (service.serviceId === CLOUD_API_SERVICE_ID) { - const health = await options.buildHealthPayload(options); + const health = await options.buildHealthPayload({ ...options, healthMode: "live" }); return liveBuildRecordFromHealth(service, { ok: true, status: 200, diff --git a/internal/cloud/server.ts b/internal/cloud/server.ts index b3656c75..7d9fe89c 100644 --- a/internal/cloud/server.ts +++ b/internal/cloud/server.ts @@ -591,8 +591,9 @@ async function handleRestAdapter(request, response, url, options) { } if (request.method === "GET" && url.pathname === "/v1") { + const dbProbeOptions = { ...(options.dbProbe ?? {}), timeoutMs: 500 }; const [dbProbe, codeAgent, runtime] = await Promise.all([ - observeHttpRoutePhase(request, options, "v1.db_readiness", () => buildDbRuntimeReadiness(options.env ?? process.env, options.dbProbe)), + observeHttpRoutePhase(request, options, "v1.db_readiness", () => buildDbRuntimeReadiness(options.env ?? process.env, dbProbeOptions)), observeHttpRoutePhase(request, options, "v1.code_agent_availability", () => describeCodeAgentAvailability(options.env ?? process.env, options)), observeHttpRoutePhase(request, options, "v1.runtime_readiness", () => runtimeReadiness(options.runtimeStore)) ]);