From 373afb56ff77b96b07b2be006a5373948e1e3575 Mon Sep 17 00:00:00 2001 From: LongYinan Date: Wed, 8 Apr 2026 17:44:07 +0800 Subject: [PATCH] fix: add readiness probe endpoint for WfP propagation detection Inject GET /__void/ready in __handleInternal() so it bypasses user middleware. The platform polls this after worker upload to confirm the new script is live in the dispatch namespace before dispatching migrations, eliminating the recurring "CF returned plain-text asset response" failures. Co-Authored-By: Claude Opus 4.6 --- packages/void/src/router/compile.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/void/src/router/compile.ts b/packages/void/src/router/compile.ts index 316f9e2ec..32fd25704 100644 --- a/packages/void/src/router/compile.ts +++ b/packages/void/src/router/compile.ts @@ -1361,6 +1361,11 @@ async function serveWithAssets(request, env, response) { const internalRouteHelper = `async function __handleInternal(request, env, ctx) { const url = new URL(request.url); + // Readiness probe — platform polls this to confirm the worker is live after WfP upload. + // Handled here (before app.fetch) so user middleware cannot block it. + if (request.method === "GET" && url.pathname === "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/__void/ready") { + return Response.json({ ready: true }); + } if (request.method !== "POST" || url.pathname !== "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/__void/prerender-paths") return null; const __expected = env.__VOID_PROXY_TOKEN; if (__expected) {