diff --git a/cli/internal/runsummary/spaces.go b/cli/internal/runsummary/spaces.go index 2026d87295a0b..316a82342b28f 100644 --- a/cli/internal/runsummary/spaces.go +++ b/cli/internal/runsummary/spaces.go @@ -49,17 +49,24 @@ func newSpacesClient(spaceID string, api *client.APIClient, ui cli.Ui) *spacesCl api: api, ui: ui, spaceID: spaceID, - enabled: spaceID != "", + enabled: false, // Start with disabled requests: make(chan *spaceRequest), // TODO: give this a size based on tasks runCreated: make(chan struct{}, 1), run: &spaceRun{}, } - if c.enabled && !c.api.IsLinked() { - c.errors = append(c.errors, fmt.Errorf("Error: experimentalSpaceId is enabled, but repo is not linked to a Space. Run `turbo link --target=spaces`")) - c.enabled = false + if spaceID == "" { + return c } + if !c.api.IsLinked() { + c.errors = append(c.errors, fmt.Errorf("Error: experimentalSpaceId is enabled, but repo is not linked to API. Run `turbo link` or `turbo login` first")) + return c + } + + // Explicitly enable if all conditions are met + c.enabled = true + return c }