Skip to content

fix(sandbox): add sandbox to the root command#128

Merged
amir-at-bunny merged 3 commits into
mainfrom
sandbox-cli-example
Jul 16, 2026
Merged

fix(sandbox): add sandbox to the root command#128
amir-at-bunny merged 3 commits into
mainfrom
sandbox-cli-example

Conversation

@amir-at-bunny

Copy link
Copy Markdown
Collaborator

No description provided.

@bogdan-at-bunny

Copy link
Copy Markdown

@codex review

@changeset-bot

changeset-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a3c92c7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
@bunny.net/sandbox Patch
@bunny.net/cli Patch
@bunny.net/cli-linux-x64 Patch
@bunny.net/cli-linux-arm64 Patch
@bunny.net/cli-darwin-x64 Patch
@bunny.net/cli-darwin-arm64 Patch
@bunny.net/cli-windows-x64 Patch

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a6968a29d9

ℹ️ 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 name = (app as { name?: string }).name ?? options.appId;
const appName = (app as { name?: string }).name;
const name = appName ? sandboxNameFor(appName) : options.appId;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve legacy sandbox-prefixed app names

When Sandbox.get() is used on sandboxes created by earlier SDK versions without an explicit name, their MC app name is already sandbox-<hex> because the old generated name included the prefix. This unconditionally strips that prefix, so reconnecting by app ID changes sandbox.name/toHandle().name from sandbox-<hex> to <hex>, which can break callers that key persisted handles or UI state by the sandbox name. Please distinguish newly prefixed app names from legacy names, or preserve the app name when that distinction is unavailable.

Useful? React with 👍 / 👎.


const appId = await createApp(client, {
name,
name: appNameFor(name),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reserve prefix length before creating the MC app

When callers pass a sandbox name between 93 and 100 characters, the name previously fit the MC app schema, but adding sandbox- here sends a value over the 100-character API limit (AddApplicationRequest.name in packages/openapi-client/specs/magic-containers.json caps it at 100). This makes otherwise valid Sandbox.create({ name }) calls fail at create time; validate the user-facing sandbox name against the reduced limit or otherwise account for the prefix before calling createApp.

Useful? React with 👍 / 👎.

@amir-at-bunny
amir-at-bunny merged commit f6b64a3 into main Jul 16, 2026
1 check passed
@amir-at-bunny
amir-at-bunny deleted the sandbox-cli-example branch July 16, 2026 13:58
@github-actions github-actions Bot mentioned this pull request Jul 16, 2026
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.

3 participants