orca icon indicating copy to clipboard operation
orca copied to clipboard

[Bug]: Sleep always fails for a folder workspace on a paired headless server (terminal.sleep returns selector_not_found)

Open TheGarz opened this issue 1 month ago • 1 comments

Operating system

macOS

Orca version

1.4.243 desktop (macOS arm64), paired to a 1.4.243 headless server (orca-ide serve from the Linux x64 .deb)

Details

Short summary

Sleeping a folder workspace whose terminals run on a paired headless server always fails with:

Failed to sleep workspace. The workspace was kept open. Try again; if the problem continues, check the host connection.

The connection is fine. The server can't resolve the folder: workspace id that the desktop sends, and the toast falls back to the generic "check the host connection" text.

Setup

  • A macOS desktop paired to a headless Linux server: orca-ide serve --port 6768 --pairing-address <tailnet address> --mobile-pairing, running as a systemd user unit.
  • A folder workspace with a terminal running on that server.

How to reproduce

  1. On the desktop, open a folder workspace whose terminals run on the paired server, and start a terminal in it.
  2. Choose Sleep on that workspace in the sidebar.
  3. The toast above appears and the terminal keeps running. Retrying gives the same result every time.

What seems to be happening

  • The desktop's sleep flow calls terminal.sleep on the environment with { worktree: "id:<worktreeId>" }. For a folder workspace, that is id:folder:<uuid>.
  • The server's resolveWorktreeSelector only matches repo workspaces (<repoId>::<path> and <repoId>::<path>::workspace:<uuid>), so it throws selector_not_found.
  • The sleep error mapper in the renderer (sleep-worktree-flow) only special-cases messages containing ambiguous_terminal_owner, legacy, terminal_, runtime, connection or Daemon. selector_not_found falls through to the generic message, which sends you looking at the network.

The same lookup from the CLI, without sleeping anything

$ orca terminal list --environment "<server>" --json
  ... "worktreeId": "folder:c30851cb-...", "connected": true      <- the server hosts this folder workspace's terminal

$ orca worktree show --environment "<server>" --worktree "id:folder:c30851cb-..." --json
{ "ok": false, "error": { "code": "selector_not_found", "message": "selector_not_found", ... } }

$ orca worktree show --environment "<server>" --worktree "id:<repoId>::/home/user/code/project::workspace:3a915962-..." --json
{ "ok": true, ... }

orca worktree list --environment "<server>" returns the 13 repo workspaces on that server and none of the folder workspaces, even though terminal list shows a folder workspace's terminal there. Closing that folder workspace's terminal tabs works.

Expected

A folder workspace hosted on a paired server sleeps the way a repo workspace does. If that isn't supported, the error should say so rather than pointing at the host connection.

Anything else

This isn't a version mismatch: the desktop and the server both run 1.4.243. Terminals that older server builds started (older daemon protocol versions) are still listed and connected after the update.

TheGarz avatar Oct 28 '26 20:10 TheGarz

This is fixed on main and shipped in v1.4.261: Sleep and stop now work on a folder workspace hosted on a paired server (#35082).

Please update to the latest Orca and try again. If you still see it, comment here and we'll reopen.

AmoabaKelvin avatar Nov 17 '26 22:11 AmoabaKelvin