From cc644caf54f15866db93ef2a8713b7f21384888a Mon Sep 17 00:00:00 2001 From: Sri Aakash Mandavilli Date: Fri, 10 Apr 2026 19:12:30 +0000 Subject: [PATCH] (bug fix): Skipping sagemaker extension activation for non sagemaker environments --- patches/sagemaker/sagemaker-extension.diff | 10 ++++++++-- patches/sagemaker/sagemaker-extensions-sync.diff | 5 ++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/patches/sagemaker/sagemaker-extension.diff b/patches/sagemaker/sagemaker-extension.diff index fb4e961..21f218c 100644 --- a/patches/sagemaker/sagemaker-extension.diff +++ b/patches/sagemaker/sagemaker-extension.diff @@ -2,7 +2,7 @@ Index: third-party-src/extensions/sagemaker-extension/src/extension.ts =================================================================== --- /dev/null +++ third-party-src/extensions/sagemaker-extension/src/extension.ts -@@ -0,0 +1,205 @@ +@@ -0,0 +1,211 @@ +import * as vscode from 'vscode'; +import * as fs from 'fs'; +import { SessionWarning } from "./sessionWarning"; @@ -179,7 +179,13 @@ Index: third-party-src/extensions/sagemaker-extension/src/extension.ts + +export function activate(context: vscode.ExtensionContext) { + -+ // TODO: log activation of extension ++ // this extension will only activate within a sagemaker app ++ const isSageMakerApp = !!process.env?.SAGEMAKER_APP_TYPE_LOWERCASE; ++ if (!isSageMakerApp) { ++ console.log('Skipping activation of Sagemaker Extension...'); ++ return; ++ } ++ + console.log('Activating Sagemaker Extension...'); + + // execute the get cookie command and save the data to cookies diff --git a/patches/sagemaker/sagemaker-extensions-sync.diff b/patches/sagemaker/sagemaker-extensions-sync.diff index 819b5bd..384eabd 100644 --- a/patches/sagemaker/sagemaker-extensions-sync.diff +++ b/patches/sagemaker/sagemaker-extensions-sync.diff @@ -173,7 +173,7 @@ Index: code-editor-src/extensions/sagemaker-extensions-sync/src/extension.ts =================================================================== --- /dev/null +++ code-editor-src/extensions/sagemaker-extensions-sync/src/extension.ts -@@ -0,0 +1,100 @@ +@@ -0,0 +1,103 @@ +import * as process from "process"; +import * as vscode from 'vscode'; + @@ -195,9 +195,12 @@ Index: code-editor-src/extensions/sagemaker-extensions-sync/src/extension.ts + // this extension will only activate within a sagemaker app + const isSageMakerApp = !!process.env?.SAGEMAKER_APP_TYPE_LOWERCASE; + if (!isSageMakerApp) { ++ console.log('Skipping activation of Sagemaker Extension Sync...'); + return; + } + ++ console.log('Activating Sagemaker Extension Sync...'); ++ + // get installed extensions. this could be different from pvExtensions b/c vscode sometimes doesn't delete the assets + // for an old extension when uninstalling or changing versions + const installedExtensions = new Set(await getInstalledExtensions());