Skip to content

fix(cli): don't invent a purchase link when the server withholds upgrade_url - #7031

Merged
Vitozhu04 merged 1 commit into
mainfrom
wanbi/cli-reverse-upgrade-url-null
Nov 3, 2026
Merged

Vitozhu04 merged 1 commit into
mainfrom
wanbi/cli-reverse-upgrade-url-null

Conversation

@Vitozhu04

@Vitozhu04 Vitozhu04 commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

What

reverse start no longer makes up a purchase link when the server deliberately sends upgrade_url: null. null now means no link anywhere: the JSON prints reverse.upgrade_url: null and reverse.subscribe_command: null, and under gate: "block" the refusal says "Reverse is part of HyperFrames Pro, and a plan can't be purchased right now." with no command or URL in the message or the fix. The reverse-any-video skill (references/start.md) says to tell the person that plainly and give no link. The CLI builds its own plans link (feature=reverse&rs=<session>) only when the field is absent (an older server). A string upgrade_url is used as is, as before. (Rebased onto main after #7046, which points Free accounts at billing subscribe: a null link now withholds that command too.)

Why

How

  • packages/cli/src/heygen/reverse.ts: ReverseSession.upgradeUrl is string | null. parseSession keeps an explicit null. reverseUpgradeUrl returns null for it and falls back to pageUrl("plans", …) only when the field is missing.
  • packages/cli/src/commands/reverse/start.ts: on Free, upgrade_url and subscribe_command are both null when the link is null (freeFields). The block refusal for a null link says a plan can't be purchased right now, names no billing subscribe command, and its fix is "Run reverse start again once this account is on Pro."
  • Docs (docs/packages/cli.mdx), the skill reference (subscribe_command: null → say a plan can't be bought, give no link, run nothing), and skills-manifest.json (regenerated hash) are updated to match.

Test plan

  • Unit tests (targeted only), one case per branch (null / absent / string):
    • heygen/reverse.test.ts: reads upgrade_url when it is a link | null | no field, and reverseUpgradeUrl is null when the server withholds the link.
    • commands/reverse/start.test.ts runs the real reverseUpgradeUrl (only startReverseSession and pageUrl are mocked). Record output: prints the upgrade link for Free: the server's link | … | no link when the server withholds it; names no subscribe command when the server withholds the link (JSON has upgrade_url: null, subscribe_command: null). Block: stops a Free account the server blocks, with the subscribe command as the fix… (link present) and names no link when the server blocks Free and withholds the link: no plan can be bought now (null; also checks the refusal has no billing subscribe).
    • Before the fix (sources restored, tests kept), the 5 null cases fail: the CLI printed a plans link (…?feature=reverse&rs=<session>) and a billing subscribe command, and the block refusal said "Reverse is part of HyperFrames Pro. Run npx hyperframes billing subscribe --feature reverse --session <id>, then run reverse start again." After the fix, 2 files / 37 tests pass (Genesis's local run at head 83323e4).
  • Also run locally (pre-rebase head): tsc --noEmit, oxlint and oxfmt --check on packages/cli are clean; lint-skills, the skill-mirror check and the fallow audit pass on the changed files.
  • Manual testing: not run against a real server.
  • Documentation updated
  • Comments follow CONTRIBUTING.md "Comments"

— wanbi

🤖 Generated with Claude Code

@heygengenesis heygengenesis 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.

Verdict: COMMENT (needs a fix) · 1 blocker · 0 important · 0 nits · e7d8784

The behaviour is right and fixes my #7016 reverse.ts:57 nit. A null from a recorded session now shows no link in the JSON, the refusal or the skill, and only an absent field falls back to the CLI-built link. I ran the two test files: 36/36 pass. With the base sources restored, the 4 null-case tests fail, so the tests catch the bug. tsc, oxlint and oxfmt are clean on the touched files.

The one blocker is the red Comments check ↓. It isn't a required check, but it is red at this head.

CI

Stacked on #7017, so CI doesn't run. Comments failed; Player perf, regression and preview-regression passed.

Comment thread packages/cli/src/heygen/reverse.ts Resolved
@Vitozhu04
Vitozhu04 force-pushed the wanbi/cli-reverse-start-block branch from 7f3fa93 to ebd2b62 Compare November 2, 2026 17:07
heygengenesis[bot]
heygengenesis Bot previously approved these changes Nov 2, 2026

@heygengenesis heygengenesis 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.

Verdict: APPROVE · 1 resolved, 0 open, 0 new · e7d8784 → e66726c

The only change is a comments-only trim in reverse.ts. Comments is green, the two test files pass 36/36 locally, and Player perf, regression and preview-regression pass. Main CI doesn't run while this is stacked on #7017. Not queued.

@Vitozhu04
Vitozhu04 force-pushed the wanbi/cli-reverse-upgrade-url-null branch from e66726c to cdf6e04 Compare November 2, 2026 17:09
Base automatically changed from wanbi/cli-reverse-start-block to main November 2, 2026 17:45
@Vitozhu04
Vitozhu04 dismissed heygengenesis[bot]’s stale review November 2, 2026 17:45

The base branch was changed.

@mintlify

mintlify Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
hyperframes 🟢 Ready View Preview Nov 3, 2026, 1:28 PM

💡 Tip: Enable Automations to automatically generate PRs for you.

@Vitozhu04
Vitozhu04 force-pushed the wanbi/cli-reverse-upgrade-url-null branch from cdf6e04 to 80cebc4 Compare November 2, 2026 17:47
@Vitozhu04 Vitozhu04 closed this Nov 3, 2026
@Vitozhu04
Vitozhu04 force-pushed the wanbi/cli-reverse-upgrade-url-null branch from 80cebc4 to 47ddded Compare November 3, 2026 13:21
@Vitozhu04 Vitozhu04 reopened this Nov 3, 2026
@Vitozhu04 Vitozhu04 closed this Nov 3, 2026
@Vitozhu04
Vitozhu04 force-pushed the wanbi/cli-reverse-upgrade-url-null branch from d678e36 to 47ddded Compare November 3, 2026 13:23
…ade_url

reverse/start answers upgrade_url: null when no plan can be bought right
now. The CLI treated that like a missing field and built its own plans
link, so a Free account under gate "block" was sent to a page where it
can't buy. Now null means no link anywhere: the JSON prints
upgrade_url: null and subscribe_command: null (billing subscribe would
open that same plans page), the refusal says a plan can't be purchased
right now instead of naming the subscribe command, and the skill runs
nothing and passes on no link. Only an absent field (an older server)
falls back to the plans page; a string is used as is.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@heygengenesis heygengenesis 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.

Verdict: APPROVE · 0 blocker · 0 important · 1 nit · 83323e4

I reviewed this head from scratch because the rebase changed the patch: main's #7046 moved Free to billing subscribe. Now a null link sets both upgrade_url and subscribe_command to null, and the block refusal names no command or URL. All 37 tests pass locally. With the base sources restored, the 5 null-case tests fail. Required CI is green. Not queued.

  • nit: The PR body's test plan was written before the rebase. It says 4 null cases and 36 tests, and it quotes the old "Upgrade here … https://…" refusal. Its What section also doesn't mention subscribe_command: null.
Scope

I read all 7 files. billing subscribe builds its own plans link (billing.ts:48) and never reads a string upgrade_url. That comes from #7046, not this PR.

@Vitozhu04
Vitozhu04 added this pull request to the merge queue Nov 3, 2026
Merged via the queue into main with commit a5a6121 Nov 3, 2026
119 checks passed
@Vitozhu04
Vitozhu04 deleted the wanbi/cli-reverse-upgrade-url-null branch November 3, 2026 17:06
WaterrrForever added a commit that referenced this pull request Nov 3, 2026
HeyGen sends url: null when it can't sell to this account right now. The
refusal now says so and carries no link, as reverse start does since #7031;
a missing url (older server) still gets the plans or credits page.
This was referenced Nov 4, 2026
WaterrrForever added a commit that referenced this pull request Nov 5, 2026
HeyGen sends url: null when it can't sell to this account right now. The
refusal now says so and carries no link, as reverse start does since #7031;
a missing url (older server) still gets the plans or credits page.
mehrabshakil-ctrl pushed a commit to mehrabshakil-ctrl/hyperframes that referenced this pull request Nov 5, 2026
… label) (heygen-com#7099)

* feat(cli): a paywall refusal carries its page link in its own url field

An agent hit the Pro paywall, found the link only inside the fix sentence,
and handed the person a shell command instead of the page. The link now
also comes as url.

* fix(cli): auth status says hyperframes is the plan, not the HeyGen app's

An agent read user.subscription.plan (the HeyGen app's pro) as the
HyperFrames plan and ran past Free. With the HyperFrames plan read,
billing_notice now names which is which.

* fix(cli): a paywall refusal with url null names no purchase link

HeyGen sends url: null when it can't sell to this account right now. The
refusal now says so and carries no link, as reverse start does since heygen-com#7031;
a missing url (older server) still gets the plans or credits page.

This branch was successfully deployed

1 active deployment
staging - docs — 83323e4a Deployed Nov 3, 2026 by mintlify[bot]
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