Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import { ChatHistoryActionType } from '../../shared/telemetry/types'
import { TelemetryService } from '../../shared/telemetry/telemetryService'
import { URI } from 'vscode-uri'

const JUPYTERLAB_APP_TYPE_VALUE = 'jupyterlab'

describe('TabBarController', () => {
let testFeatures: TestFeatures
let chatHistoryDb: ChatDatabase
Expand Down Expand Up @@ -50,7 +52,7 @@ describe('TabBarController', () => {
afterEach(() => {
sinon.restore()
clock.restore()
delete process.env.JUPYTER_LAB // Clean up JupyterLab environment variables
delete process.env.SAGEMAKER_APP_TYPE_LOWERCASE // Clean up JupyterLab environment variables
testFeatures.dispose()
})

Expand Down Expand Up @@ -563,7 +565,7 @@ describe('TabBarController', () => {

it('should allow multiple loads in JupyterLab environment', async () => {
// Set JupyterLab environment
process.env.JUPYTER_LAB = 'true'
process.env.SAGEMAKER_APP_TYPE_LOWERCASE = JUPYTERLAB_APP_TYPE_VALUE

const mockTabs = [{ historyId: 'history1', conversations: [{ messages: [] }] }] as unknown as Tab[]
;(chatHistoryDb.getOpenTabs as sinon.SinonStub).returns(mockTabs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { ChatHistoryActionType } from '../../shared/telemetry/types'
import { CancellationError } from '@aws/lsp-core'

const MaxRestoredHistoryMessages = 250
const JUPYTERLAB_APP_TYPE_VALUE = 'jupyterlab'

/**
* Controller for managing chat history and export functionality.
Expand Down Expand Up @@ -344,9 +345,9 @@ export class TabBarController {
*/
private isJupyterLabEnvironment(): boolean {
try {
return process.env.JUPYTER_LAB === 'true'
return process.env.SAGEMAKER_APP_TYPE_LOWERCASE === JUPYTERLAB_APP_TYPE_VALUE
} catch (error) {
this.#features.logging.error(`Failed to read JUPYTER_LAB environment variable: ${error}`)
this.#features.logging.error(`Failed to read SAGEMAKER_APP_TYPE_LOWERCASE environment variable: ${error}`)
return false
}
}
Expand Down
Loading