Files
orca/src
Neil eccbd17bf0 fix(remote): send again a tab close the paired host never received (#29468)
* fix(remote): send again a tab close the paired host never received

Closing a paired host's tab prunes the local mirror at once and asks the host
to close it. When the connection dropped mid-close the renderer cleared its
close intent, so the host's next snapshot after reconnect brought the tab
back. A user close that fails without reaching the host is now held: the tab
stays hidden, and the close is sent again when a snapshot proves the host is
reachable and still lists it, up to three times before the tab is shown.

* fix(remote): replay held closes at snapshot receipt, pinned to their pairing

Codex review: an unchanged reconnect snapshot is filtered before apply, so the
replay now fires when any snapshot is received; a replay is refused once the
environment is re-paired; replays survive a subscription reinstall and
re-assert their hide; giving up re-accepts the current snapshot so the tab
actually returns.

* fix(remote): consume held closes only on authoritative snapshots, and unhide evicted ones

Codex review: an unpublished or retired-epoch frame could drop a pending
replay, and an evicted replay kept its tab hidden with nothing left to send.

* fix(remote): keep held closes through incomplete inventories, and re-hide in-flight ones

Codex review: a real-epoch snapshot can omit tabs it is unsure of, so absence
no longer drops a held close; and a snapshot listing a tab whose close is in
flight re-asserts its hide after a subscription reinstall.

* fix(remote): re-list the worktree after a failed close replay

Codex review: subscriptions are change-driven, so an idle worktree might never
publish the snapshot that makes the next attempt due.

* fix(remote): re-list the worktree as soon as a close is held

Codex review: an idle host may publish nothing after a held close, so the first
replay also needs a scheduled re-list.
2026-10-15 23:28:37 -07:00
..