Skip to content

Raise upgrade_required when a Mac computer needs Pro - #67

Merged
anamhira47 merged 1 commit into
mainfrom
capy/raise-upgraderequired-when-a
Nov 24, 2026
Merged

anamhira47 merged 1 commit into
mainfrom
capy/raise-upgraderequired-when-a

Conversation

@anamhira47

@anamhira47 anamhira47 commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

REV-5081. When Revyl refuses a Mac computer because the organization isn't on Pro (403 computer_not_enabled with unlocks_with_card: true), all three SDKs now raise an upgrade error instead of the generic "need a current paid plan, ask support" refusal.

  • The code is still NOT_AVAILABLE_ON_PLATFORM (ErrNotAvailableOnPlatform in Go), so existing branches keep working. The new refusal reason is upgrade_required (TS RefusalReason, Python RefusalReason, Go ReasonUpgradeRequired).
  • When the body carries Revyl's offer (RevylAI/cognisim-monorepo#7468), the message is Mac computers come with Pro, so Revyl refused this computer (computer_not_enabled, upgrade_required). <offer.message>: <offer.billing_url>. The offer is used only when its billing_url is https and its message is a single line of at most 160 characters. Otherwise the message ends with "Add a card in Revyl's billing settings to unlock them."
  • This covers both the regular computer create and openPersistent / open_persistent / OpenPersistent. A refused create is still treated as a refusal, with no cleanup or stop.
  • Any other computer_not_enabled (staff turned Macs off, legacy plan, or an older backend without unlocks_with_card) keeps today's message and has no reason.
  • Docs: computers.md, api.md, errors.md, the Python and Go READMEs, and CHANGELOG (Unreleased).

Checks: npm run build, typecheck, test and check:package; Python ruff, mypy and pytest (767 passed); Go gofmt, go vet and go test -race ./.... No new tests, per the org rule.

Open in Capy


Note

Low Risk
User-facing error messaging and a new optional refusal reason on an existing error code; no retries, auth, or wire-format changes.

Overview
When Revyl refuses a Mac computer create with computer_not_enabled and unlocks_with_card: true (typical Free-plan case), TypeScript, Python, and Go now surface a dedicated upgrade path instead of only generic “paid plan / ask support” text. The error code stays NOT_AVAILABLE_ON_PLATFORM so existing handlers keep working; the new typed reason is upgrade_required (ReasonUpgradeRequired in Go).

A shared macUpgradeMessage helper in each SDK builds the user-facing text: a fixed opener explaining that Macs come with Pro, then either Revyl’s offer message plus an HTTPS billing URL (only when both pass strict validation) or “Add a card in Revyl's billing settings to unlock them.” This applies to normal Mac open() and persistent openPersistent() / open_persistent() / OpenPersistent. Any other computer_not_enabled refusal is unchanged (no upgrade_required reason).

Docs and CHANGELOG describe the new reason and messages in computers.md, api.md, errors.md, and the Python/Go READMEs.

Reviewed by Cursor Bugbot for commit cb12eac. Bugbot is set up for automated code reviews on this repo. Configure here.

A computer_not_enabled refusal with unlocks_with_card now raises
NOT_AVAILABLE_ON_PLATFORM with reason upgrade_required and Revyl's billing
link when it sends one, in TypeScript, Python and Go. REV-5081

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot marked this pull request as ready for review November 24, 2026 20:22

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capy found no issues.

Open in Capy

@anamhira47
anamhira47 merged commit 6bf7c4c into main Nov 24, 2026
6 checks passed
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