-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Summary
brev create failures are opaque. The same error message — instance type X not found — covers four completely different failure modes, giving users no direction for fixing the problem.
Additionally, the CLI sends the create request without first checking whether the instance type is valid, so avoidable failures require a full round-trip (plus a ~10 second spinner) before surfacing.
The problem
All four of these produce identical output:
| Actual cause | Error shown |
|---|---|
| Type string is a genuine typo | not found |
Type exists but CLI is missing workspaceGroupId (see #15) |
not found |
| Type exists but no live capacity right now | not found |
| Type exists but org plan doesn't include it | not found |
A user who sees not found for hyperstack_H100 — a valid, available type — has no path forward without reading Go source code.
Requested: client-side pre-flight
Before calling CreateWorkspace, resolve the instance type through the catalog API and fail fast with an actionable error:
$ brev create my-gpu --type hyperstack_H100
Error: instance type 'hyperstack_H100' could not be provisioned.
Your CLI (v0.6.316) does not pass the required workspaceGroupId for this provider.
brew upgrade brev
If the issue persists, run 'brev search gpu' to see alternatives.
Pre-flight also naturally populates workspaceGroupId — fixing #15 as a side effect.
Requested: server-side gRPC status codes
Return distinct codes per failure mode so client error messages can be targeted:
| Cause | Code | Message |
|---|---|---|
| Type string unknown | NotFound |
"unknown instance type 'X'. Run 'brev search gpu'" |
workspaceGroupId missing/wrong |
InvalidArgument |
"type 'X' requires workspaceGroupId. Update your CLI." |
| No live capacity | ResourceExhausted |
"no capacity for 'X' right now. Alternatives: ..." |
| Plan restriction | PermissionDenied |
"type 'X' not included in your plan" |
Why this matters
Error message quality is the cheapest possible improvement to developer experience — no architecture changes, no new features. The user who sees "update your CLI" spends 30 seconds. The user who sees "not found" spends hours.
CLI version: v0.6.316