Skip to content

fix(cli): --type-id sends no gpu_count; volumes list reads the API's shape; create needs a region - #14

Merged
heydryft merged 1 commit into
mainfrom
fix/type-id-gpu-count-volumes-list
Nov 8, 2026
Merged

heydryft merged 1 commit into
mainfrom
fix/type-id-gpu-count-volumes-list

Conversation

@heydryft

@heydryft heydryft commented Nov 8, 2026

Copy link
Copy Markdown
Member

Torque (a customer, through Neo) hit three CLI bugs, checked against the server (runcrate_app main 6f7780813) and fixed here. Linear RUN-2478 and RUN-2479. The server is right on all three: the check in provisioning.ts is deliberate and the OpenAPI documents the response shape.

1. instances create --type-id always sent gpu_count: 1 (RUN-2478)

--gpu-count defaults to 1 and CreateInstanceRequest.GPUCount is omitempty, but 1 is not empty. The server refuses a gpu_count beside instance_type_id that differs from the type's own (Instance type "..." has 0 GPUs, but gpu_count is 1), so a CPU type (0 GPUs) and every 2, 4 or 8 GPU type failed with a 400; only 1-GPU types worked.

buildInstanceRequest now sends no count with --type-id unless the user gave one (--gpu-count or the colon form --gpu H100:2). schedule create shares the function, so it is fixed too. The --gpu H100:8 auto-pick path is unchanged.

2. volumes list showed 0 GB, a region id and $0.0000 (RUN-2479)

GET /api/v1/storage answers camelCase (sizeGb, createdAt) and the region as its id (OpenAPI StorageVolume: region is "the id of the region the volume was created in, one of GET /storage/regions"); it has no cost field. The CLI struct read size_gb, cost_per_hour, mount_path, created_at.

  • Reads sizeGb and createdAt; drops mount_path and the cost column (the API never sent them).
  • Shows the region's name from volumes regions (582 is eu-west-1); a failed lookup, or an older volume that holds a region name, shows the value as it is.
  • --json now carries the API's keys (sizeGb, createdAt), as the other commands do.

3. volumes create without --region

The API requires it (Missing required fields: name, size_gb, region) but the flag looked optional. It is now said to be required, and the command refuses before signing in or sending anything. The "created" line prints the region the user gave, not the id the API answers with.

Tests

  • internal/api/storage_test.go: decodes the list exactly as the server sends it (fails on the old struct: SizeGB = 0).
  • internal/commands/instances_test.go: a type id alone sends no count; with --gpu-count 8 it sends 8; with --gpu H100:2 it sends 2; auto-deploy without a count is 1; colon form 4 (the first fails on the old code: GPUCount = 1, want 0).
  • internal/commands/storage_test.go: regionLabel (id to name, older name kept, unknown id kept, no regions) and create refusing a missing region.
  • go vet, go test ./... green. Smoke: the built binary prints the region error without a login.

Not in this PR (noticed): the volumes list table has no ID column, though instances create --volume says to take the id from it; --json shows it.

…shape; create needs a region

instances create (and schedule create, which shares buildInstanceRequest) sent gpu_count 1 beside
--type-id, because --gpu-count defaults to 1. The server refuses a gpu_count that differs from the
type's own, so CPU types (0 GPUs) and every 2, 4 or 8 GPU type failed with a 400. With --type-id a
count is now sent only when the user gave one (the flag or the colon form). RUN-2478.

volumes list read size_gb and cost_per_hour; the API answers sizeGb (its OpenAPI StorageVolume) and
no cost, so every volume showed 0 GB and $0.0000, and the region as its id (582 for Wasabi EU West
1). It now reads sizeGb, shows the region's name from `volumes regions` (the id when the lookup
fails or the volume holds an older region name) and drops the cost column. volumes create refuses
a missing --region before signing in: the API requires it. RUN-2479.
@heydryft
heydryft merged commit a44a578 into main Nov 8, 2026
1 check passed
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.

1 participant