Conversation
…integrations The `integration remove`, `integration balance`, and `integration open` commands always failed with "No integration found" / "No installations found" because the API call to fetch configurations was missing the `teamId` query parameter. The root cause: `fetchMarketplaceIntegrations` relied on `client.fetch` to automatically inject `teamId` from `client.config.currentTeam`. But for users whose team is resolved via `defaultTeamId` (northstar users), `config.currentTeam` is undefined, so no `teamId` was ever sent. The API then returned results for the user's personal account (which has no marketplace integrations) instead of the team. In contrast, `integration list` worked fine because `getResources` explicitly passes `teamId` as a query parameter. The fix adds an explicit `teamId` parameter to `fetchMarketplaceIntegrations` and `getFirstConfiguration`, matching the pattern used by `getResources`. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 8556e0c 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://vercel-mstk7k2fq.vercel.sh/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://vercel-mstk7k2fq.vercel.sh/tarballs/vercel.tgz"
}
}
}Python Runtime WheelA Python runtime wheel was also built for this PR. |
🧪 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 |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…Id fallback - Add useCurrentTeam: false to prevent redundant teamId override from client.fetch - Add test verifying integration remove works when currentTeam is not set (defaultTeamId fallback) - Restructure useUser() calls so each describe block manages its own user setup Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and publish to npm yourself or [setup this action to publish automatically](https://github.com/changesets/action#with-publishing). If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## vercel@50.18.0 ### Minor Changes - Support easier auth from cursor / claude ([#15050](#15050)) ### Patch Changes - non-interactive mode for link ([#14884](#14884)) - Add experimental manual deployment support ([#14857](#14857)) - Fix `integration remove`, `integration balance`, and `integration open` commands failing to find integrations by explicitly passing `teamId` to the configurations API ([#15054](#15054)) - Require slash syntax for multi-product integrations in non-TTY mode, keep interactive product selector for TTY ([#15047](#15047)) - Move builders back into bundle ([#15059](#15059)) - Updated dependencies \[[`463395162462988e7d3276781d2fdff0685e225b`](4633951), [`6e58410ff849c281735c6acae59b3b0e86136f15`](6e58410)]: - @vercel/go@3.4.1 - @vercel/ruby@2.3.1 - @vercel/python@6.13.0 - @vercel/static-build@2.8.37 ## @vercel/python@6.13.0 ### Minor Changes - Add runtime dependency install to support larger Python functions ([#14976](#14976)) This adds logic to calculate the total size of a lambda at build time and offload dependencies to a \_runtime_requirements.txt file so they can be installed at runtime by uv. This allows us to deploy functions up to the total size of the /tmp folder. ## @vercel/client@17.2.42 ### Patch Changes - Add experimental manual deployment support ([#14857](#14857)) ## @vercel/fs-detectors@5.8.7 ### Patch Changes - [services] infer workspace from manifest: when workspace is not explicitly configured, infer from nearest manifest to entrypoint ([#14986](#14986)) ## @vercel/go@3.4.1 ### Patch Changes - Forward Go and Ruby dev server output through `startDevServer` stdout/stderr callbacks so service logs are correctly prefixed in multi-service `vercel dev`. ([#14989](#14989)) ## @vercel/ruby@2.3.1 ### Patch Changes - Forward Go and Ruby dev server output through `startDevServer` stdout/stderr callbacks so service logs are correctly prefixed in multi-service `vercel dev`. ([#14989](#14989)) ## @vercel/python-runtime@0.4.1 ### Patch Changes - fix PyPI publication integration in release flow ([#15033](#15033)) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
For Northstar users, `getScope()` resolves the team via `user.defaultTeamId` but does not set `client.config.currentTeam`. This meant `client.fetch()` never auto-appended `teamId`, causing API calls to return empty results or 409 errors. Previously each utility tried to fix this independently by accepting explicit `teamId` params (e.g. PR #15054 for fetchMarketplaceIntegrations). This was whack-a-mole — other utilities like fetchInstallations, fetchInstallationPrepaymentInfo, and getResources had the same bug. Unify the pattern: every integration/integration-resource command now sets `client.config.currentTeam = team.id` after getScope(), matching the established pattern used by ~13 other CLI commands (env, flags, deploy, etc.). All downstream utilities rely on auto-append and no longer accept explicit teamId/team params. - 9 commands: add currentTeam assignment after getScope - 5 utilities: remove explicit teamId params and searchParams - All callers updated to match new signatures - 276 tests pass across 10 test files
For Northstar users, `getScope()` resolves the team via `user.defaultTeamId` but does not set `client.config.currentTeam`. This meant `client.fetch()` never auto-appended `teamId`, causing API calls to return empty results or 409 errors. Previously each utility tried to fix this independently by accepting explicit `teamId` params (e.g. PR #15054 for fetchMarketplaceIntegrations). This was whack-a-mole — other utilities like fetchInstallations, fetchInstallationPrepaymentInfo, and getResources had the same bug. Unify the pattern: every integration/integration-resource command now sets `client.config.currentTeam = team.id` after getScope(), matching the established pattern used by ~13 other CLI commands (env, flags, deploy, etc.). All downstream utilities rely on auto-append and no longer accept explicit teamId/team params. - 9 commands: add currentTeam assignment after getScope - 5 utilities: remove explicit teamId params and searchParams - All callers updated to match new signatures - 276 tests pass across 10 test files
For Northstar users, `getScope()` resolves the team via `user.defaultTeamId` but does not set `client.config.currentTeam`. This meant `client.fetch()` never auto-appended `teamId`, causing API calls to return empty results or 409 errors. Previously each utility tried to fix this independently by accepting explicit `teamId` params (e.g. PR #15054 for fetchMarketplaceIntegrations). This was whack-a-mole — other utilities like fetchInstallations, fetchInstallationPrepaymentInfo, and getResources had the same bug. Unify the pattern: every integration/integration-resource command now sets `client.config.currentTeam = team.id` after getScope(), matching the established pattern used by ~13 other CLI commands (env, flags, deploy, etc.). All downstream utilities rely on auto-append and no longer accept explicit teamId/team params. - 9 commands: add currentTeam assignment after getScope - 5 utilities: remove explicit teamId params and searchParams - All callers updated to match new signatures - 276 tests pass across 10 test files
For Northstar users, `getScope()` resolves the team via `user.defaultTeamId` but does not set `client.config.currentTeam`. This meant `client.fetch()` never auto-appended `teamId`, causing API calls to return empty results or 409 errors. Previously each utility tried to fix this independently by accepting explicit `teamId` params (e.g. PR #15054 for fetchMarketplaceIntegrations). This was whack-a-mole — other utilities like fetchInstallations, fetchInstallationPrepaymentInfo, and getResources had the same bug. Unify the pattern: every integration/integration-resource command now sets `client.config.currentTeam = team.id` after getScope(), matching the established pattern used by ~13 other CLI commands (env, flags, deploy, etc.). All downstream utilities rely on auto-append and no longer accept explicit teamId/team params. - 9 commands: add currentTeam assignment after getScope - 5 utilities: remove explicit teamId params and searchParams - All callers updated to match new signatures - 276 tests pass across 10 test files
…ds (#15183) ## Summary For Northstar users, `getScope()` resolves the team via `user.defaultTeamId` but does **not** set `client.config.currentTeam`. This meant `client.fetch()` never auto-appended `teamId`, causing API calls to scope to the wrong context — returning empty results or 409 "already installed" errors. Previously each utility tried to fix this independently by accepting explicit `teamId` params (e.g. #15054 for `fetchMarketplaceIntegrations`). This was whack-a-mole — other utilities like `fetchInstallations`, `fetchInstallationPrepaymentInfo`, and `getResources` had the same bug. **This PR unifies the pattern:** every integration/integration-resource command now sets `client.config.currentTeam = team.id` after `getScope()`, matching the established pattern used by ~13 other CLI commands (`env`, `flags`, `deploy`, etc.). All downstream utilities rely on auto-append and no longer accept explicit `teamId`/`team` params. ### Changes **9 commands — add `currentTeam` assignment after `getScope`:** - `integration add`, `integration add` (auto-provision), `integration balance` - `integration list`, `integration open`, `integration remove` - `integration-resource disconnect`, `integration-resource create-threshold`, `integration-resource remove` **5 utilities — remove explicit `teamId` params:** - `fetch-marketplace-integrations.ts` (reverts #15054 utility-level fix) - `fetch-installation-prepayment-info.ts` - `get-resources.ts` - `remove-integration.ts` - `delete-resource.ts` **Implicitly fixed utilities** (already relied on auto-append, but `currentTeam` was never set for Northstar users before this PR): - `fetchInstallations` — called from `add.ts` and `add-auto-provision.ts` - `disconnectResourceFromProject`, `provisionStoreResource`, `createAuthorization`, `fetchBillingPlans` **Net effect:** -31 lines, simpler utility signatures, one consistent pattern. ## Test plan ### Unit Tests ``` $ cd packages/cli && pnpm vitest run test/unit/commands/integration/add.test.ts test/unit/commands/integration/add-auto-provision.test.ts test/unit/commands/integration/balance.test.ts test/unit/util/integration/fetch-installation-prepayment-info.test.ts ✓ test/unit/util/integration/fetch-installation-prepayment-info.test.ts (1 test) ✓ test/unit/commands/integration/balance.test.ts (16 tests) ✓ test/unit/commands/integration/add.test.ts (75 tests) ✓ test/unit/commands/integration/add-auto-provision.test.ts (73 tests) Test Files 4 passed (4) Tests 165 passed (165) ``` - [x] Northstar fallback test in balance.test.ts validates teamId is present via auto-append - [x] Mock `useConfiguration` validates `teamId` query param is present (400 if missing) ### Manual Testing All commands tested with `--debug` to verify `teamId` auto-injection in every API URL: | Command | API endpoints hit | teamId present | Result | |---|---|---|---| | `vc integration list` | `/v1/storage/stores` | ✅ | Listed resources correctly | | `vc integration balance upstash` | `/v2/integrations/configurations`, `/v1/storage/stores`, `/v1/integrations/installations/.../billing/balance` | ✅ (all 3) | Retrieved balance info | | `vc integration open upstash` | `/v2/integrations/configurations` | ✅ | Printed SSO URL with correct teamId | | `vc integration add upstash` (legacy) | `/v2/integrations/integration/upstash`, `/v2/integrations/configurations` | ✅ (both) | Reached product selection prompt | | `FF=1 vc integration add upstash/upstash-kv` (auto-provision) | `/v2/integrations/integration/upstash`, `/v2/integrations/configurations` | ✅ (both) | Reached wizard prompts | | `vc integration remove upstash` | `/v2/integrations/configurations` | ✅ | Confirmation prompt appeared | | `vc integration-resource disconnect` | `/v1/storage/stores` | ✅ | Reached resource lookup | ### Code paths covered | Utility function | Old behavior | New behavior | Verified by | |---|---|---|---| | `getResources()` | Manual `teamId` query param | Auto-injected via `currentTeam` | Manual (list, balance, disconnect) + unit | | `fetchMarketplaceIntegrations()` | Manual `teamId` + `useCurrentTeam: false` | Auto-injected (removed opt-out) | Manual (balance, open, remove, add) + unit | | `deleteResource()` | Manual `teamId` from `team` param | Auto-injected | Unit only (destructive) | | `removeIntegration()` | Manual `teamId` from `team` param | Auto-injected | Unit only (destructive) | | `fetchInstallationPrepaymentInfo()` | Manual `teamId` query param | Auto-injected | Manual (balance) + unit | 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- VADE_RISK_START --> > [!NOTE] > Low Risk Change > > This PR refactors CLI commands to set currentTeam after getScope() and removes explicit teamId parameters from utility functions, relying on auto-append behavior - a pattern change affecting 9 commands and 5 utilities but following established patterns used elsewhere in the codebase. > > - Adds `client.config.currentTeam = team.id` assignment in 9 integration commands > - Removes explicit `teamId` parameters from 5 utility functions, relying on client auto-append > - Adds test validating teamId is present via auto-append for Northstar fallback > > <sup>Risk assessment for [commit 416da2a](https://github.com/vercel/vercel/commit/416da2ac237635ecc57a804d13ddf86ae67f8459).</sup> <!-- VADE_RISK_END -->
Summary
The
vercel integration remove,vercel integration balance, andvercel integration openfail today with:Error: No integration <name> found.Error: No installations found for this integrationError: No configuration found for "<name>".Root Cause
These three commands use
fetchMarketplaceIntegrations()to look up integration configurations viaGET /v2/integrations/configurations. This function relied onclient.fetchto automatically inject theteamIdquery parameter fromclient.config.currentTeam.However,
config.currentTeamis only set when users explicitly runvercel teams switch(which persists it to disk) or pass the--scopeflag (in-memory for that invocation). For most users who haven't done either of these,currentTeamis undefined. The team is still resolved correctly bygetScope()(viauser.defaultTeamId), butclient.fetchnever addsteamIdto the API request. The API then returns results scoped to the user's personal account context (which has no marketplace integrations) instead of the team — resulting in an empty response every time.In contrast,
vercel integration listworked correctly becausegetResources()explicitly passesteamIdas a query parameter rather than relying on the automatic injection.This bug affects most users — it only works for users who have explicitly run
vercel teams switchor always use--scope.Fix
teamIdparameter tofetchMarketplaceIntegrations()andgetFirstConfiguration()remove,balance,open) to passteam.idfrom the already-resolved team objectgetResources()in the workingintegration listcommandVerified
teamIdis explicitly included (confirmed via direct API calls)integration removeandintegration balanceagainst real integrations — both now workTest plan
vercel integration remove <slug>finds and removes the integrationvercel integration balance <slug>finds and shows balance infovercel integration open <slug>🤖 Generated with Claude Code
Note
Low Risk Change
Bug fix that explicitly passes teamId parameter to API calls, fixing integration commands that failed when currentTeam was not set; this is a defensive change that ensures proper team scoping rather than loosening access.
teamIdquery parameter tofetchMarketplaceIntegrations()API calluseCurrentTeam: falseto prevent automatic team injectionRisk assessment for commit 8556e0c.