From 9a470fdb7d431cb6e249df8a0c4ff20aeddf804a Mon Sep 17 00:00:00 2001 From: Will Washburn Date: Tue, 23 Jun 2026 11:17:56 -0400 Subject: [PATCH 1/2] fix(router): drop the unresolvable WEBHOOK_WORKER service binding MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The deploy failed: a service binding to script `webhook-worker` returns "Worker not found" (code 10143) — cloud names/exposes that worker differently and configures webhook offload via the WEBHOOK_WORKER_ORIGIN *.workers.dev URL, not a service binding. Drop the binding so the router deploys; webhook offload (only active when the ROUTER_CONFIG WEBHOOK_ORIGIN flag is "worker") is wired back before the apex cutover. Also fix a missed @agentworkforce/cloud label in the README diagram. Co-Authored-By: Claude Opus 4.8 (1M context) --- router/README.md | 2 +- router/wrangler.jsonc | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/router/README.md b/router/README.md index 0c050ae1..37f9454d 100644 --- a/router/README.md +++ b/router/README.md @@ -39,7 +39,7 @@ the first production deploy does not require manual Cloudflare setup. │ │ ┌────────────────────────────────────┐ All Other Routes ┌────────────────────────────────────┐ -│ @agentworkforce/cloud │ (/, /docs, /blog, /openclaw) │ @agentworkforce/relaycast │ +│ @agentworkforce/agentrelay.com │ (/, /docs, /blog, /openclaw) │ @agentworkforce/relaycast │ │ │ │ │ │ │ /web (NextJs App) │ │ │ /packages/observer-dashboard │ │ │ │ │ /@relayfile/file-observer │ diff --git a/router/wrangler.jsonc b/router/wrangler.jsonc index 8dd58c43..0344b246 100644 --- a/router/wrangler.jsonc +++ b/router/wrangler.jsonc @@ -10,16 +10,19 @@ // name/id. These identifiers are cloud-owned; if cloud ever recreates the // resource the value here must be updated (see the repo's Phase 2 notes). - // Service bindings reference cloud's Workers by stable prod script name - // (no *.workers.dev URL to pin): /cloud* → the cloud Next.js Worker; - // WEBHOOK_WORKER → the dedicated webhook Worker the router can offload - // /api/v1/webhooks/* to when the ROUTER_CONFIG `WEBHOOK_ORIGIN` flag is "worker" - // (the router code prefers this binding over the WEBHOOK_WORKER_ORIGIN URL). + // /cloud* → the cloud Next.js Worker, by stable prod script name. "services": [ - { "binding": "CLOUD_WEB_WORKER", "service": "cloud-web-worker" }, - { "binding": "WEBHOOK_WORKER", "service": "webhook-worker" } + { "binding": "CLOUD_WEB_WORKER", "service": "cloud-web-worker" } ], + // NOTE: webhook offload (the router forwarding /api/v1/webhooks/* to the + // dedicated webhook Worker when the ROUTER_CONFIG `WEBHOOK_ORIGIN` flag is + // "worker") is intentionally NOT wired yet. Cloud configures this via the + // `WEBHOOK_WORKER_ORIGIN` *.workers.dev URL (not a service binding). Add it + // back here before the apex cutover IF the flag is "worker"; until then the + // router routes webhooks through the normal /cloud path (flag="lambda" + // behavior). See PR notes. + // ROUTER_CONFIG: holds the WEBHOOK_ORIGIN ops flag + recorder config. // RATE_LIMIT_COUNTERS: shared with the relayfile-api worker — MUST be the same // namespace id so both gateways increment the same per-workspace counters. From f88099aec6668383e6470d47a351dfb33f826d42 Mon Sep 17 00:00:00 2001 From: Will Washburn Date: Tue, 23 Jun 2026 11:50:08 -0400 Subject: [PATCH 2/2] router: wire WEBHOOK_WORKER_ORIGIN (flag is 'worker' in prod) The ROUTER_CONFIG WEBHOOK_ORIGIN flag is 'worker', so the router forwards /api/v1/webhooks/* to the dedicated webhook Worker. Set the URL (read from the live router) since the worker's SST-hashed script name isn't service-bindable. --- router/wrangler.jsonc | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/router/wrangler.jsonc b/router/wrangler.jsonc index 0344b246..82bdd490 100644 --- a/router/wrangler.jsonc +++ b/router/wrangler.jsonc @@ -11,18 +11,13 @@ // resource the value here must be updated (see the repo's Phase 2 notes). // /cloud* → the cloud Next.js Worker, by stable prod script name. + // (Webhook offload uses the WEBHOOK_WORKER_ORIGIN URL below, not a service + // binding — SST names the webhook Worker with a random hash suffix, so it + // isn't bindable by a stable script name.) "services": [ { "binding": "CLOUD_WEB_WORKER", "service": "cloud-web-worker" } ], - // NOTE: webhook offload (the router forwarding /api/v1/webhooks/* to the - // dedicated webhook Worker when the ROUTER_CONFIG `WEBHOOK_ORIGIN` flag is - // "worker") is intentionally NOT wired yet. Cloud configures this via the - // `WEBHOOK_WORKER_ORIGIN` *.workers.dev URL (not a service binding). Add it - // back here before the apex cutover IF the flag is "worker"; until then the - // router routes webhooks through the normal /cloud path (flag="lambda" - // behavior). See PR notes. - // ROUTER_CONFIG: holds the WEBHOOK_ORIGIN ops flag + recorder config. // RATE_LIMIT_COUNTERS: shared with the relayfile-api worker — MUST be the same // namespace id so both gateways increment the same per-workspace counters. @@ -40,7 +35,13 @@ "vars": { "CLOUD_APP_ORIGIN": "https://origin.agentrelay.cloud", - "FILE_OBSERVER_ORIGIN": "https://relayfile-file-observer.pages.dev" + "FILE_OBSERVER_ORIGIN": "https://relayfile-file-observer.pages.dev", + // The dedicated webhook Worker the router forwards /api/v1/webhooks/* to when + // the ROUTER_CONFIG `WEBHOOK_ORIGIN` flag is "worker" (it is, in prod). This + // is cloud-owned and the script name carries a random hash suffix, so it + // would change if cloud recreates that Worker — re-copy it from the live + // router's WEBHOOK_WORKER_ORIGIN if webhook routing ever 5xxs. + "WEBHOOK_WORKER_ORIGIN": "https://cloud-production-webhookworkerscript-mbehwvfu.agent-workforce.workers.dev" }, // Start on a staging hostname for parity verification against the live apex;