Skip to content

[Bug]: Remote tab mirror rejects its live renderer publisher after a headless epoch, hiding new tabs and retaining closed tabs #21928

Closed

Description

@MrBlackBrain

Operating system

Client: macOS 27.0, build 26A428, Apple silicon. Paired host: Arch Linux / Omarchy, desktop Orca.

Orca version

1.4.206 on both client and host. Source references below use the v1.4.206 release.

Details

The paired client's remote terminal tabs stop reflecting the host. New Terminal and Cmd+T start working shells on the host, but the client shows no new tabs. Later, several tabs appear together. The reverse also happens: closing the host terminals leaves their tabs visible on the client.

I reproduced this through the Mac UI and inspected the running renderer. The immediate cause is confirmed: the client has retired the publication epoch that the host is currently using. Fresh, authoritative snapshots from that publisher are rejected.

Reproduction observed on September 21, 2026

The client was already in the affected state. I have not isolated a deterministic cold-start sequence that first creates the poisoned epoch history.

  1. Select an existing paired-host Git workspace. The sidebar labels it Sleeping and the tab area is blank.
  2. Select New tab > New Terminal. No terminal tab appears.
  3. Press Cmd+T. Still no terminal tabs appear.
  4. Read the same workspace with orca terminal list --environment <saved-environment> --worktree <workspace-selector> --include-visual-layouts --json. Both new terminals exist, are connected and writable, have tab/leaf IDs, and already show shell prompts.
  5. Switch to another workspace and back. An early switch does not repair it. After further navigation, both terminals and an existing agent tab appear together.
  6. Close only the two test terminals by their runtime handles. Both close results report ptyKilled: true. The host inventory retains only the pre-existing agent, but the client still displays three tabs.

The local Mac checkout of the same repository passed menu and keyboard terminal-creation tests in this run. The confirmed reproduction is the paired-host path.

Live debugger evidence

Before any recovery or mutation of the tracking maps, I read the affected workspace through the renderer's own runtimeEnvironments.call, using session.tabs.list. This succeeds through the same connection used by the UI.

The values below replace publisher identifiers with R, H, and H0. Versions and counts are unchanged.

Observation Value
Current host response epoch renderer:R:client-navigation, version 187, 1 tab
Renderer tabsByWorktree 3 tabs
latestSessionTabsSnapshotByWorktree epoch headless:H:client-navigation, version 181
latestReceivedSessionTabsSnapshotByWorktree same headless epoch/version, received frame 566
sessionTabsPublicationEpochHistoryByWorktree.current headless:H:client-navigation
Retired publication epochs renderer:R:client-navigation, headless-hydrated:H0:client-navigation
isRetiredSessionTabsPublicationEpoch(key, currentHostEpoch) true
decideWebSessionTabsSnapshot(currentHostSnapshot, environmentId, runtimeId) { apply: false, settlesHostMirror: true }

workspaceSessionReady was true. The renderer knew the same runtime ID returned by the host. Both runtimes were ready/reachable. This is not a shell-start failure or merely a failed network request.

Faulty path and proposed fix

The release already handles the analogous problem for local structured sessions in applyLocalStructuredSessionTabSnapshots, with returning-publisher tests, introduced in #18906. That repair requests an authoritative inventory and revives only the epoch it confirms.

Please add equivalent bounded, host-scoped repair to the remote terminal mirror. Do not simply accept every retired epoch: delayed frames from a genuinely superseded publisher must remain fenced. A regression test should cover renderer R, temporary headless H, then current renderer R again. Verify that new tabs and tab removals both reach the client after authoritative confirmation, and that delayed H frames remain rejected.

The exact host operation that introduced the temporary headless epoch in this session remains unconfirmed. The client-side rejection and poisoned history were directly inspected, not inferred from the screen recording.

Recovery verified

View > Force Reload on the Mac client cleared the poisoned in-memory state. It immediately removed the two stale tabs. I then created two remote terminals through the menu and keyboard shortcut. Both appeared without workspace switching. Closing both test terminals removed both tabs from the UI. The existing agent session remained running. No host restart or configuration change was needed.

This is a session recovery, not a permanent fix. The installed application and source checkout were not patched.

Related reports

This report adds a concrete live rejection reason for the observed missing/ghost-tab behavior. Browser Invalid guestInstanceId errors also occurred when closing a test browser tab, but terminal creation failed before that browser action. They are not required for this reproduction.

