Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/app/sbx/new/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,19 @@ export const GET = async (req: NextRequest) => {
}

const sbx = await Sandbox.create('base', {
apiUrl: process.env.NEXT_PUBLIC_INFRA_API_URL,
domain: process.env.NEXT_PUBLIC_E2B_DOMAIN,
apiHeaders: {
...authHeaders(authContext.accessToken, team.id),
Comment on lines 32 to 36

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 Use terminal lifecycle for /sbx/new sandboxes

When a user opens /sbx/new and then leaves the redirected terminal idle until its timeout, this sandbox is still created with the SDK's default timeout lifecycle, which kills it instead of pausing it. The terminal-specific creator in src/features/dashboard/terminal/sandbox-session.ts sets lifecycle: { onTimeout: 'pause', autoResume: true }, and SandboxTerminalView has a resume flow for paused sandboxes; without the same lifecycle here, these new terminal sandboxes cannot be resumed after timing out.

Useful? React with 👍 / 👎.

},
})

const filesystemUrl = PROTECTED_URLS.SANDBOX_FILESYSTEM(
const terminalUrl = PROTECTED_URLS.SANDBOX_TERMINAL(
team.slug,
sbx.sandboxId
)

return NextResponse.redirect(new URL(filesystemUrl, req.url))
return NextResponse.redirect(new URL(terminalUrl, req.url))
} catch (error) {
l.warn(
{
Expand Down
Loading