fix(cli): add implicit limit to sandbox list#1164
Conversation
🦋 Changeset detectedLatest commit: 3a29103 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 |
Package ArtifactsBuilt from fbd1a1a. Download artifacts from this workflow run. JS SDK ( npm install ./e2b-2.13.1-chore-add-default-limit-to-cli-list.0.tgzCLI ( npm install ./e2b-cli-2.7.3-chore-add-default-limit-to-cli-list.0.tgzPython SDK ( pip install ./e2b-2.14.0+chore.add.default.limit.to.cli.list-py3-none-any.whl |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3a291032c3
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const sandboxes = await listSandboxes({ | ||
| limit: options.limit, | ||
| const limit = | ||
| options.limit === 0 ? undefined : (options.limit ?? DEFAULT_LIMIT) |
There was a problem hiding this comment.
Guard against NaN limit bypassing implicit cap
When --limit is passed a non-numeric value (for example --limit foo), parseInt yields NaN, and this expression keeps that NaN instead of falling back to DEFAULT_LIMIT. In listSandboxes, NaN is then treated as falsy by !limit, which makes the loop behave like “no limit” and can fetch the full sandbox list, defeating the new implicit cap and potentially causing unexpectedly large/unbounded queries from a simple typo.
Useful? React with 👍 / 👎.
Note
Low Risk
Low risk: CLI-only behavior change that adds a default cap and minor output messaging; main risk is surprising users who previously relied on unlimited listing unless they pass
--limit 0.Overview
Adds an implicit default limit to
sandbox list(now defaults to1000, with--limit 0meaning no limit) to avoid unbounded sandbox listing.Updates
listSandboxesto return{ sandboxes, hasMore }and prints a note in pretty output when results are truncated, while keeping API pagination capped at100per page.Written by Cursor Bugbot for commit 3a29103. This will update automatically on new commits. Configure here.