feat: wire up memory_mb and cpus in builds API#108
Merged
hiroTamada merged 4 commits intomainfrom Feb 26, 2026
Merged
Conversation
✱ Stainless preview buildsThis PR will update the
|
Parse the existing memory_mb and cpus fields from the multipart form data in the /builds endpoint. These fields were already defined in the OpenAPI spec but were not being read by the API handler. Made-with: Cursor
0a57bea to
7d4d062
Compare
Document memory_mb and cpus as form fields in the /builds endpoint so they appear in generated SDKs (e.g., hypeman-go). Made-with: Cursor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
added 2 commits
February 26, 2026 14:13
Change ApplyDefaults() to use <= 0 instead of == 0 for TimeoutSeconds, MemoryMB, and CPUs. This prevents negative values from bypassing defaults and causing VM creation failures. Made-with: Cursor
- Max 8 vCPUs and 16GB memory for builder VMs - Returns 400 error if limits exceeded Made-with: Cursor
sjmiller609
approved these changes
Feb 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
memory_mbandcpusfields from the multipart form data in the/buildsendpointmemory_mbandcpusto the/buildsendpoint's OpenAPI schema so they appear in generated SDKsApplyDefaults()Test plan
memory_mbvalue uses the specified memorycpusvalue uses the specified CPU countcpus > 8returns 400 errormemory_mb > 16384returns 400 errorNote
Medium Risk
Changes how build resource limits are accepted and validated, which can affect builder VM sizing and build scheduling. Risk is mitigated by added server-side bounds checks and defaulting behavior.
Overview
Wires
memory_mbandcpusthrough thePOST /buildsmultipart handler so callers can request builder VM memory/CPU alongsidetimeout_seconds, and rejects out-of-range values with a 400 via newBuildPolicy.Validate()limits.Updates the OpenAPI schema (and regenerated
swaggerSpec/SDK types) to exposememory_mbandcpus, and tweaksBuildPolicy.ApplyDefaults()to treat non-positive values as “use defaults”.Written by Cursor Bugbot for commit cec8115. This will update automatically on new commits. Configure here.