Skip to content

[Bug]: Sessions appear to being killed at random over the remote Orca link. #9952

Open

Description

@ionican

Operating system

macOS

Orca version

v1.4.150

Details

Sessions seem to be being killed apparently at random, even when focussed in the desktop app (using the Orca remote functionality into a dev box ) - sessions literally vanish whilst typing.

Retrieval is sometimes possible by using the Agent Session History tab (but sometimes not).

I'm unable to reproduce this reliably, but it's happening about once every 30 minutes.

Activity

  1. added theissue type on Jul 22, 2026
  2. added
    orca-remote-serverRemote Orca Server / orca serve / paired remote runtime
    and removed
    os:macosIssues affecting macOS
    on Jul 22, 2026
  3. AmethystLiang commented on Jul 22, 2026

    @AmethystLiang
    Contributor

    Related Remote Orca Server issues (session/terminal lifecycle)

    Related open PRs

  4. nwparker commented on Jul 27, 2026

    @nwparker
    Contributor

    Reproduction status: env_blocked (remote Orca server session kills)

    Intermittent remote session kills over remote Orca server require multi-machine remote runtime not available in this pass.

    Not labeling cannot_repro.

  5. free4416 commented on Aug 13, 2026

    @free4416

    Reproduction environment available — with host-side evidence

    Re: the env_blocked status — I have the multi-machine remote runtime setup this needs, and I hit this daily. Below is hard evidence from the host's daemon.log that should narrow the search considerably.

    Environment

    Orca 1.4.180 (both ends)
    Client macOS (MacBook)
    Host macOS (Mac mini), GUI app — not headless orca serve
    Link Reproduces on both SSH relay and Remote Orca Server (runtime ws)

    Signature: mass session-exited with code: 0, zero session-killed

    daemon.log contains 13 distinct clusters (3+ session-exited inside the same second) between 2026-08-07 and 2026-08-13. Most recent:

    2026-08-13T00:27:35Z   session-exited × 15
    

    Those 15 sessions span 5 unrelated workspaces (names redacted). Full event breakdown for the surrounding 60s window:

    session-exited:      15
    macos-tcc-pty-spawn:  1
    session-created:      1
    session-attached:     1
    session-killed:       0     <- none
    

    Cluster history (UTC, count):

    2026-08-07T00:20:08  11      2026-08-10T22:22:33  26
    2026-08-08T02:04:39  19      2026-08-11T02:12:44   4
    2026-08-08T12:37:22   8      2026-08-11T06:39:23   4
    2026-08-08T14:49:28   6      2026-08-12T09:41:09   7
    2026-08-08T23:21:40   7      2026-08-12T11:55:54   6
    2026-08-10T04:18:34   5      2026-08-13T00:27:35  15
    2026-08-10T10:18:19   3
    

    This separates the issue from #8459. That incident's signature was 28 session-killed events with immediate:true. Here there are zero session-killed — the shells exited cleanly on their own, and nothing in the daemon logged a decision to end them.

    From the UI side this matches the original report precisely: the tabs do not enter a "reconnecting" state, they are simply gone.

    Ruled out, with evidence

    Hypothesis Evidence Verdict
    App or daemon crash Orca main process and daemon process both had 1d 3h+ uptime spanning the 08-13 incident; PIDs unchanged. No crash reports. ruled out
    Daemon idle shutdown isIdle() returns false whenever listSessions().length > 0 (daemon-server.ts:530-542) ruled out
    macOS login-session death-watch Entire log holds only login-session-watch-armed x5 and login-session-watch-disabled x1. No login-session-probe-rejected, no retire event. It never fired. ruled out
    System sleep pmset -g log: Sleep/Wake count 0 since boot (2026-08-11) ruled out
    Transport / relay defect Reproduces identically on SSH relay and on Remote Orca Server ruled out
    #12327 heartbeat reaper Host runs 1.4.180, i.e. after that fix shipped ruled out

    The cause therefore sits outside the daemon's own lifecycle logic, outside the transport, and outside sleep.

    Hypothesis: all PTYs share one macOS login session

    PTYs on this host spawn wrapped, per daemon.log:

    {"event":"macos-tcc-pty-spawn","strategy":"wrapped"}
    
    /usr/bin/login -flpq <user> /bin/bash ... orca-tcc-login /bin/zsh
    

    Every PTY is thus a child of login(1) and bound to a macOS login/audit session. If that session is torn down, every PTY on the host exits simultaneously and cleanly with no daemon involvement — precisely the observed signature, and transport-independent by construction.

    It also explains something I can confirm from this host: purely local terminals die in the same event, not just remote ones.

    Stated plainly as a hypothesis — I have not yet captured a direct correlation between one teardown and a specific system event. Supporting evidence that this wrapper is fragile: #12971 (login(1) wrapper no longer isolates terminal children on macOS 26) and #13764 (wrapper leaks PTYs, session-closed never fires).

    One environmental note that may be the trigger: this host is driven over Screen Sharing, which reconnects frequently here — each connection spawns a fresh screensharingd. A GUI/audit session change is my prime suspect.

    Offer

    Since the blocker here is environment rather than analysis, I am glad to run instrumentation against the real setup — extra logging on the PTY teardown path, an ORCA_DISABLE_MACOS_LOGIN_SHELL=1 A/B, or whatever else would be most useful. Just say what to measure.

  6. euisan commented on Sep 27, 2026

    @euisan

    Repro (Orca 1.4.211, host = Linux/CachyOS KDE Wayland, client = macOS, paired over runtime websocket)

    1. On the Linux host, open a worktree and start Claude Code in a terminal tab. Then leave the host window on another worktree/tab (or minimized) for >30 s. terminalHiddenViewParking is at its default (on).
    2. From the macOS client, open that terminal tab and send a prompt.
    3. Each new turn (user prompt or orchestration-injected input) makes the client's terminal disconnect/reconnect. On the host, daemon.log logs session-attached for the same session (same pid, no exit). main.trace.ndjson logs persistence.pty-binding origin=reattach host=local misses=not_durable, ~0.3 s after the prompt timestamp.
      In one day: 79 attaches, 75 within ±5 s of a turn start. Worker tabs that nobody views remotely show none.
    4. The same hidden tab with no remote viewer does not reattach on input, OSC title changes, or Claude turns (checked with a scratch terminal).

    Suspected chain: a turn-start status/title publish makes the paired client remount or resubscribe the mirrored tab. Then session.tabs.activate runs, finds the host surface not ready (hidden tab cold-parked on the host renderer), and re-materializes it via createRuntimeOwnedMobileSessionTerminal → adoptStablePane → daemon createOrAttach. One concrete suspect: buildMirroredTerminalTabs doesn't carry generation, so any client-side generation bump is reverted by the next host snapshot and changes the pane key. Cold-park eligibility also doesn't consider an active remote viewer. The same setup with a macOS host never showed this, likely because the host tab was visible there.

    Workaround confirmed: keeping the terminal tab visible in the host window (so it is never cold-parked) stopped it completely — zero session-attached/reattach events across the following remote prompts, versus one per turn before. That points at hidden-view parking on the host combined with an active remote viewer. Setting terminalHiddenViewParking: false should be the durable workaround; it has no settings UI and the runtime settings.update RPC does not accept it, so it can only be changed in orca-data.json while Orca is not running.

    Happy to collect client-side remote_terminal_stream_* breadcrumbs if useful.

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingorca-remote-serverRemote Orca Server / orca serve / paired remote runtime

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions