Repository navigation
fix(cli): carry from=cli on every HyperFrames pricing and upgrade link - #9202
miguel-heygen wants to merge 2 commits into
Conversation
Edit accuracy: accurate 275 (base branch 275), smooth 71 of thoseThe gate passes. Quarantined, measured but not gated (0) Unstable (1)
|
jrusso1020
left a comment
There was a problem hiding this comment.
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
cliCheckoutLinkdirectly 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-dothyperframes.studio.. - Tagged:
https://HYPERFRAMES.DEV/pricing?a=1&from=xbecamehttps://hyperframes.dev/pricing?a=1&from=x&utm_source=cli, so the existingfrom=xanda=1are kept. A link on port 8443 was tagged too.
- Left untouched:
- Against main. The old check compared exact hostnames with
webBase(), which is hard-coded tohttps://hyperframes.studio, so the new set covers every link that was tagged before. The one exception is plainhttp://hyperframes.studio, which now stays untagged. - Share link. It calls
cliCheckoutLink(..., ""), so it getsfrom=cliandutm_source=cli, keepsentry=local_studio_share, and adds noskill.shareSite()ishyperframes.devordev.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-SourcethroughresolveCloudAuthHeaders. The new comment is accurate. - Fails without the fix: with base
plan.tsandsharePresentation.tsput back, both named tests fail (2 of 24). At head,plan,sharePresentation,reverseandv3tests pass 107/107.
— Rames
jrusso1020
left a comment
There was a problem hiding this comment.
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
Summary
hyperframes.studio,*.hyperframes.studio,hyperframes.dev,*.hyperframes.dev,hyperframes.heygen.com) incliCheckoutLink(packages/cli/src/heygen/plan.ts) instead of only exacthyperframes.studio, while continuing to leave non-HyperFrames hosts and non-HTTPS URLs untouched.packages/cli/src/server/sharePresentation.ts) throughcliCheckoutLinkso it carriesfrom=cliandutm_source=clialongsideentry=local_studio_share.Verification
packages/cli/src/heygen/plan.test.ts("marks any HyperFrames pricing link as the CLI's, keeping what it already says") andpackages/cli/src/server/sharePresentation.test.ts("preserves authoritative plan free for the upgrade offer") both failed before the fix (dev.hyperframes.studioreturned withoutfrom=cli,local_studio_sharereturned withoutfrom=cli&utm_source=cli).bunx vitest run --sequence.shuffle src/heygen/plan.test.ts src/server/sharePresentation.test.ts: 24/24 passed x3 shuffled.shareRoutes.test.ts,reverse.test.ts,v3.test.ts,billing.test.ts,status-user.test.ts): 191/191 passed.oxlint,oxfmt --check,@hyperframes/clitypecheck, andfallowclean.