diff --git a/packages/core/src/sagemakerunifiedstudio/explorer/activation.ts b/packages/core/src/sagemakerunifiedstudio/explorer/activation.ts index 2179b767ffa..b42f0e8944e 100644 --- a/packages/core/src/sagemakerunifiedstudio/explorer/activation.ts +++ b/packages/core/src/sagemakerunifiedstudio/explorer/activation.ts @@ -113,6 +113,11 @@ export async function activate(extensionContext: vscode.ExtensionContext): Promi if (connection) { try { await smusAuthProvider.reauthenticate(connection) + const projectNode = smusRootNode.getProjectSelectNode() + const project = projectNode.getProject() + if (!project) { + await vscode.commands.executeCommand('aws.smus.switchProject') + } treeDataProvider.refresh() // IAM connections handle their own success messages diff --git a/packages/core/src/test/sagemakerunifiedstudio/explorer/activation.test.ts b/packages/core/src/test/sagemakerunifiedstudio/explorer/activation.test.ts index c5c6932184b..61b2d097d5c 100644 --- a/packages/core/src/test/sagemakerunifiedstudio/explorer/activation.test.ts +++ b/packages/core/src/test/sagemakerunifiedstudio/explorer/activation.test.ts @@ -61,7 +61,10 @@ describe('SMUS Explorer Activation', function () { mockSmusRootNode = { getChildren: sinon.stub().resolves([]), - getProjectSelectNode: sinon.stub().returns({ refreshNode: sinon.stub().resolves() }), + getProjectSelectNode: sinon.stub().returns({ + getProject: sinon.stub().returns({ id: 'test-project', name: 'Test Project' }), + refreshNode: sinon.stub().resolves(), + }), } as any // Stub vscode APIs