File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
server/aws-lsp-codewhisperer/src/language-server/agenticChat Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,8 @@ import { ChatHistoryActionType } from '../../shared/telemetry/types'
1515import { TelemetryService } from '../../shared/telemetry/telemetryService'
1616import { URI } from 'vscode-uri'
1717
18+ const JUPYTERLAB_APP_TYPE_VALUE = 'jupyterlab'
19+
1820describe ( 'TabBarController' , ( ) => {
1921 let testFeatures : TestFeatures
2022 let chatHistoryDb : ChatDatabase
@@ -50,7 +52,7 @@ describe('TabBarController', () => {
5052 afterEach ( ( ) => {
5153 sinon . restore ( )
5254 clock . restore ( )
53- delete process . env . JUPYTER_LAB // Clean up JupyterLab environment variables
55+ delete process . env . SAGEMAKER_APP_TYPE_LOWERCASE // Clean up JupyterLab environment variables
5456 testFeatures . dispose ( )
5557 } )
5658
@@ -563,7 +565,7 @@ describe('TabBarController', () => {
563565
564566 it ( 'should allow multiple loads in JupyterLab environment' , async ( ) => {
565567 // Set JupyterLab environment
566- process . env . JUPYTER_LAB = 'true'
568+ process . env . SAGEMAKER_APP_TYPE_LOWERCASE = JUPYTERLAB_APP_TYPE_VALUE
567569
568570 const mockTabs = [ { historyId : 'history1' , conversations : [ { messages : [ ] } ] } ] as unknown as Tab [ ]
569571 ; ( chatHistoryDb . getOpenTabs as sinon . SinonStub ) . returns ( mockTabs )
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ import { ChatHistoryActionType } from '../../shared/telemetry/types'
2222import { CancellationError } from '@aws/lsp-core'
2323
2424const MaxRestoredHistoryMessages = 250
25+ const JUPYTERLAB_APP_TYPE_VALUE = 'jupyterlab'
2526
2627/**
2728 * Controller for managing chat history and export functionality.
@@ -344,9 +345,9 @@ export class TabBarController {
344345 */
345346 private isJupyterLabEnvironment ( ) : boolean {
346347 try {
347- return process . env . JUPYTER_LAB === 'true'
348+ return process . env . SAGEMAKER_APP_TYPE_LOWERCASE === JUPYTERLAB_APP_TYPE_VALUE
348349 } catch ( error ) {
349- this . #features. logging . error ( `Failed to read JUPYTER_LAB environment variable: ${ error } ` )
350+ this . #features. logging . error ( `Failed to read SAGEMAKER_APP_TYPE_LOWERCASE environment variable: ${ error } ` )
350351 return false
351352 }
352353 }
You can’t perform that action at this time.
0 commit comments