Repository navigation
fix(transport): handle terminal_not_found in attach() to unblock connecting state (#21344) - #21350
Draft
LesleyMurfin wants to merge 2 commits into
Draft
LesleyMurfin wants to merge 2 commits into
LesleyMurfin wants to merge 2 commits into
Conversation
This branch has not been deployed
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.
ELI5
When reconnecting or re-attaching to a remote terminal session that has terminated or been reaped by the remote host daemon, the server returns
terminal_not_found. Previously, the client's attachment logic surfaced an error message but never cleared its internalconnecting = trueflag. This left the UI in a permanent connecting state with an infinite loading spinner. This fix ensures that whenterminal_not_foundoccurs duringattach(),connectingis reset tofalse, the terminal is marked as ended, and recovery state is emitted so the UI unblocks and transitions cleanly.What Changed
remote-runtime-pty-transport.ts:attach(), whenresolvePersistedHostPane()returnsnull(due toterminal_not_found), setconnecting = false,terminalEnded = true, and callemitRecoveryState()prior to surfacing the error.terminal_not_foundtoisRemoteTerminalGoneMessage()to ensure that asynchronous terminal absence tokens are treated as definitive lifecycle exits.remote-runtime-pty-transport-expired-pane-recovery.test.ts: Added a regression test verifying that encounteringterminal_not_foundduringattach()immediately unblocks the connecting state and transitions the transport recovery phase to'ended'.Why
Without resetting
connectingand transitioning toended,getRecoveryState().phasepermanently resolves to'connecting'. As a result, the terminal surface is stuck behind an infinite loading spinner, retry buttons and manual recovery paths are disabled, and listeners are left dangling.Linked Issue
Architectural Context (RFC #21556)
terminal_not_found. The client transport was swallowing this error and leavingconnecting: truelatched permanently.Fixes #21344
Relates to #20922, #20923
Visual Proof
N/A - Transport state machine unblocking and lifecycle transition fix.
Testing
Ran
vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/remote-runtime-pty-transport-expired-pane-recovery.test.ts:AI Disclosure
Claude 3.5 Sonnet / Antigravity via Revive Labs development harness.
Checklist
N/Awith reason