Skip to content

docs: record how the Workers Routes permission was resolved - #441

Merged
neuromechanist merged 1 commit into
developfrom
fix/issue-439-resolved
Sep 22, 2026
Merged

neuromechanist merged 1 commit into
developfrom
fix/issue-439-resolved

Conversation

@neuromechanist

Copy link
Copy Markdown
Member

Closes #439.

CI can now register Workers Routes. The sync-cors deploy on develop attaches both triggers:

Deployed osa-worker-dev triggers (1.12 sec)
  https://osa-worker-dev.shirazi-10f.workers.dev
  develop-widget.osc.earth/osa/* (zone name: osc.earth)

The part worth recording

The fix was not adding a missing permission.

Workers Routes is a Zone permission, so it does not appear beside the account-level ones like Workers Scripts or D1, which is what made it look absent. 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 two separate settings, and the Cloudflare API returns the same No access to the specified resource for either. That ambiguity is why this took three attempts to read correctly, and it is the thing the comment now states plainly.

Two further details kept in the comment, both of which made the failure easy to misdiagnose:

  • The script upload succeeds and only route reconciliation fails, so the code goes live and the job still exits 1. A red job here does not mean a stale worker.
  • Pre-registering the route by hand does not make it pass. Wrangler fails reconciling a route that already matches, which is why dev kept failing while develop-widget.osc.earth/osa served 200 throughout.

Verified after the fix

Check Result
develop-widget.osc.earth/osa/health 200
develop-widget.osc.earth/osa/communities 200
develop-widget.osc.earth/osa/hed/ 200
osa-worker-dev.shirazi-10f.workers.dev/health 200
osa-worker-dev.shirazi-10f.workers.dev/osa/health 404, host gate from #438 working
osa-worker.shirazi-10f.workers.dev/health 200, production untouched
widget.osc.earth/osa/health 522, expected until develop reaches main

Documentation only, no behavior change. 93/93 routing tests still pass.

Related: #437, #438, #440.

CI can now register 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, which is what made this
take three attempts to read correctly.

Also keeps the two things 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.
@neuromechanist
neuromechanist merged commit 5cebd77 into develop Sep 22, 2026
9 checks passed
@neuromechanist
neuromechanist deleted the fix/issue-439-resolved branch September 22, 2026 14:43
neuromechanist added a commit that referenced this pull request Sep 22, 2026
Brings the widget-hostname work (#437, #438, #440, #441) and the release
hardening (#443) onto the epic branch. Two conflicts, both real rather
than textual.

workers/osa-worker/index.js: phase 1 matched its routes against the raw
url.pathname, which predates develop's host-gated stripMountPrefix. Left
as merged, every phase 1 route would have 404'd on widget.osc.earth
while ordinary chat worked, so the two-run continuation would have been
broken on the mounted host only. Both communityAction and
communityChatResume now match the stripped pathname; the named
ROUTE_PATTERNS constants from phase 1 are kept.

workers/osa-worker/test-routing.js: both branches created this file
independently. Develop's version drives the real exported fetch handler,
phase 1's asserted against the regex constants in isolation. Kept
develop's, because a test that matches a pattern by hand cannot catch a
route wired to the wrong variable, which is exactly the bug above. Phase
1's resume coverage is re-added in that style, driving the real handler
prefixed and unprefixed.

The workflow conflicts were duplicate steps; develop already runs the
routing test in the same job.

Tested: 102 routing, 10 mounted-hosts, 13 endpoint, ruff clean, 2483
pytest passed. Note that a fresh worktree resolves Python 3.14, where
langfuse's pydantic.v1 usage fails at collection; pin 3.12 to match CI.
neuromechanist added a commit that referenced this pull request Sep 30, 2026
The file had sections for 0.8.10, 0.8.12, 0.8.14 and 0.8.15 only. The
three missing releases are written from the pull requests between their
tags (0.8.13: #438, #440, #441, #443; 0.8.11: #418; 0.8.9: #351 to #355
and #359 and #367), so the last seven releases are now all present.

Tested: docs only; each entry checked against its pull request's body.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant