Skip to content

Commit 6858c7f

Browse files
author
ruotingx
committed
feat(amazonq): env var change for JupyterLab conversation history on refresh support
use SAGEMAKER_APP_TYPE_LOWERCASE env var **Description** **Testing Done**
1 parent e4a1717 commit 6858c7f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

server/aws-lsp-codewhisperer/src/language-server/agenticChat/tabBarController.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ describe('TabBarController', () => {
5050
afterEach(() => {
5151
sinon.restore()
5252
clock.restore()
53-
delete process.env.JUPYTER_LAB // Clean up JupyterLab environment variables
53+
delete process.env.SAGEMAKER_APP_TYPE_LOWERCASE // Clean up JupyterLab environment variables
5454
testFeatures.dispose()
5555
})
5656

@@ -563,7 +563,7 @@ describe('TabBarController', () => {
563563

564564
it('should allow multiple loads in JupyterLab environment', async () => {
565565
// Set JupyterLab environment
566-
process.env.JUPYTER_LAB = 'true'
566+
process.env.SAGEMAKER_APP_TYPE_LOWERCASE = 'jupyterlab'
567567

568568
const mockTabs = [{ historyId: 'history1', conversations: [{ messages: [] }] }] as unknown as Tab[]
569569
;(chatHistoryDb.getOpenTabs as sinon.SinonStub).returns(mockTabs)

server/aws-lsp-codewhisperer/src/language-server/agenticChat/tabBarController.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,9 +344,9 @@ export class TabBarController {
344344
*/
345345
private isJupyterLabEnvironment(): boolean {
346346
try {
347-
return process.env.JUPYTER_LAB === 'true'
347+
return process.env.SAGEMAKER_APP_TYPE_LOWERCASE === 'jupyterlab'
348348
} catch (error) {
349-
this.#features.logging.error(`Failed to read JUPYTER_LAB environment variable: ${error}`)
349+
this.#features.logging.error(`Failed to read SAGEMAKER_APP_TYPE_LOWERCASE environment variable: ${error}`)
350350
return false
351351
}
352352
}

0 commit comments

Comments
 (0)