Skip to content

fix(worker): use raw.githubusercontent.com as origin; fix deploy probe hostname#504

Merged
aaddrick merged 1 commit intomainfrom
fix/worker-origin-loop
Apr 23, 2026
Merged

fix(worker): use raw.githubusercontent.com as origin; fix deploy probe hostname#504
aaddrick merged 1 commit intomainfrom
fix/worker-origin-loop

Conversation

@aaddrick
Copy link
Copy Markdown
Owner

Summary

Two follow-ups to #503, both surfaced minutes after merging:

  1. Worker origin fetch loops via Pages auto-301. Once the CNAME is live on gh-pages, Pages 301s every aaddrick.github.io/claude-desktop-debian/* request to http://pkg.claude-desktop-debian.dev/*. The Worker's fetch(ORIGIN + path, request) against aaddrick.github.io now receives that 301, passes it to the client, which follows back to pkg.<domain>, which runs the Worker again — infinite loop. Observed directly:

    $ curl -I https://pkg.claude-desktop-debian.dev/dists/stable/InRelease
    HTTP/2 301
    location: http://pkg.claude-desktop-debian.dev/dists/stable/InRelease
    x-github-request-id: 3C94:286425:...
    x-served-by: cache-yyz4566-YYZ
    

    Fix: switch ORIGIN to https://raw.githubusercontent.com/aaddrick/claude-desktop-debian/gh-pages. Same branch content, no Pages routing layer. Verified 200 on all 5 metadata paths (InRelease, Packages, KEY.gpg, repomd.xml, repomd.xml.asc).

  2. deploy-worker.yml post-deploy probe was still pointed at pkg-staging after feat(worker): flip route to production for Phase 4a-APT #503. That's why feat(worker): flip route to production for Phase 4a-APT #503's workflow showed as failed in the Actions UI — wrangler deploy itself succeeded (Worker is live on pkg.claude-desktop-debian.dev), but the probe was resolving a hostname wrangler had just removed. curl returned exit 6 (couldn't resolve host). Repointed to pkg.claude-desktop-debian.dev.

Test plan

  • Verified raw.githubusercontent.com returns 200 on the 5 metadata paths used by apt/dnf
  • Merge triggers a clean deploy-worker.yml run (now probes production, should return 2xx/3xx for metadata)
  • Re-probe https://pkg.claude-desktop-debian.dev/dists/stable/InRelease from outside — should return 200 with InRelease content (not a 301 loop)
  • gh run rerun 24836419696 --failed for v2.0.3 — strip step's liveness probe should now succeed

Refs #493, #503


Generated with Claude Code
Co-Authored-By: Claude Opus 4.7 [email protected]
95% AI / 5% Human
Claude: diagnosed the origin-fetch 301 loop via response headers (x-github-request-id proves Pages returned the 301), verified raw.githubusercontent.com as a loop-free origin, fixed both the Worker ORIGIN and the stale deploy probe
Human: delegated the Phase 4a-APT execution autonomously; this is a diagnosed follow-up, not scope creep

…01 loop

Once the CNAME file is in place on gh-pages (Phase 4a-APT), GitHub
Pages auto-301s all aaddrick.github.io/claude-desktop-debian/* traffic
to pkg.claude-desktop-debian.dev/*. The Worker's origin fetch against
aaddrick.github.io gets 301'd by Pages, the 301 passes through to the
client, the client follows it back to pkg.<domain>, and the Worker
runs again — infinite loop.

Observed immediately after merging #503 and Pages finishing the CNAME
build:

  $ curl -I https://pkg.claude-desktop-debian.dev/dists/stable/InRelease
  HTTP/2 301
  location: http://pkg.claude-desktop-debian.dev/dists/stable/InRelease
  x-github-request-id: 3C94:286425:...
  x-served-by: cache-yyz4566-YYZ
  via: 1.1 varnish

(Scheme-downgrade to http is a separate Pages quirk when
 https_enforced=false, which is the case here because DNS points
 at Cloudflare, not Pages, so Pages can't provision a cert.)

raw.githubusercontent.com serves the same gh-pages branch content
without Pages' routing layer. All five metadata paths verified to
return 200:

  /dists/stable/InRelease
  /dists/stable/main/binary-amd64/Packages
  /KEY.gpg
  /rpm/x86_64/repodata/repomd.xml
  /rpm/x86_64/repodata/repomd.xml.asc

Also fixes the deploy-worker.yml post-deploy probe which still
hardcoded pkg-staging. That's what made #503's deploy show as
failed in the Actions UI even though the wrangler deploy itself
succeeded — route bound and Worker live, but the probe was
resolving a hostname wrangler had just removed.

Refs #493, #503

Co-authored-by: Claude <[email protected]>
@aaddrick aaddrick merged commit 09d5f4a into main Apr 23, 2026
16 checks passed
@aaddrick aaddrick deleted the fix/worker-origin-loop branch April 23, 2026 14:22
aaddrick added a commit that referenced this pull request Apr 23, 2026
The plan doc served its purpose through #494 (merge) → #498
(scaffolding) → #502 / #503 / #504 / #506 / #509 / #510 (cutover).
v2.0.5+claude1.3883.0 is the first release through the new pipeline,
verified end-to-end on five distros. #493 is closed.

Removes docs/worker-apt-plan.md and the two architecture-pointer
comments in worker/src/worker.js and worker/wrangler.toml that
referenced it. Both files now carry a short self-contained summary
of what the Worker does and why.

Also corrects worker.js's CDN-hostname reference from
objects.githubusercontent.com (the old name) to release-assets
(current, matches #509's regex fix).

Git history retains the full plan doc for anyone who needs the
design rationale; nothing is actually lost.
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