Skip to content

[Bug]: Slept remote workspaces reappear when pending terminal bindings are counted as live #25074

Description

@mmarabel

Operating system

macOS client connected to a Linux runtime host.

Orca version

1.4.219. Also inspected upstream main 752871bd678935e07a36e84b64a7a1ce944377e4.

Details

A remote workspace can reappear under Hide sleeping after Sleep even though its terminal has not restarted.

Observed behavior

  1. Enable Hide sleeping and sleep a remote workspace with a terminal tab.
  2. The workspace disappears.
  3. Continue switching between other workspaces without activating the slept one.
  4. The slept workspace returns to the sidebar.

In a local recording, Sleep is clicked around 00:04.5, the row disappears by 00:05, and returns by 00:22. The execution host's daemon log contains no corresponding terminal recreation; a subsequent host terminal inventory is empty for this workspace. The recording-time renderer snapshot was not captured, so the exact update responsible for that occurrence remains inferred.

Expected: saved wake identifiers do not count as running terminals, and an intentionally slept workspace stays hidden until it is woken or has other genuine activity.

Reproduced mechanism

A focused diagnostic using the production snapshot reducer reproduces the false activity transition without spawning any process:

  • Start with explicit sleep intent, an empty ptyIdsByTabId entry, and the preserved terminalLayoutsByTabId.ptyIdsByLeafId binding that Sleep retains for waking.
  • Apply a host terminal snapshot with status: 'pending-handle' and terminal: null.
  • The old binding returns to ptyIdsByTabId; isInactiveWorkspace changes from true to false.

Code path:

  • src/renderer/src/store/terminals/terminal-shutdown-state.ts:54-61 clears live IDs while keepIdentifiers preserves layout bindings.
  • src/renderer/src/runtime/web-session-tabs-sync/terminal-build.ts:23-51 retains those bindings for pending host surfaces, then line 104 counts all layout bindings as live PTY IDs.
  • src/renderer/src/runtime/web-session-tabs-sync/apply-terminal-records.ts:29-48 publishes those IDs to the live map.
  • The sidebar's activity predicate consequently treats the workspace as awake.

The pending-binding retention function is also present in the installed 1.4.219 renderer bundle. Its history predates the September sleep fix, so this is not yet established as a newly introduced regression.

Related, but different

#10205 / #20075 addressed unintended PTY respawns. #24399 and its open fixes #24410 / #24416 address automatic host recovery restarting slept terminals. This reproduction instead restores client-side live bookkeeping without a terminal spawn.

Suggested fix

Keep the binding needed for wake/reconnect, but do not republish a deliberately slept binding as live activity. Preserve ordinary reconnect handling and explicit wake behavior. Add a regression covering Sleep followed by a pending host snapshot.

The recording is available locally; public visual evidence can follow.

Activity

  1. self-assigned this
    on Oct 4, 2026
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