Skip to content

fix(cli): carry from=cli on every HyperFrames pricing and upgrade link - #9202

Queued
miguel-heygen wants to merge 2 commits into
mainfrom
fix/cli-purchase-origin
Queued

miguel-heygen wants to merge 2 commits into
mainfrom
fix/cli-purchase-origin

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

Summary

  • Accept any HTTPS HyperFrames host (hyperframes.studio, *.hyperframes.studio, hyperframes.dev, *.hyperframes.dev, hyperframes.heygen.com) in cliCheckoutLink (packages/cli/src/heygen/plan.ts) instead of only exact hyperframes.studio, while continuing to leave non-HyperFrames hosts and non-HTTPS URLs untouched.
  • Route the local studio share upgrade link (packages/cli/src/server/sharePresentation.ts) through cliCheckoutLink so it carries from=cli and utm_source=cli alongside entry=local_studio_share.

Verification

  • fails without the fix: packages/cli/src/heygen/plan.test.ts ("marks any HyperFrames pricing link as the CLI's, keeping what it already says") and packages/cli/src/server/sharePresentation.test.ts ("preserves authoritative plan free for the upgrade offer") both failed before the fix (dev.hyperframes.studio returned without from=cli, local_studio_share returned without from=cli&utm_source=cli).
  • Post-fix:
    • bunx vitest run --sequence.shuffle src/heygen/plan.test.ts src/server/sharePresentation.test.ts: 24/24 passed x3 shuffled.
    • Sibling tests (shareRoutes.test.ts, reverse.test.ts, v3.test.ts, billing.test.ts, status-user.test.ts): 191/191 passed.
    • oxlint, oxfmt --check, @hyperframes/cli typecheck, and fallow clean.

@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Edit accuracy: accurate 275 (base branch 275), smooth 71 of those

The gate passes.
Smoothness is reported in the artifact, not gated. A case fails only if it fails 2 of 3 runs.

Quarantined, measured but not gated (0)

Unstable (1)

  • seqplainkeys-none-center-r0-nested-z100: tracking 0.06, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo true, teleport true / tracking 0.06, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo true, teleport true / tracking 0.06, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo true, teleport true

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approve. The host match only tags HTTPS HyperFrames hosts. It leaves an existing from= and query string alone, and the share page's upgrade link now goes through it.

Need: yes. Pricing and upgrade links opened from the CLI should all say they came from the CLI. Size: small. Reuse: the share link reuses cliCheckoutLink rather than a second tagger. Simpler: yes. Structure: fine.
Risk: low. Links are only ever tagged, never rewritten, and only on matching hosts.

Checked at this head:

  • Host match. I called cliCheckoutLink directly on these links:
    • Left untouched: evilhyperframes.studio, hyperframes.studio.evil.com, x.hyperframes.heygen.com, http://hyperframes.studio, heygen.com, an unparseable string, and the trailing-dot hyperframes.studio..
    • Tagged: https://HYPERFRAMES.DEV/pricing?a=1&from=x became https://hyperframes.dev/pricing?a=1&from=x&utm_source=cli, so the existing from=x and a=1 are kept. A link on port 8443 was tagged too.
  • Against main. The old check compared exact hostnames with webBase(), which is hard-coded to https://hyperframes.studio, so the new set covers every link that was tagged before. The one exception is plain http://hyperframes.studio, which now stays untagged.
  • Share link. It calls cliCheckoutLink(..., ""), so it gets from=cli and utm_source=cli, keeps entry=local_studio_share, and adds no skill. shareSite() is hyperframes.dev or dev.hyperframes.dev, and both match.
  • Checkout retry without a return address. Only the comment changed. The link it returns is a Stripe checkout URL, which isn't a HyperFrames page, and the request still sends X-HeyGen-Source through resolveCloudAuthHeaders. The new comment is accurate.
  • Fails without the fix: with base plan.ts and sharePresentation.ts put back, both named tests fail (2 of 24). At head, plan, sharePresentation, reverse and v3 tests pass 107/107.

— Rames

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Re-review at 10bd4f4c: this commit only moves code. isHyperFramesHost and the link marking move unchanged into utils/checkoutLink.ts. cliCheckoutLink now delegates to the moved helper, and the share page calls it directly. Before, the share page passed skill as ""; now it passes nothing. Both are falsy, so neither adds a skill param, and the links come out the same as at 442c797d. All checks pass at this head, including the edit-accuracy gate.

Need ✓ · Size ✓ · Reuse ✓ · Simpler ✓ · Structure ✓
Risk: low, a same-output move.

— Rames

@miguel-heygen
miguel-heygen added this pull request to the merge queue Dec 1, 2026
Any commits made after this event will not be merged.

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.

3 participants