@@ -183,7 +183,6 @@ export function hasSageMakerEnvVars(): boolean {
183183 * 2. Returns false for SageMaker environments (even if host is AL2)
184184 * 3. Checks `/etc/os-release` with fallback to `/usr/lib/os-release`
185185 * - Standard Linux OS identification files
186- * - Explicitly checks for and rejects Amazon Linux 2023
187186 * - Looks for `ID="amzn"` and `VERSION_ID="2"` for AL2
188187 * 4. Falls back to kernel version check as last resort
189188 * - Checks for `.amzn2.` or `.amzn2int.` in kernel release
@@ -192,7 +191,6 @@ export function hasSageMakerEnvVars(): boolean {
192191 * This approach ensures correct detection in:
193192 * - Containerized environments (detects container OS, not host)
194193 * - Web/browser environments (returns false)
195- * - Amazon Linux 2023 systems (properly distinguished from AL2)
196194 * - SageMaker environments (returns false)
197195 *
198196 * References:
@@ -233,15 +231,8 @@ export function isAmazonLinux2() {
233231 const osReleaseContent = fs . readFileSync ( osReleasePath , 'utf8' )
234232 const osRelease = parseOsRelease ( osReleaseContent )
235233
236- // Check if this is Amazon Linux 2023 (not AL2)
237- if ( osRelease . VERSION_ID === '2023' || osRelease . PLATFORM_ID === 'platform:al2023' ) {
238- // This is Amazon Linux 2023, not AL2
239- return false
240- }
241-
242234 // Check if this is actually Amazon Linux 2
243- // Must be specifically version 2, not 2023 or other versions
244- const isAL2 = osRelease . ID === 'amzn' && osRelease . VERSION_ID === '2'
235+ const isAL2 = osRelease . VERSION_ID === '2' && osRelease . ID === 'amzn'
245236
246237 // If we found os-release file, trust its content over kernel version
247238 if ( ! isAL2 ) {
0 commit comments