fix: gets the alias for paused templates on GetSandboxesSandboxID#2287
fix: gets the alias for paused templates on GetSandboxesSandboxID#2287ben-fornefeld merged 4 commits intomainfrom
Conversation
PR SummaryLow Risk Overview Written by Cursor Bugbot for commit bf193a9. This will update automatically on new commits. Configure here. |
There was a problem hiding this comment.
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.
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.
Co-authored-by: Matt Brockman <matthewlouisbrockman@users.noreply.github.com>

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