Skip to content

Hosted dev loop: run the relay Worker on its database - #1367

Merged
nedtwigg merged 2 commits into
mainfrom
hosted-dev-relay
Oct 27, 2026
Merged

nedtwigg merged 2 commits into
mainfrom
hosted-dev-relay

Conversation

@nedtwigg

@nedtwigg nedtwigg commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Stacked on #1366. Revived from the stale #1003, rebuilt on current main.

dor tool hosted served the account app and the account's Relay routes but ran no relay Worker, so a dev desktop could not enroll by device code against a local Hosted.

  • Relay Worker: dev.ts now starts dev-one-time.mjs attached. It reads the same dev database through a local Hyperdrive, has the account origin as ACCOUNT_ORIGIN, and listens on RELAY_PORT (default 8787).
  • Attachment check: hostedAttachment(env) requires both attachment variables or neither. dev-one-time run alone is unchanged.
  • Framing: dev.ts now announces its own port over OSC 367, and the attached relay announces none, so the Tool frames the account origin rather than the relay's or Wrangler's inspector port.
  • Lifecycle: the relay stops with dev.ts (SIGINT/SIGTERM wait for it, and an exit hook kills it on a crash). A relay that exits on its own is logged; the account keeps serving.
  • Recipe: hosted/README.md has it: DORMOUSE_RELAY_IS_HOSTED=1 DORMOUSE_RELAY_ORIGIN=http://localhost:8787 pnpm innerdogfood, choose Local networks only or Anywhere, unfold Hosted Relay, and sign in as ADMIN_EMAIL at the account to approve.
  • Specs: hosted.md → "Development and release" and one-time.md → "Dev loop" state the contract. To stay in budget, hosted.md drops the voice-origin clause, which relay.md's Relay origin table and S193 still state.

Test plan

  • hosted test:deploy 46/46, including new hostedAttachment and attached-devConfig tests, each mutation-checked red
  • hosted typecheck; spec, md and public-docs lints
  • Live: /api/ready 200 on :8787 against the dev DB, enroll begin → approve as admin (204) → poll enrolled, and the account lists the Burrow. Killing the relay logs its exit, SIGTERM stops everything, and dor kill leaves no ports.

🤖 Generated with Claude Code

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Deploying mouseterm with  Cloudflare Pages  Cloudflare Pages

Latest commit: bbe57a8
Status: ✅  Deploy successful!
Preview URL: https://67a093c7.mouseterm.pages.dev
Branch Preview URL: https://hosted-dev-relay.mouseterm.pages.dev

View logs

Comment thread hosted/server/dev.ts Outdated
@nedtwigg
nedtwigg force-pushed the hosted-no-plan-approval branch from 3d9fd91 to e244345 Compare October 27, 2026 22:28
dor tool hosted (pnpm dev:hosted) now also starts the relay Worker's dev
loop attached to it: the development database through a local Hyperdrive
and the loop's origin as ACCOUNT_ORIGIN, at localhost:8787 or RELAY_PORT.
A dev Hosted desktop build (DORMOUSE_RELAY_IS_HOSTED=1,
DORMOUSE_RELAY_ORIGIN=http://localhost:8787) now enrolls by device code
end to end against a local Hosted. dev.ts announces its own port over
OSC 367 so the Tool frames the account, the attached relay announces
none, a relay exit is logged, and the relay stops with dev.ts.
dev-one-time alone is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Base automatically changed from hosted-no-plan-approval to main October 27, 2026 23:58
@nedtwigg
nedtwigg merged commit 59fa51e into main Oct 27, 2026
14 checks passed
@nedtwigg
nedtwigg deleted the hosted-dev-relay branch October 27, 2026 23:59
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.

2 participants