Skip to content

Conversation

@aws-srijach
Copy link
Contributor

@aws-srijach aws-srijach commented Jan 23, 2026

Problem

The getClientName function was checking for a specific environment variable (SERVICE_NAME === SAGEMAKER_UNIFIED_STUDIO_SERVICE) to determine whether to check both initializationOptions.aws.clientInfo.name and clientInfo.name. This limited the logic to only SMUS environments.

Solution

  • Added isSagemakerEnv() function that detects both SMUS and SMAI using environment variables
  • Updated getClientName() to only check when in SageMaker environments
  • Added fallback to standard clientInfo.name

Notes

  • using lspParams?.initializationOptions?.aws?.clientInfo?.name only for unified studio was done for code editor support, but this breaks SMUS jupyter lab support, which uses lspParams?.clientInfo?.name hence the move to||
  • we (sagemaker AI studio, seperate from unified studio) need to use lspParams?.initializationOptions?.aws?.clientInfo?.name as well.

Testing

Tested in both SMUS and SMAI environments for JupyterLab and CodeEditor

@aws-srijach aws-srijach requested a review from a team as a code owner January 23, 2026 18:39
@aws-srijach aws-srijach force-pushed the SageMakerAI_TenantChanges branch from ef40411 to adb3e31 Compare January 23, 2026 18:51
? lspParams?.initializationOptions?.aws?.clientInfo?.name
: lspParams?.clientInfo?.name
return lspParams?.initializationOptions?.aws?.clientInfo?.name || lspParams?.clientInfo?.name
}
Copy link

@joshuatowner joshuatowner Jan 23, 2026

Choose a reason for hiding this comment

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

some notes & context (@aws-srijach please add to the description):

  • using lspParams?.initializationOptions?.aws?.clientInfo?.name only for unified studio was done for code editor support, but this breaks SMUS jupyter lab support, which uses lspParams?.clientInfo?.name. hence the move to ||
  • we (sagemaker AI studio, seperate from unified studio) need to use lspParams?.initializationOptions?.aws?.clientInfo?.name as well. I would strongly prefer to remove the environment variable check as (1) it does not scale if and when more folks want to use this (2) we do not have an easy env variable flag to add here (3) this environment variable flag provides no protection, why would a non-SMUS service set this configuration option if it's a no-op?

let me know if folks have concerns

Choose a reason for hiding this comment

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

update - I see nwo that initializationOptions?.aws?.clientInfo?.name is used for multiple purposes. looking into how we can gate this since other clients will set this

Copy link

@joshuatowner joshuatowner Jan 26, 2026

Choose a reason for hiding this comment

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

we decided to gate this so all SM setups will use lspParams?.initializationOptions?.aws?.clientInfo?.name || lspParams?.clientInfo?.name. this works as:

  • CE will remain the same, pulling from lspParams?.initializationOptions?.aws?.clientInfo?.name
  • JL will still use lspParams?.clientInfo?.name, as lspParams?.initializationOptions?.aws?.clientInfo?.name is not set. we have confirmed this in SMUS and SMAI, we are testing the final set of changes together currently.

@aws-srijach aws-srijach force-pushed the SageMakerAI_TenantChanges branch from 7d615f1 to 30e59d8 Compare January 26, 2026 20:04
@aws-srijach aws-srijach changed the title fix: remove env variable check to support SMAI fix: extend SageMaker env detection to support both SMUS and SMAI Jan 26, 2026
@aws-srijach aws-srijach force-pushed the SageMakerAI_TenantChanges branch from 30e59d8 to 48f05ba Compare January 26, 2026 21:11
Copy link

@aakashmandavilli96 aakashmandavilli96 left a comment

Choose a reason for hiding this comment

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

LGTM

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 84.61538% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.65%. Comparing base (55f4c34) to head (9f3aed3).

Files with missing lines Patch % Lines
server/aws-lsp-codewhisperer/src/shared/utils.ts 84.61% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2598      +/-   ##
==========================================
+ Coverage   60.60%   60.65%   +0.04%     
==========================================
  Files         278      278              
  Lines       65227    65238      +11     
  Branches     4154     4161       +7     
==========================================
+ Hits        39533    39568      +35     
+ Misses      25610    25586      -24     
  Partials       84       84              
Flag Coverage Δ
unittests 60.65% <84.61%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ashishrp-aws ashishrp-aws merged commit 12fbc4c into aws:main Feb 9, 2026
6 checks passed
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.

8 participants