Skip to content

Fix interactive SSH sessions - #45

Merged
joehoyle merged 2 commits into
mainfrom
agent/fix-ssh-session-input
Sep 11, 2026
Merged

Fix interactive SSH sessions#45
joehoyle merged 2 commits into
mainfrom
agent/fix-ssh-session-input

Conversation

@joehoyle

@joehoyle joehoyle commented Jul 21, 2026

Copy link
Copy Markdown
Member

Summary

  • resume stdin and enable raw terminal input once an SSM session connects
  • ping the active SSM session directly instead of reading this.awsSSMSession
  • clean up terminal listeners, timers, and raw mode when a session disconnects
  • add focused regression tests for input forwarding, the ~. escape, and keepalive pings
  • run tests in GitHub Actions on Node.js 20, 22, and 24

Why

After the CLI's ESM conversion, the keepalive callback attempted to read this.awsSSMSession while this was undefined. This crashed connected SSH sessions when the 30-second timer fired.

Inquirer can also leave stdin paused after prompting, so attaching a data listener alone did not reliably make an established session interactive.

User impact

Users can type immediately after connecting, sessions no longer crash on the first keepalive interval, and terminal state is restored during cleanup.

Validation

  • node --test test/ssh.test.js — 3 tests passing locally
  • GitHub Actions — Node.js 20, 22, and 24 passing
  • workflow YAML parse check
  • git diff --check

@joehoyle
joehoyle requested a review from jerico July 21, 2026 22:28
@joehoyle
joehoyle marked this pull request as ready for review July 21, 2026 22:28
@owaincuvelier

Copy link
Copy Markdown

@mikelittle we need this merged and reviewed to fix a bug in the Altis CLI which causes a SSH session via to refuse inputs and eventually hangup!

@mikelittle mikelittle left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good. The changes make sense and I can see the tests run.

@joehoyle
joehoyle merged commit 0cdb40d into main Sep 11, 2026
3 checks passed
@joehoyle
joehoyle deleted the agent/fix-ssh-session-input branch September 11, 2026 16:10
@joehoyle

Copy link
Copy Markdown
Member Author

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