From 294fc136b97d6fa70d411af07483bc0a1c7961c2 Mon Sep 17 00:00:00 2001 From: Astro Code Agent Date: Thu, 29 Jan 2026 16:16:07 +0000 Subject: [PATCH] fix(ide): open session URL after project export When exporting a project to Astro IDE via `astro ide project export`, the CLI now opens the session URL instead of the project URL. This ensures the user lands directly on their imported project's session rather than a blank page. The issue occurred because the frontend now requires session IDs in the URL path for IDE pages. Previously, the CLI was opening the project URL without a session ID, causing the page to appear blank. [BUILD-839] Co-Authored-By: Claude Opus 4.5 --- cloud/ide/project.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/cloud/ide/project.go b/cloud/ide/project.go index c81bdebbc..ba9c6d0d0 100644 --- a/cloud/ide/project.go +++ b/cloud/ide/project.go @@ -238,11 +238,16 @@ func saveSessionAndCleanup(client astrocore.CoreClient, organizationID, workspac } // openProjectInBrowser opens the project URL in the default browser -func openProjectInBrowser(client astrocore.CoreClient, organizationID, workspaceID, projectID string, out io.Writer) { +// If sessionID is provided, opens the session URL instead of the project URL +func openProjectInBrowser(client astrocore.CoreClient, organizationID, workspaceID, projectID, sessionID string, out io.Writer) { projectResp, err := getProject(client, organizationID, workspaceID, projectID) var url string if err == nil && projectResp != nil && projectResp.JSON200 != nil && projectResp.JSON200.Url != nil && *projectResp.JSON200.Url != "" { url = *projectResp.JSON200.Url + // If sessionID is provided, append the session path to the URL + if sessionID != "" { + url = fmt.Sprintf("%s/sessions/%s", url, sessionID) + } } else { return } @@ -354,8 +359,8 @@ func ExportProject(client astrocore.CoreClient, projectID, organizationID, works fmt.Fprintf(out, "Successfully exported project to %s\n", projectID) - // Open project in browser - openProjectInBrowser(client, organizationID, workspaceID, projectID, out) + // Open project session in browser + openProjectInBrowser(client, organizationID, workspaceID, projectID, sessionResp.JSON200.Id, out) return nil }