Repository navigation
Raise upgrade_required when a Mac computer needs Pro - #67
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
REV-5081. When Revyl refuses a Mac computer because the organization isn't on Pro (
403 computer_not_enabledwithunlocks_with_card: true), all three SDKs now raise an upgrade error instead of the generic "need a current paid plan, ask support" refusal.NOT_AVAILABLE_ON_PLATFORM(ErrNotAvailableOnPlatformin Go), so existing branches keep working. The new refusal reason isupgrade_required(TSRefusalReason, PythonRefusalReason, GoReasonUpgradeRequired).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 itsbilling_urlis 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."openPersistent/open_persistent/OpenPersistent. A refused create is still treated as a refusal, with no cleanup or stop.computer_not_enabled(staff turned Macs off, legacy plan, or an older backend withoutunlocks_with_card) keeps today's message and has no reason.computers.md,api.md,errors.md, the Python and Go READMEs, and CHANGELOG (Unreleased).Checks:
npm run build,typecheck,testandcheck:package; Pythonruff,mypyandpytest(767 passed); Gogofmt,go vetandgo test -race ./.... No new tests, per the org rule.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_enabledandunlocks_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 staysNOT_AVAILABLE_ON_PLATFORMso existing handlers keep working; the new typed reason isupgrade_required(ReasonUpgradeRequiredin Go).A shared
macUpgradeMessagehelper 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 Macopen()and persistentopenPersistent()/open_persistent()/OpenPersistent. Any othercomputer_not_enabledrefusal is unchanged (noupgrade_requiredreason).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.