Skip to content

fix: smarter fallback team selection for scope inference#120

Open
gr2m wants to merge 9 commits intomainfrom
default-team
Open

fix: smarter fallback team selection for scope inference#120
gr2m wants to merge 9 commits intomainfrom
default-team

Conversation

@gr2m
Copy link
Copy Markdown
Contributor

@gr2m gr2m commented Mar 28, 2026

Summary

  • Fetches both /v2/user and /v2/teams in parallel to build an ordered list of candidate teams for scope inference
  • Tries user.defaultTeamId first, then falls back to the best hobby-plan OWNER team (personal team matching username, or most recently updated)
  • Filters fallback candidates by billing.plan === 'hobby' and membership.role === 'OWNER' to avoid selecting pro/enterprise teams
  • On 403, skips to the next candidate instead of failing immediately
  • Only throws after all candidates are exhausted, with a helpful error message including the authenticated username

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 28, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sandbox Ready Ready Preview, Comment, Open in v0 Apr 1, 2026 8:10pm
sandbox-cli Ready Ready Preview, Comment, Open in v0 Apr 1, 2026 8:10pm
sandbox-sdk Ready Ready Preview, Comment, Open in v0 Apr 1, 2026 8:10pm
sandbox-sdk-ai-example Ready Ready Preview, Comment, Open in v0 Apr 1, 2026 8:10pm
workflow-code-runner Ready Ready Preview, Comment, Open in v0 Apr 1, 2026 8:10pm

Request Review

Instead of always falling back to the username, prefer the user's
configured default team (defaultTeamId). Falls back to username
when defaultTeamId is not set.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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