Skip to content

[Bug]: Paired viewer loses remote terminal attachments across update/restart while host PTYs remain alive (v1.4.161) #11495

Closed

Description

@asiaenv8053

Operating system

Windows

Orca version

v1.4.161 on the Viewer PC and the Host PC

Details

Short summary

A Windows Orca Desktop client paired to a second Windows PC hosting an Orca Remote Runtime. The host had a large live session graph (51 terminals and 32 layouts).

After pairing, the Viewer repeatedly showed:

Reconnecting to remote runtime
Orca will retry for up to one minute. This terminal will resume if the connection returns.

Existing terminal output remained visible in some tabs, but input was rejected. Some newly opened agent tabs appeared briefly and then closed automatically. An automatic Orca update/relaunch and a later manual full quit/relaunch both caused large reductions in the Viewer's restored live panes and terminal attachments.

At the same time, the Host Runtime remained ready/reachable and reported all 51 terminals as connected and writable, with no host-side orphaned terminals. The Tailscale path and one-shot Runtime RPCs were also healthy when the failure was inspected.

This looks like a Viewer-side Remote Runtime stream/session-mirror restoration failure rather than loss of the authoritative host PTYs.

Topology

Windows Viewer PC (Orca Desktop)
  -> shared-control + terminal multiplex WebSockets
  -> private Tailscale direct path
  -> Windows Host PC (Orca Remote Runtime)
  -> host terminal inventory / PTYs / agent processes

Both machines were running Orca 1.4.161 when the final diagnostics were collected. Hostnames, addresses, usernames, repository names, pairing identifiers, Runtime IDs, and terminal contents are intentionally omitted.

User-visible impact

  • Most active agent workflows in the Viewer became unavailable at once.
  • Some tabs retained their last rendered output but would not accept input.
  • New agent tabs could load their initial UI and then disappear.
  • Repeated reconnect attempts did not restore the affected tabs.
  • Fully quitting and reopening Orca did not recover the session graph and instead reduced the number of valid Viewer attachments further.
  • The Host PTYs and agent processes remained alive, leaving work running without a usable Viewer attachment.

Observed sequence

This is an incident sequence rather than a confirmed minimal reproduction:

  1. The Viewer already had multiple active agent sessions.
  2. The Viewer paired with a Windows Orca Remote host over Tailscale.
  3. The host's large remote session graph was imported into the Viewer.
  4. Remote tabs began entering the reconnecting state. Some tabs became read-only, and some newly opened tabs closed shortly after appearing.
  5. Approximately 55 minutes after pairing, Orca installed an automatic update and relaunched.
  6. The Viewer's live pane manager dropped from approximately 32 panes to 2 after that relaunch.
  7. Some tabs were reopened manually, but the remote sessions remained unstable.
  8. A full manual quit and relaunch was attempted as a recovery action.
  9. Immediately after the manual relaunch, the Viewer's live pane manager dropped from approximately 18 panes to 1.
  10. The remote pairing was removed only after read-only diagnostics were collected, to prevent further session loss.

The instability was visible before the automatic update. The update and manual relaunch were the two boundaries where the largest measurable restoration collapse occurred.

Actual behavior

  • A recoverable Remote Runtime stream failure can leave a pane in recovering, backoff, or disconnected.
  • The existing xterm buffer remains visible, but terminal input is blocked.
  • Some remote-terminal mirrors are retired when the Viewer cannot rebind their previous handles to a replacement in the authoritative host snapshot.
  • Relaunch restores substantially fewer valid panes/attachments even though the Host still reports the corresponding terminals as alive.
  • Repeating the relaunch does not converge toward the authoritative host session graph.

Expected behavior

  • A Viewer restart or update must preserve stable tab identity and rebind each visible remote terminal to the current authoritative host handle.
  • A live Host PTY must not be treated as dead solely because a Viewer stream, snapshot, or handle is temporarily stale.
  • Shared-control replay and per-terminal multiplex resubscription should eventually converge on the same host snapshot.
  • During recovery, a tab may be visibly read-only, but it should remain present until the Host authoritatively reports that its PTY/session is gone.
  • Fully quitting and reopening the Viewer should restore the same logical remote tabs and must not reduce valid attachments on every restart.

Diagnostic evidence

Host state

The following read-only snapshot was collected before the pairing was removed:

Check Result
Host Runtime ready / reachable
Terminal inventory 51
connected=true 51 / 51
writable=true 51 / 51
Host-side orphaned terminals 0
Missing terminal incarnation 0
Published layouts 32
Layout-referenced terminal handles 45
Layout handles missing from inventory 0
Live inventory entries outside a layout 6

This does not match a mass host PTY exit. The Host's terminal inventory and published layout references were internally consistent.

Viewer state before and after the manual restart

Viewer metric Before restart After restart
Total local terminal records 6 4
Normal attachments 3 1
Orphaned records 3 3
Live terminals for one affected worktree 2 0
Live pane manager 18 1

The three orphaned Viewer records had incarnationId=null, but were still reported as both connected=true and writable=true. That state appears contradictory: there was no identified terminal incarnation to receive input, yet the inventory described the record as usable.

Persisted tab and handle state

A comparison between the pre-update state backup and the final pre-unpair state found:

Metric Pre-update Final pre-unpair
Worktrees 28 32
Tabs 38 46
Layouts 38 46
Remote PTY IDs 39 46
Sleeping agent sessions 9 8

There were 37 tab IDs common to both snapshots. Ten of those stable tab IDs had a different PTY handle after relaunch, and all ten were tabs imported during the original pairing window.

The persisted tab-to-layout references were structurally valid; this did not look like malformed JSON. The failure appears to be in rebinding stable tab identity to new Runtime-scoped handles and replaying subscriptions at bootstrap.

Network and resource controls

  • The Tailscale peer was online and active.
  • The connection used a direct path rather than a relay.
  • Ten diagnostic pings succeeded with approximately 1 ms latency.
  • TCP connections to the Remote Runtime remained established.
  • One-shot Orca status and terminal-inventory RPCs succeeded while the UI terminal streams were failing.
  • Neither machine showed CPU saturation or an out-of-memory condition.
  • No corresponding Windows application crash or Orca crash dump was found.

This cannot prove that the network never experienced a transient interruption, but a continuing physical-network outage does not explain the observed steady-state failure or the repeatable loss of Viewer attachments at relaunch.

Why one-shot RPC success does not clear the application layer

The working CLI diagnostics were short-lived RPCs. The affected terminal UI depends on longer-lived state:

  • the shared-control WebSocket;
  • the terminal multiplex stream;
  • subscription replay;
  • the authoritative host session snapshot;
  • the Viewer's persisted session mirror;
  • Runtime-scoped terminal-handle replacement.

The incident had successful RPCs and live Host PTYs at the same time that the Viewer remained in terminal recovery and could not deliver input. That points to long-lived stream/subscription/session-mirror coordination rather than basic reachability.

Limits of the current evidence

The available trace did not include Remote WebSocket close codes/reasons, subscription replay results, old-to-new handle mappings, mirror-retirement reasons, or host snapshot revisions. The incident data therefore establishes the difference between the live Host state and the failed Viewer state, but does not establish the first failing callback, transport event, or exact root cause.

Relationship to existing issues

Privacy and additional data

Raw logs, profile backups, screenshots, addresses, pairing material, project paths, account information, and terminal contents are omitted because they contain private environment data. A more detailed timestamped inventory and the redacted state-diff methodology can be provided privately if maintainers specify the preferred diagnostic channel.

Activity

  1. nwparker commented on Oct 26, 2026

    @nwparker
    Contributor

    @asiaenv8053 thanks for the measurements. #17948 and #17981 (v1.4.197) stop unlabelled or replayed host inventories, and a live-PTY removal, from dropping a paired viewer's tabs. We think those cover most of what you saw.

    Could you retest an update or full restart of the Viewer on v1.4.241, with both PCs on that version? If panes still drop, the restored pane count before and after, plus the Viewer's main.trace.ndjson lines around the restart (macOS ~/Library/Application Support/Orca/logs/, Linux ~/.config/Orca/logs/, Windows %APPDATA%\Orca\logs\), would help a lot. We'll close this in two weeks if we don't hear back.

  2. asiaenv8053 commented on Nov 5, 2026

    @asiaenv8053
    Author

    Retested on v1.4.249.
    The Viewer is on Windows and both hosts are on Windows, at 1.4.246 and 1.4.247.
    I compared the Viewer's persisted session state before and after the restart.
    I can't reproduce the drop anymore.

    Thanks for the fixes and it's fine to close. 😊

  3. nwparker commented on Nov 5, 2026

    @nwparker
    Contributor

    Thanks for retesting and comparing the persisted state, @asiaenv8053. That's really helpful. Glad the viewer keeps its terminals across a restart now. Closing this. If panes drop again, reply here with the trace lines and we'll reopen.

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions