Repository navigation
Pricing: Pro $50, Team $60, plan machine 5 vCPU / 20 GB / 200 GB, 50 VMs #11610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 11 commits
eaf19ea
0d488c2
933e70f
f9b425d
1ff6dab
53d8d34
ce5250b
0f02cd0
360fcdd
102dcc4
a15ecdc
855412c
17fcdc0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,16 +31,20 @@ final class NewMachineModel { | |
| typealias Launch = @MainActor ([String], @escaping @MainActor (CloudVMActionLauncher.Completion) -> Void) -> Bool | ||
|
|
||
| /// Memory sizes the backend accepts (`VM_MEMORY_OPTIONS_MB` in | ||
| /// `web/services/vms/entitlements.ts`); the plan ceiling trims the tail. | ||
| static let memoryOptionsMb: [Int] = [2048, 4096, 8192, 16384, 24576, 32768] | ||
| /// Mirrors `maxMemoryMbForPlan`: the free machine is a full-size computer; | ||
| /// paid plans unlock the largest size. | ||
| /// `web/services/vms/entitlements.ts`): exactly the plan machine, so the | ||
| /// picker mirrors what /pricing promises. The plan ceiling trims the tail. | ||
| static let memoryOptionsMb: [Int] = [planMachineMemoryMb] | ||
| /// The plan machine (`PLAN_MACHINE_MEMORY_MB`): 20 GB, 5 vCPU, 200 GB disk. | ||
| static let planMachineMemoryMb = 20480 | ||
| /// Mirrors `maxMemoryMbForPlan`: every plan, free included, gets the plan | ||
| /// machine; the paywall is machine count and the free access window. | ||
| static func maxMemoryMb(planId: String?) -> Int { | ||
| planId == nil || planId == "free" ? 24576 : 32768 | ||
| _ = planId | ||
| return planMachineMemoryMb | ||
| } | ||
| /// Mirrors `defaultMemoryMbForPlan`: 24 GB, never above the plan's max. | ||
| /// Mirrors `defaultMemoryMbForPlan`: the plan machine, never above the max. | ||
| static func defaultMemoryMb(planId: String?) -> Int { | ||
| min(24576, maxMemoryMb(planId: planId)) | ||
| min(planMachineMemoryMb, maxMemoryMb(planId: planId)) | ||
| } | ||
|
|
||
| let mode: Mode | ||
|
|
@@ -173,11 +177,14 @@ final class NewMachineModel { | |
|
|
||
| /// The exact CLI invocation the create runs. Kind travels as `--base` / | ||
| /// `--desktop`; the backend maps it to an image, so no image id is pinned. | ||
| /// `--size` travels only for a non-default pick: an omitted size lets the | ||
| /// backend apply its own plan default, which an operator memory brake | ||
| /// (`CMUX_VM_*_MAX_MEMORY_MB`) may have clamped below the plan machine. | ||
| var cliArguments: [String] { | ||
| switch mode { | ||
| case .newMachine: | ||
| var arguments = ["vm", "new", kind == .desktop ? "--desktop" : "--base"] | ||
| if supportsSize { | ||
| if supportsSize, memoryMb != Self.defaultMemoryMb(planId: plan?.planId) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Keep unsupported memory out of the request.
Make the single plan-machine size unrepresentable in 🤖 Prompt for AI AgentsSource: Coding guidelines |
||
| arguments += ["--size", String(memoryMb)] | ||
| } | ||
| if let trimmedName { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.