Activity

  1. shahidbeig-a11y commented on Sep 21, 2026

    @shahidbeig-a11y
    Contributor

    Working on a fix that mirrors the local structured-session retired-epoch repair (#18906) into the remote/web session tabs sync path, with a regression test for renderer → temporary headless → returning renderer.

  2. GollyJer commented on Sep 21, 2026

    @GollyJer

    Cool, just came to report the same thing. Subscribed. 👍

  3. rorar commented on Sep 22, 2026

    @rorar

    Another instance of this, with a deterministic trigger — which the report above notes is still missing — plus a workaround.

    Setup. Client: Orca 1.4.205 on Linux (Wayland/GNOME). Paired host: a Linux machine running its own desktop Orca, which owns the sessions; the client only mirrors their tabs. Same web-session-tabs-sync module as in the original report.

    Trigger. View → Force Reload on the client. Reproduced on demand, several times in a row.

    Symptom variant. Rather than tabs appearing late or lingering after close, an existing agent tab stays visible but its pane is dead:

    • the pane is completely empty — no scrollback, no last frame, just the cursor at home
    • the cursor still renders and switches to its focused style on click, so xterm itself is healthy
    • typing produces no echo
    • the agent session on the host is untouched and keeps running (verified in the host's process list: 8.5 days of uptime, still attached to its PTY)

    What it is not.

    Check Result
    runtimeEnvironments.getStatusSnapshots() verification: 'verified', transport: 'ready'
    pty.listSessions() on the client only the local floating terminals — the mirrored PTY is not local, as expected
    Close/reopen a tab to force a pane remount does not heal it

    That last one is worth stating: the renderer's pane-recovery machinery is built on the premise that a remount reattaches over the live PTY and drains the buffer. For an orphaned mirror there is nothing local to reattach to, so the premise does not hold.

    No diagnostics at all. With the renderer console open and "Preserve log" on across the reload, none of these appear: [terminal-lifecycle], recovering pane tab, left the pane unbound, restored PTY reattach threw. All four strings are present in the shipped 1.4.205 bundle, so their absence is real, not a stripped build. Nothing notices the state — which matches this issue's finding that the snapshot is rejected rather than failing.

    Workaround. In the renderer console (focus a terminal pane before opening DevTools, otherwise the embedded browser's console opens instead):

    await window.api.runtimeEnvironments.disconnect({ selector: '<envId>' })
    await window.api.runtimeEnvironments.connect({ selector: '<envId>' })

    then View → Reload — the plain one, not Force Reload. <envId> comes from runtimeEnvironments.list().

    Both halves are required. The reconnect alone leaves the pane empty, and a Reload alone does nothing (it had already been tried many times). Only the pair rebuilds the mirror. The host session is unaffected throughout.

    If the epoch history is what rejects the publisher, a reconnect plus a fresh renderer is presumably what clears it — which would fit the proposed fix direction in the original report.


    Written together with Claude Code (Opus 5).

  4. AmethystLiang commented on Sep 22, 2026

    @AmethystLiang
    Contributor

    thanks for reporting. looking into it

  5. johnmarktaylor91 commented on Sep 30, 2026

    @johnmarktaylor91

    Additional evidence, possibly a related path: a browser tab opened on the laptop client disappears seconds after it opens.

    Setup: headless-served hub (Linux AppImage, server mode) with a macOS client, Orca 1.4.217 on the Mac. A browser tab opened from a link to a local http page (served through an SSH tunnel on 127.0.0.1) vanished right after it opened, three times in two minutes. The Mac client's main.trace.ndjson has a matching renderer_error each time:

    Uncaught Error: Invalid guestInstanceId: 11
        at WebViewElement.disconnectedCallback (node:electron/js2c/isolated_bundle:2:7131)
        at V.releasePage (.../browser-client-page-renderer-installation-*.js:1:9879)
        at V.handleDestroyed (.../browser-client-page-renderer-installation-*.js:1:9434)
        at WebViewElement.u (.../browser-client-page-renderer-installation-*.js:1:7681)
        at WebViewImpl.dispatchEvent (node:electron/js2c/isolated_bundle:2:9438)
    

    The same error appears with guestInstanceId 8, 9, 11 and 12 (2026-09-30 19:23:44, 19:24:38, 19:24:56 and 19:26:18 UTC). The stack suggests the guest webContents is destroyed first; handleDestroyed then calls releasePage, and detaching the <webview> throws because the guest id is already gone. So the throw looks like a side effect, not the cause: something tears down the guest right after creation.

    Right after that, a tab created from the hub (orca tab create --worktree path:...) stays in the runtime's tab list but is never drawn on the Mac client. That matches this issue (new tabs hidden after a headless epoch) and #21052. Restarting the Mac client restores tab drawing.

    Two suggestions: guard releasePage against an already-destroyed guest so it does not throw during teardown, and log why the guest was destroyed (crash, navigation to a blocked origin, or the mirror dropping the tab), which would show whether the vanishing tab and the hidden-tab bug are one cause.

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