fix(cli): resolve team ID from env var, avoid config mismatch#1121
fix(cli): resolve team ID from env var, avoid config mismatch#1121tomassrnka merged 1 commit intomainfrom
Conversation
🦋 Changeset detectedLatest commit: 905172f 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 |
43bf51a to
7979d3f
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a774616256
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
a774616 to
2c42ae9
Compare
When E2B_API_KEY is set via environment variable, the CLI was still reading teamId from ~/.e2b/config.json, causing "Team ID param mismatch" errors when the config file belonged to a different team. Add E2B_TEAM_ID env var support and a resolveTeamId() helper with proper precedence: CLI --team flag > E2B_TEAM_ID env var > config file (config file team ID is only used when E2B_API_KEY env var is NOT set). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2c42ae9 to
905172f
Compare
Summary
~/.e2b/config.json, avoiding "Team ID param mismatch with the API key" errors
file (only when E2B_API_KEY env var is not set)
Problem
When using E2B_API_KEY env var (e.g. for local development or CI with a different team), the CLI still
reads teamId from ~/.e2b/config.json and sends it as a query parameter. If the config file belongs to a
different team than the API key, the API rejects the request with 400: Team ID param mismatch with the
API key.
Changes
fallback
Test plan
should work (no mismatch error)
Note
Low Risk
Small, localized change to CLI argument/env/config precedence for team selection; main risk is behavior changes for users relying on implicit
~/.e2b/config.jsonteamId when also settingE2B_API_KEY.Overview
Fixes sandbox template commands failing with "Team ID param mismatch" when
E2B_API_KEYis set via environment by changing team resolution precedence and avoiding~/.e2b/config.jsonteam fallback in that case.Introduces
E2B_TEAM_IDand a centralizedresolveTeamId()helper (CLI flag > env var > locale2b.toml> user config only when no env API key), and updates templatebuild,list,delete, andpublishflows to use it consistently. Adds a changeset bump for@e2b/cli.Written by Cursor Bugbot for commit 905172f. This will update automatically on new commits. Configure here.