Repository navigation
fix(ssh): wait for terminal WebSocket readiness before connecting - #1
Merged
LukeGus merged 1 commit intoOct 5, 2026
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
termix ssh <hostId>can time out with:This can occur even when:
termix execworks against the same host;In the reproduced failure, the server logged the terminal WebSocket connection being established but did not proceed to host resolution or SSH connection before the CLI timed out.
Cause
TerminalSocket.open()resolves when the WebSocket transport reaches the open state.termix sshthen immediately sendsconnectToHost.The Termix server performs asynchronous authentication and data-key initialization before its terminal application message handler is ready. On sufficiently fast connections, the initial
connectToHostframe can arrive before the server is ready to process terminal messages.Fix
Add
TerminalSocket.waitUntilReady()and call it from the interactive SSH path after opening the WebSocket but before sendingconnectToHost.The readiness check uses the terminal protocol's existing
ping/pongmessages.The implementation reuses the existing:
requestTimeoutMswaitFor()send()TerminalSocket.open()retains its existing transport-only semantics.Tests
Added regression coverage for:
Full project verification passes:
Formatting, ESLint, TypeScript type checking, unit tests, and package smoke tests all pass.
Integration verification
Reproduced against Termix Server 2.8.0.
Before the change:
The same host worked through both the Termix web terminal and
termix exec.After the change, a locally built standalone CLI successfully opened the interactive SSH session:
This keeps readiness handling scoped to the interactive terminal path without changing the semantics of
TerminalSocket.open().