Repository navigation
Release 0.8.13: route the widget through widget.osc.earth/osa - #442
Merged
Merged
Conversation
…p-after-v0.8.12 chore: sync develop with main after v0.8.12
…438) Moves the OSA chat widget's API endpoint off the two account-scoped *.workers.dev hostnames and onto stable product-owned names: widget.osc.earth/osa (production) and develop-widget.osc.earth/osa (dev). Closes #437. widget.osc.earth is a generic host reserved for widgets, and /osa is this widget's path under it, so a later widget can take its own path without consuming a subdomain. That rules out custom_domain = true, which maps one whole hostname to one worker and cannot carry a path, so this is an ordinary zone route. Cloudflare delivers the FULL path to a path-mounted route, prefix included, and every route matcher here is anchored and counts segments. stripMountPrefix() removes the prefix once at the top of fetch(), gated on the request host so the still-live workers.dev hostname and wrangler dev keep seeing raw paths. DNS was provisioned for both names as proxied AAAA records to 100::, and dev verified end to end over real public DNS. Production attaches when develop reaches main; sync-worker-cors.yml owns that deploy. Review found two critical defects, both fixed here: the prefix strip was host-blind, so a community whose id is "osa" was silently swallowed on the workers.dev host; and the demo page's new dependency on the widget script was unguarded, so a failed script load threw uncaught and suppressed the page's own error UI. A pre-existing CI gate that never checked the frontend job's result is fixed too. Worker routing tests go from none to 93, covering host gating, query strings, the admin metrics routes and the path actually forwarded to the backend.
The Trap 2 note in wrangler.toml said zone access was not a concern here, reasoning that CLOUDFLARE_API_TOKEN already provisions custom domains on osc.earth. That reasoning does not transfer: Pages custom domains, zone DNS and Zone:Workers Routes:Edit are three separate grants, and the token holds the first two but not the third. The first sync-cors run after #438 merged proved it. Records what actually happened, including that the script upload still succeeds so the code goes live, and that pre-registering a route by hand does not make the job pass, since wrangler fails reconciling a route that already matches. Documentation only. The permission gap itself is tracked as #439.
CI can now register Workers Routes; the dev deploy attaches both the workers.dev name and develop-widget.osc.earth/osa/*. The fix was not a missing permission. Workers Routes is a ZONE permission, so it does not sit beside the account-level ones like Workers Scripts or D1, and the token already had it. It was scoped to a specific zone that did not include osc.earth. The permission row and the zone-resource scope are separate settings, and the API returns the same "No access to the specified resource" for either. Also keeps the two details that made the failure easy to misread: the script upload succeeds while only route reconciliation fails, so a red job does not mean a stale worker; and pre-registering the route by hand does not help, because wrangler fails reconciling a route that already matches. Closes #439.
neuromechanist
temporarily deployed
to
testpypi
September 22, 2026 14:43 — with
GitHub Actions
Inactive
Contributor
Preview Deployment
This preview will be updated automatically when you push new commits. |
Addresses every finding from the two release reviews of #442. Pins the deploy wrangler to an exact version and runs it through bun: a floating global install could re-flip workers_dev to false, which already took the workers.dev hostname down once during #437 with clean output. Adds a test enforcing that MOUNTED_HOSTS and the [[routes]] patterns agree. One drift direction is completely silent: a host in the set with no route means Cloudflare never invokes the worker, so no log can catch it. Mutation-verified both ways. Enables Workers Logs, without which the 404 fall-through log added in #438 was visible only during a live wrangler tail and could not explain an outage after the fact. Adds a 15-minute probe of both mounted hosts, the legacy workers.dev name, and the host gate itself. Nothing watched these; the status dashboard bypasses the worker entirely and stays green through a route outage. Repairs release.yml, dead since February 2026 because tag-release.yml pushes tags under the default GITHUB_TOKEN, which starts no workflow runs. Published notes have been missing the widget SRI section since. Documents what a release cannot roll back: the tag and the PyPI upload are immediate and permanent.
neuromechanist
temporarily deployed
to
testpypi
September 22, 2026 15:07 — with
GitHub Actions
Inactive
Contributor
|
Worker changes detected. After merging to Manual deployment (if needed): cd workers/osa-worker
wrangler deploy --env dev # for develop branch
wrangler deploy # for main branch |
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Promotes
developtomain. The whole diff is the widget-hostname work (#437) plus CI-owned version bumps; no other feature landed in this window.What reaches production
The OSA chat widget stops calling two account-scoped
*.workers.devhostnames and calls stable product-owned names instead:widget.osc.earth/osain production,develop-widget.osc.earth/osain dev.widget.osc.earthis a generic host reserved for widgets;/osais this widget's path under it, so a later widget can take its own path without consuming a subdomain. That rules outcustom_domain = true, which maps a whole hostname to one worker and cannot carry a path, so this is an ordinary zone route.The one thing that actually changes at the edge
widget.osc.earth/osa/*has never been registered. It answers 522 today. Merging this runssync-worker-cors.yml's productionwrangler deploy, which attaches the route for the first time.That step failed on
developuntil a few minutes ago, becauseCLOUDFLARE_API_TOKENheldWorkers Routesscoped to a zone that did not includeosc.earth(#439, now resolved). The dev deploy has since attached both triggers cleanly, so the same call is expected to succeed here. If it does not, the failure is loud and non-destructive: the script upload still succeeds and only route reconciliation fails, so the worker serves the new code on its existing hostnames whilewidget.osc.earthkeeps returning 522.DNS for both names already exists, created 2026-09-21 as proxied AAAA records to
100::.Risk, and why it is low
The widget's endpoint flips for real embedders on this merge. Two things bound that:
nemarOrg/websiteProduce&manage collection of plugin/skill(s) which would (re)use assistant "specifications" #342 is already merged tostagingand lists both the newosc.earthorigins and the legacyworkers.devones in nemar.org's Content-Security-Policy, so that page keeps working whichever order the two sides reach production.*.workers.devhostnames keep serving.workers_dev = trueis set explicitly at the top level and in[env.dev], because a[[routes]]table silently flips that default to false. Cached SRI-pinned widget builds that still call the old names continue to work.Review already done
#438 went through code, test, comment and error-handling review. Two critical defects were found and fixed before merge:
osawas silently swallowed on theworkers.devhost:/osa/logoreturned community logo's config as a 200. Now gated on the request host.A pre-existing CI gap was fixed too:
test.yml'sall-testsjob listedfrontend-testsinneedsbut never checked its result. That matters here specifically, becausetest.ymlis the workflow that runs on this promotion.Worker routing tests went from none to 93, covering host gating, query strings, the admin metrics routes and the path actually forwarded to the backend.
Version
src/version.pyis0.8.13.dev3.ensure-stable-version.ymlstrips the suffix onmain; not hand-bumped.This release is also the first to run #380's image workflow from the default branch, so it should be the first to publish versioned images and move
:latest.After merge
sync-corsproduction deploy green, withwidget.osc.earth/osa/*in its trigger listcurl https://widget.osc.earth/osa/healthreturns 200, not 522curl https://widget.osc.earth/osa/communitiesreturns 200osa-worker.shirazi-10f.workers.dev/healthstill 200osa-worker.shirazi-10f.workers.dev/osa/healthreturns 404, confirming the host gatedemo.osc.earth,develop-demo.osc.earth,api.osc.earthunaffectedDo not use
/osa/versionas a check: the worker proxies/versionto a backend endpoint that does not exist, so it 404s on every host today.Closes #437, #439.