Skip to content

fix: gets the alias for paused templates on GetSandboxesSandboxID#2287

Merged
ben-fornefeld merged 4 commits intomainfrom
get-alias-on-paused-templates
Apr 2, 2026
Merged

fix: gets the alias for paused templates on GetSandboxesSandboxID#2287
ben-fornefeld merged 4 commits intomainfrom
get-alias-on-paused-templates

Conversation

@matthewlouisbrockman
Copy link
Copy Markdown
Contributor

@matthewlouisbrockman matthewlouisbrockman commented Apr 2, 2026

For GetSandboxesSandboxID, returns the alias as well as the correct template id

Related to https://linear.app/e2b/issue/ENG-3740/dashboard-template-id-is-not-always-accurate

@cursor
Copy link
Copy Markdown

cursor bot commented Apr 2, 2026

PR Summary

Low Risk
Low risk bugfix that only adjusts the paused-sandbox detail response to populate Alias and updates integration tests to assert it; behavior for running sandboxes is unchanged.

Overview
Fixes GetSandboxesSandboxID so paused sandbox detail responses (served from the latest snapshot) also populate Alias by taking the first snapshot alias, and updates integration tests to assert Alias is present and correct for both running and paused sandboxes.

Written by Cursor Bugbot for commit bf193a9. This will update automatically on new commits. Configure here.

Copy link
Copy Markdown

@claude claude bot left a comment

Choose a reason for hiding this comment

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

LGTM — the paused-path alias fix is correct and the nil guard mirrors good practice.

Extended reasoning...

Overview

This PR modifies GetSandboxesSandboxID in sandbox_get.go to populate the Alias field when returning a paused sandbox from the snapshot cache path. It also adds alias assertions to two integration tests (TestSandboxDetailRunning, TestSandboxDetailPaused).

Security risks

None. The change only adds read-only response shaping — no auth, permissions, or data mutation logic is affected.

Level of scrutiny

Low. The change is a two-line addition to a response-building block, following the same firstAlias helper already used elsewhere in the codebase. The nil guard (if pausedAlias != "") is the correct pattern and consistent with how optional string fields are handled in Go JSON serialization with omitempty.

Other factors

The inline bug comments cover a test-robustness nit (hardcoded "base" string) and a pre-existing asymmetry in the running-path alias handling — neither is introduced by this PR. The fix is self-contained, the test coverage is exercised in both running and paused states, and there are no outstanding reviewer comments.

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

cursoragent and others added 2 commits April 2, 2026 03:12
Co-authored-by: Matt Brockman <matthewlouisbrockman@users.noreply.github.com>
Copy link
Copy Markdown
Member

@ben-fornefeld ben-fornefeld left a comment

Choose a reason for hiding this comment

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

lgtm

@ben-fornefeld ben-fornefeld merged commit 1798413 into main Apr 2, 2026
36 checks passed
@ben-fornefeld ben-fornefeld deleted the get-alias-on-paused-templates branch April 2, 2026 03:45
@linear
Copy link
Copy Markdown

linear bot commented Apr 2, 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.

4 participants