Dashboard template id is not always accurate eng 3740#2285
Dashboard template id is not always accurate eng 3740#2285matthewlouisbrockman merged 11 commits intomainfrom
Conversation
PR SummaryMedium Risk Overview Written by Cursor Bugbot for commit 1db1916. This will update automatically on new commits. Configure here. |
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.
…ateid) for historical purposes

Problem:
/sandboxes/{sandboxID}would return templateID which could be either the base template ID or a snapshot/ env ID depending on sandbox state. The dashboard fallback record query also surfaced env_id directly for killed sandboxes, so users could see different IDs for the same sandbox across running, paused, resumed, and killed states.Solution:
Updates the DB query to select the base_env_id or the env_id instead of just env_id to get the actual template id.
Similarly, ensures we use base_template_id wherever we were expecting template_id when reporting the template_id to the user in sandbox API responses and dashboard fallback sandbox record responses, so templateID consistently means the base template ID at the API boundary.
Remaining: We should normalize what we mean by template_id throughout the infra repo, not addressed in this PR (started to address it but simplified the change because the full review is gonna be gnarly; that would require a separate refactor)