SageMaker open Remote IDE, found time-out bug on Kiro
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 807
- Avg merge
- 10h 12m
- Merged PRs (30d)
- 7
Description
## Problem
When connecting to a SageMaker Space via the SageMaker SSH Plugin for Kiro, the connection fails with "Timed out waiting for the SSM session to be ready" because the SSM session readiness timeout is hardcoded at 30 seconds (const ve=30 in the minified extension.js).
For the deeplink credential type, the Get-SSMSessionInfoAsync function in sagemaker_connect.ps1 uses an async polling loop (up to 8 retries × 5 seconds = 40 seconds) to wait for the session to become ready. The backend may return HTTP 202 on the first attempt, requiring at least one 5-second retry. In regions with higher latency (e.g., ap-east-1), the 30-second timeout in the extension fires before the PowerShell script finishes its retry loop, even though the session would succeed on the next attempt.
In the logs, the first connection attempt times out at 30 seconds while the script is sleeping between retries. Kiro then starts a second attempt, which succeeds (HTTP 200 on attempt 2), but the timeout from the first attempt's race condition has already triggered the error.
The SSM session timeout should be a user-configurable setting rather than a hardcoded constant, so users in higher-latency regions or with slower session provisioning can adjust it.
Steps to reproduce the issue
Open Kiro on Windows
Connect to a SageMaker Space in ap-east-1 region using deeplink credentials
The async session endpoint returns HTTP 202 on the first poll, requiring a retry
The extension times out at 30 seconds before the retry completes
Error shown: "Failed to establish SSM session: Error: Timed out waiting for the SSM session to be ready."
Expected behavior
The SSM session timeout should be configurable via a setting such as aws.sagemaker.ssh.kiro.ssmSessionTimeout (default: 30 seconds)
The default timeout should be long enough to accommodate the async retry loop in sagemaker_connect.ps1 (which can take up to 40 seconds), or at minimum be aligned with it
Alternatively, increase the default timeout to 60 seconds to cover typical async session provisioning delays
System details
OS: Windows
IDE: Kiro
SageMaker SSH Plugin version: 0.2.0
Region: ap-east-1
Credential type: deeplink
Contributor guide
Research direction
Start by tracing the hardcoded 30-second timeout in the extension.js path and the polling behavior in sagemaker_connect.ps1. Identify the corresponding source and configuration entry points, then verify that the SSM session timeout can be adjusted and accommodates the documented retry duration without the first attempt timing out prematurely.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, powershell, typescript
- Domain
- cloud, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100