Skip to content

Remote terminal multiplexer socket is dropped on last-stream close, so every cold-park reveal pays a fresh WebSocket + E2EE handshake #19871

Closed

Description

@nwparker

Summary

When the last remote terminal stream for a paired-runtime environment closes, closeIfIdle() in src/renderer/src/runtime/remote-runtime-terminal-multiplexer-base.ts:201 tears down the environment's entire terminal.multiplex WebSocket subscription, not just the stream. Because tabs cold-park at 30s and terminal.multiplex is explicitly excluded from shared-control routing (shouldRouteSubscriptionBySupport in src/main/ipc/runtime-environment-support-routing.ts returns false for terminal.multiplex), re-entering any parked tab for that environment always pays a fresh WebSocket connect plus a full E2EE handshake before the pane can attach.

Impact

Routine tab switching against a remote Orca server is slower than it needs to be: park every pane for an environment (or let them cold-park), then reveal one, and the multiplexer must be re-established from scratch. This is a latency/UX cost on the exact "switch tabs on a remote host" flow, and it compounds with the reconnect-churn work (#19647).

Evidence

Measured in the tab-switch e2e rig (tests/e2e/paired-remote-terminal-tab-switch-reconnect.spec.ts): after parking all panes and closing the last stream, the census shows transportUnsubscribeCount incrementing — the multiplexer socket is released — and the next reveal pays a fresh transportSubscribeCount.

Suggested direction

Consider keeping the terminal.multiplex transport warm for a bounded idle window (or routing it through shared control) so a cold-park → reveal cycle re-attaches without a new socket + E2EE handshake. Not fixed here — filing separately from the #19647 writer fix.

Activity

  1. nwparker commented on Sep 10, 2026

    @nwparker
    ContributorAuthor

    Closing — this was filed by an automated review pass that should not have opened GitHub issues. The finding is real and is retained in our internal report; it is not lost by closing here.

    No action needed from anyone. Reopen if you want it tracked publicly.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions