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 all 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 |
|---|---|---|
|
|
@@ -35,15 +35,19 @@ final class NewMachineModel { | |
|
|
||
| /// 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] | ||
| static let memoryOptionsMb: [Int] = [planMachineMemoryMb] | ||
| /// The plan machine (`PLAN_MACHINE_MEMORY_MB`): 20 GB, 5 vCPU, 200 GB disk, | ||
| /// the only size /pricing sells. | ||
| static let planMachineMemoryMb = 20480 | ||
| /// Mirrors `maxMemoryMbForPlan`: the free machine is a full-size computer; | ||
| /// paid plans unlock the largest size. | ||
| 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 | ||
|
|
@@ -177,7 +181,10 @@ final class NewMachineModel { | |
| switch mode { | ||
| case .newMachine: | ||
| var arguments = ["vm", "new", kind == .desktop ? "--desktop" : "--base"] | ||
| if supportsSize { | ||
| // `--size` travels only for a non-default pick: an omitted size lets | ||
| // the backend apply its plan default, which an operator memory brake | ||
| // (`CMUX_VM_*_MAX_MEMORY_MB`) may have clamped below the plan machine. | ||
| 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.