Skip to content

Conversation

@bhavya2109sharma
Copy link
Contributor

@bhavya2109sharma bhavya2109sharma commented Nov 10, 2025

Problem

  • Fixes crash when connecting to spaces that have been stopped for long

  • The code was incorrectly accessing node.spaceApp.App.AppType, but the App object is undefined for spaces stopped for long as it deletes the App resource . This caused below error

Error running command aws.smus.openRemoteConnection: Remote connection failed: Cannot read properties of undefined (reading 'AppType'). This is likely caused by the extension that contributes aws.smus.openRemoteConnection.

Solution

Changed to use node.spaceApp.SpaceSettingsSummary.AppType instead, which -

  • Is always available (part of space configuration, not runtime state)
  • Contains the correct AppType value needed for start/stop operations
  • SpaceSettingsSummary comes from ListSpaces API call and it will always returns SpaceSettingsSummary as part of the SpaceDetails.
  • AppType is a required field in SpaceSettingsSummary because every SageMaker space must have an application type (JupyterLab or CodeEditor).

  • Treat all work as PUBLIC. Private feature/x branches will not be squash-merged at release time.
  • Your code changes must meet the guidelines in CONTRIBUTING.md.
  • License: I confirm that my contribution is made under the terms of the Apache 2.0 license.

@bhavya2109sharma bhavya2109sharma requested a review from a team as a code owner November 10, 2025 17:51
@github-actions
Copy link

  • This pull request implements a feat or fix, so it must include a changelog entry (unless the fix is for an unreleased feature). Review the changelog guidelines.
    • Note: beta or "experiment" features that have active users should announce fixes in the changelog.
    • If this is not a feature or fix, use an appropriate type from the title guidelines. For example, telemetry-only changes should use the telemetry type.

Copy link
Contributor

@PotatoWKY PotatoWKY left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make sense because AppType is SpaceSettingsSummary's property, not App's:

ListSpaces response:

{
   "NextToken": "string",
   "Spaces": [ 
      { 
         "CreationTime": number,
         "DomainId": "string",
         "LastModifiedTime": number,
         "OwnershipSettingsSummary": { 
            "OwnerUserProfileName": "string"
         },
         "SpaceDisplayName": "string",
         "SpaceName": "string",
         "SpaceSettingsSummary": { 
            "AppType": "string",
            "RemoteAccess": "string",
            "SpaceStorageSettings": { 
               "EbsStorageSettings": { 
                  "EbsVolumeSizeInGb": number
               }
            }
         },
         "SpaceSharingSettingsSummary": { 
            "SharingType": "string"
         },
         "Status": "string"
      }
   ]
}

Approved

@laileni-aws laileni-aws merged commit 9951253 into aws:master Nov 10, 2025
31 checks passed
@bhavya2109sharma bhavya2109sharma deleted the fix/sagemaker-commands-apptype branch November 12, 2025 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants