Skip to content

Paired viewer retains unclosable null-PTY terminal ghosts after host topology advances #11800

Closed

Description

@revofusion

Version

Orca 1.4.162

Setup

A paired viewer connects through an Orca relay to an Azure buildbox runtime.

Symptoms

The viewer showed nine terminal tabs while the host's authoritative runtime inventory contained seven connected, writable PTYs. The two extra viewer records were blank and could not be closed from the UI.

The extra records had no PTY or incarnation (ptyId: null, incarnationId: null), were disconnected, and belonged to an old client topology revision. The host had already advanced several revisions and no longer published either tab.

Root cause

Two renderer paths combine to make these ghosts persistent:

  1. shouldReplaceTerminalTab deliberately retains local null-PTY tabs unless an exact structured-create handoff identifies them. There is no age bound, so a restored placeholder omitted by every later authoritative host snapshot survives indefinitely.
  2. closeTerminalTab resolves the worktree catalog route before consulting the terminal's environment-scoped remote:<environment>@@<handle> PTY identity. During catalog hydration gaps it cancels an otherwise routable host close, which makes affected remote tabs appear unclosable.

In the observed state, locally pruning the two stale records did not kill any Azure PTY (ptyKilled: false), and the Azure inventory remained at seven live terminals.

Expected behavior

  • Give newly created null-PTY placeholders a bounded grace period, then prune them when an authoritative host snapshot still omits them.
  • Route explicit closes from unambiguous environment-scoped PTY evidence when the worktree catalog is temporarily absent.
  • Keep genuinely in-flight structured creates during the grace period, and use PTY evidence only when it identifies exactly one owner.

Related: #9585 tracks dead remote terminal tabs accumulating after runtime restarts. #11495 tracks paired-viewer attachment loss for host PTYs that remain live.

Activity

  1. self-assigned this
    on Aug 3, 2026
  2. LesleyMurfin commented on Sep 17, 2026

    @LesleyMurfin
    Contributor

    Cross-referencing: PR #21277 adds idempotent selector_not_found handling on host close RPCs and expands the client lifecycle recovery for absent worktrees/selectors. This allows unclosable ghost tabs associated with missing worktree catalogs or dropped selectors to be dismissed cleanly on the client without triggering an unhandled rejection or immediate resurrection.

  3. OrcaWin commented on Oct 10, 2026

    @OrcaWin
    Collaborator

    Status: #27132 fixes the routing part. A close now routes by the host the tab's own PTY id names and is never a silent no-op. Still open: retiring the null-PTY ghost rows the host closed (this needs the host to publish its close records to clients).

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

Metadata

Metadata

Assignees

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