Skip to content

fix(sagemaker): enhance idle activity monitoring for appropriate shutdown#8584

Open
aws-ajangg wants to merge 9 commits intoaws:masterfrom
aws-ajangg:idle-shutdown
Open

fix(sagemaker): enhance idle activity monitoring for appropriate shutdown#8584
aws-ajangg wants to merge 9 commits intoaws:masterfrom
aws-ajangg:idle-shutdown

Conversation

@aws-ajangg
Copy link
Contributor

@aws-ajangg aws-ajangg commented Feb 18, 2026

Problem

  • Users reported code editor and jupyterlab spaces were prematurely or not shutting down when connecting via remote ide. This issue has been addressed by enhancing the idle activity monitoring system

Solution

  • Check for remote ide environment which triggers the last active timestamp script to update. previously this was skipped and the timestamp was not being updated which caused the space to not shut down when idle
  • Add special case for focused window due to event handlers triggering for idle windows in the background
  • Add remaining criteria for idle detection:

No background processes running
No notebook kernels processing
No unsaved work

  • Check for active jupyterlab kernels

Test

  • Tested idle detection locally with new VSIX
  • Internal bugbash

  • Treat all work as PUBLIC. Private feature/x branches will not be squash-merged at release time.
  • Your code changes must meet the guidelines in CONTRIBUTING.md.
  • License: I confirm that my contribution is made under the terms of the Apache 2.0 license.

@aws-ajangg aws-ajangg requested a review from a team as a code owner February 18, 2026 22:17
@github-actions
Copy link

  • This pull request modifies code in src/* but no tests were added/updated.
    • Confirm whether tests should be added or ensure the PR description explains why tests are not required.
  • This pull request implements a feat or fix, so it must include a changelog entry (unless the fix is for an unreleased feature). Review the changelog guidelines.
    • Note: beta or "experiment" features that have active users should announce fixes in the changelog.
    • If this is not a feature or fix, use an appropriate type from the title guidelines. For example, telemetry-only changes should use the telemetry type.

return false
}

const api = await jupyterExt.activate()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can we rename api variable to something like jupyterExtApi or something to improve readability

try {
const jupyterExt = vscode.extensions.getExtension('ms-toolsai.jupyter')
if (!jupyterExt) {
// Jupyter extension not installed, fall back to executionSummary check
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is executionSummary check ?

Copy link
Contributor Author

@aws-ajangg aws-ajangg Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment wasn't updated from an earlier impl of the fix. it's been addressed to update the current impl

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to throw some kind of err/debug/logging info when we are not able to install the extension. Customer might not be sure what they need to do to allow extension installation specially if there is no internet access allowed in customer env.

@msgupta-amazon
Copy link
Contributor

nit: To add a comment line instead of returning false when we don't find jupyterExt installed.

else Looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants