From 234bdc8dbdedbce1476380bfe0bd01b903f7bb6c Mon Sep 17 00:00:00 2001 From: Dax Date: Fri, 6 Nov 2026 11:39:02 -0500 Subject: [PATCH] fix(console): stop managing the opencode.ai custom domain from the old Console (#62381) --- infra/console.ts | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/infra/console.ts b/infra/console.ts index 84e64d05a79..9f5d051b9b6 100644 --- a/infra/console.ts +++ b/infra/console.ts @@ -1,6 +1,32 @@ -import { domain } from "./stage" +import { domain, zoneID } from "./stage" import { EMAILOCTOPUS_API_KEY } from "./app" +// opencode.ai and dev.opencode.ai belong to the site Worker (services/site) now, so the old Console Worker gets +// no custom domain there. Its custom domain was moved to the site Worker in place, keeping its ID (Cloudflare +// won't let a placeholder DNS record sit beside a Worker-managed one, and deleting the record first would leave +// the apex without DNS). SiteDomain adopts that resource so SST stops managing it without deleting the live +// hostname: it is retained on delete, and its inputs are ignored so it is never updated or replaced. +const siteOwnsDomain = $app.stage === "production" || $app.stage === "dev" +if (siteOwnsDomain) { + new cloudflare.WorkersCustomDomain( + "SiteDomain", + { + accountId: "15d29c8639fd3733b1b5486a2acfd968", + hostname: domain, + service: `opencode-site-${$app.stage}`, + zoneId: zoneID, + environment: "production", + }, + { + aliases: [ + `urn:pulumi:${$app.stage}::${$app.name}::sst:cloudflare:SolidStart$sst:cloudflare:Worker$cloudflare:index/workersCustomDomain:WorkersCustomDomain::ConsoleWorkerDomain`, + ], + retainOnDelete: true, + ignoreChanges: ["accountId", "hostname", "service", "zoneId", "environment"], + }, + ) +} + // Archived Zen request/response dumps (writer removed May 2026). Retained on purpose; nothing reads or writes them. new sst.cloudflare.Bucket("ZenData") new sst.cloudflare.Bucket("ZenDataNew") @@ -19,7 +45,7 @@ const SALESFORCE_CLIENT_SECRET = new sst.Secret("SALESFORCE_CLIENT_SECRET") const SALESFORCE_INSTANCE_URL = new sst.Secret("SALESFORCE_INSTANCE_URL") new sst.cloudflare.x.SolidStart("Console", { - domain, + domain: siteOwnsDomain ? undefined : domain, path: "packages/console/app", link: [ EMAILOCTOPUS_API_KEY,