Conversation
🦋 Changeset detectedLatest commit: 6ed26f8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📦 CLI Tarball ReadyThe Vercel CLI tarball for this PR is now available! Quick TestYou can test this PR's CLI directly by running: npx https://zero-config-qp9csboes-uncurated-tests.vercel.app/tarballs/vercel.tgz --helpUse in vercel.jsonTo use this CLI version in your project builds, add to your {
"build": {
"env": {
"VERCEL_CLI_VERSION": "vercel@https://zero-config-qp9csboes-uncurated-tests.vercel.app/tarballs/vercel.tgz"
}
}
} |
🧪 Unit Test StrategyComparing: Strategy: Affected packages only ✅ Only testing packages that have been modified or depend on modified packages. Affected packages - 1 (3%)
Unaffected packages - 39 (98%)
Results
This comment is automatically generated based on the affected testing strategy |
This stack of pull requests is managed by Graphite. Learn more about stacking. |
0d5b783 to
e0645dd
Compare
e0645dd to
5eaa87f
Compare
5eaa87f to
cb68d69
Compare
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
cb68d69 to
6ed26f8
Compare
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|

Summary
{ items: [{...}] }but batch threshold API expects bare JSON array[{...}]. Installation-level threshold creation was completely broken.{ store: { id: string } }tovoid(API returns 204 No Content)100 50 2000→50 100 2000(old example violatedminimum <= spendvalidation)spendandlimitparsing:parseInt→parseFloat(was silently truncating decimals)Math.roundafterparseFloat * 100to prevent floating point precision issuesreturn 0→return 1resourceNameinstead ofresourceIdBefore / After
1. API request body (critical fix)
The batch threshold endpoint expects a bare JSON array. The CLI was wrapping it in
{ items: [...] }, causing all installation-level threshold creation to fail.Before — what the CLI sent:
After — correct format:
2. Decimal parsing
Before —
parseIntsilently truncated decimals:After —
parseFloat+Math.roundgives correct cents:3. Help text example
Before — violated
minimum <= spendvalidation (100 > 50):After — valid example:
4. Resource not found exit code
Before:
After:
5. Error message copy
Before:
After:
6. Balance mapping key collision
When merging thresholds into the balance mapping, the
elsebranch keyed by display name (resourceName) instead ofresourceId. This caused lookups to fail when iterating the map.Before:
After:
Test plan
Unit Tests
Test updates:
create-threshold.test.ts: exit code assertion0→1for "resource not found"create-threshold.test.ts: error message assertion "Spend must be" → "Minimum must be"{ items: [...] })Math.roundproduces exact cents for floats like5.75→575Manual Testing
vc integration-resource create-threshold --help50 100 2000my-acme-resource 50 100 2000vc ir create-threshold nonexistent-resource 50 100 2000Error:prefixError: The resource nonexistent-resource was not found.EXIT_CODE=1vc ir create-threshold nonexistent abc 100 2000Minimum must be a positive numbervc ir create-threshold nonexistent 5.75 10.99 1000.50Code paths covered
[...]not{ items: [...] }Math.round()on float-to-cents conversion575not574.99) + manualoutput.error+return 150 100 2000--helpoutput)resourceIdkey--format=jsonoutputNot manually testable (no prepayment integrations on test team): actual threshold creation via batch endpoint, balance display with real prepayment data. Covered by unit tests with mocks.
🤖 Generated with Claude Code
Warning
High Risk Change
CLI bug fixes for billing threshold commands including API body format, decimal parsing with Math.round, exit codes, and error messages - all changes are correctness fixes with comprehensive test coverage.
{ items: [...] }to bare JSON arrayRisk assessment for commit cb68d69.