Skip to content

Hosted: tell an account with no plan before it types digits; actionable empty Computers copy - #1366

Open
nedtwigg wants to merge 2 commits into
pocket-hosted-promptfrom
hosted-no-plan-approval
Open

nedtwigg wants to merge 2 commits into
pocket-hosted-promptfrom
hosted-no-plan-approval

Conversation

@nedtwigg

@nedtwigg nedtwigg commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Stacked on #1365. Revived from the stale #1003 walkthrough findings, rebuilt on current main.

No-plan approval

Entitlement is ADMIN_EMAIL-only today, so almost every account that follows an enrollment link from Dormouse hit a dead end. It typed the two digits, then got the raw "this account is not entitled to the Hosted Relay" with a Retry connection button that could never help. This happens for both purposes, remote control and Natural Voice.

  • Up front: the enroll page reads the entitlement from GET /api/voice (hostedVoice.entitled === false), the one entitlement predicate both purposes share. A failed read leaves it null and never counts as no plan.
  • On approval: approveEnrollment maps only a 403 carrying NOT_ENTITLED_ERROR to NoPlanError. Any other refusal is still a page error.
  • In place of the digits, the page explains that Natural Voice and remote control aren't available to this account yet, and offers Use another account. That button uses the existing sign-out, which keeps the code on the page. Don't approve stays. No plan wins over a stale login, since signing in again as the same account can't help.
  • Spec: hosted.md → "Burrow enrollment" gains the rule. To fit it, the word budget is ratcheted from 4600 to 4650.

Empty Computers list

"No computers yet. Enroll one from Dormouse on that computer." now names the real desktop path: Settings → Network → Phones → Persistent Relay → Enroll remote control.

Test plan

  • hosted/src vitest 15/15. The new tests cover up-front no-plan for both purposes, approve 403 → no-plan with no alert, a failed read or approval never no-plan, and Use another account keeping the code, plus two approveEnrollment unit tests. Each was mutation-checked red.
  • NoPlan and NoPlanVoice stories. The Enrollment stories' plays pass 21/21 in Chromium.
  • hosted typecheck; spec and md lints

🤖 Generated with Claude Code

nedtwigg and others added 2 commits October 22, 2026 17:57
…le empty Computers copy

An account without the entitlement followed an enrollment link, typed the
two digits, and got the raw NOT_ENTITLED_ERROR with a Retry that could never
help. The enroll page now reads the entitlement up front from GET /api/voice
(a failed read never counts as unentitled), maps the approve route's 403
NOT_ENTITLED_ERROR to NoPlanError, and in either case shows why in place of
the digits, with Use another account (sign out, code kept) beside Don't
approve.

The empty Computers list now names the desktop path to enroll one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying mouseterm with  Cloudflare Pages  Cloudflare Pages

Latest commit: 3d9fd91
Status: ✅  Deploy successful!
Preview URL: https://864af247.mouseterm.pages.dev
Branch Preview URL: https://hosted-no-plan-approval.mouseterm.pages.dev

View logs

This branch has not been deployed

No deployments
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