orca icon indicating copy to clipboard operation
orca copied to clipboard

Headless `serve` never installs the `orca` CLI → in-app Claude Team launch fails with `command not found: orca`

Open daniel-rudaev opened this issue 5 months ago • 2 comments

Summary

In headless serve mode, Orca never installs the orca CLI command, so the in‑app Start new agent → Claude Team flow fails with command not found: orca and no agent can be started from a headless/mobile‑driven server.

Environment

  • Orca v1.4.77, Linux (Ubuntu), running headless: orca-ide …/out/cli/index.js serve --pairing-address <host-ip> --mobile-pairing, driven from the mobile companion.
  • Root cause is still present in current main (v1.4.80‑rc.3) by code inspection.

Repro

  1. Run Orca headless with serve --mobile-pairing.
  2. From the mobile/connected client: Start new agent → Claude Team.
  3. Orca opens a managed terminal and runs:
    orca claude-teams '--dangerously-skip-permissions'
    
  4. Result: zsh: command not found: orca.

Root cause

The orca command is installed by CliInstaller (src/main/cli/cli-installer.ts) as a symlink at ~/.local/bin/orca (Linux) / /usr/local/bin/orca (macOS) → the launcher. But CliInstaller.install() is only invoked from renderer/desktop flows — onboarding (src/renderer/.../onboarding/onboarding-feature-setup.ts), the Settings "Install CLI" action, and feature tips — via the cli:install IPC (src/main/ipc/cli.ts).

In headless serve mode there is no renderer, so the installer never runs and ~/.local/bin/orca is never created. src/main/index.ts already computes isServeMode but does not run the installer in that branch.

Two consequences in serve mode:

  1. ~/.local/bin/orca doesn't exist → command not found.
  2. The only orca present is the SSH‑bridge relay shim (~/.orca-relay/bin/orca), which (a) isn't on the managed‑terminal PATH and (b) has no CLI fulfiller without a connected desktop client — invoked by full path it handshakes then times out (Request "orca.cli" timed out after 30000ms). Separately, the shim‑on‑PATH injection in src/main/providers/local-pty-provider.ts is gated on ORCA_AGENT_TEAMS_TEAM_ID, which a fresh terminal doesn't have (chicken‑and‑egg with claude-teams).

The claude-teams handler itself is fine — it only needs orca on PATH and ORCA_PANE_KEY set. Confirmed the direct runtime CLI works against the live serve runtime (inside an Orca terminal, with ORCA_PANE_KEY present):

ELECTRON_RUN_AS_NODE=1 <app>/orca-ide <app>/resources/app.asar.unpacked/out/cli/index.js claude-teams --help
# → prints Claude Code help

Suggested fix

In the serve startup path (src/main/index.ts, gated on isServeMode, after app.whenReady()), run the existing idempotent new CliInstaller().install() so a headless box auto‑installs the orca command — the same artifact desktop onboarding creates. Happy to open a PR.

Workaround

For anyone hitting this now, create ~/.local/bin/orca (on the Orca terminal PATH) calling the direct runtime CLI:

#!/usr/bin/env sh
exec env ELECTRON_RUN_AS_NODE=1 <app>/orca-ide <app>/resources/app.asar.unpacked/out/cli/index.js "$@"

daniel-rudaev avatar Jun 19 '26 04:06 daniel-rudaev

Correction to the root-cause above (Linux specifics):

On Linux, CliInstaller installs the command as orca-ide (LINUX_COMMAND_NAME), not bare orca — deliberately renamed to avoid shadowing GNOME Orca's /usr/bin/orca. (It even removes a managed bare-orca symlink via removeLegacyLinuxCommandIfManaged.)

So simply running CliInstaller().install() in serve fixes macOS (where it installs a bare orca) but not Linux: the Claude Team launcher is the literal string orca claude-teams, hardcoded client-side in both the desktop renderer (agent-catalog.tsx) and the mobile app (mobile/src/tasks/mobile-tui-agents.ts), so the installed orca-ide never satisfies bare orca.

The Linux fix also needs a bare-orca dispatcher dropped into ~/.local/bin (which is hardcoded onto the managed-terminal PATH ahead of /usr/bin by patchPackagedProcessPath). Verified live on a headless Linux serve box (1.4.77): such a dispatcher restores the in-app Claude Team launch. See PR #5766 (updated to cover both platforms).

daniel-rudaev avatar Jun 19 '26 06:06 daniel-rudaev

The code fix for this landed in #7267 (merged, 5124b0d0ad) — a takeover of @daniel-rudaev's #5766. Headless serve now installs the orca CLI on startup (macOS + Linux) and drops a bare-orca dispatcher on Linux, so the in-app Claude Team launch resolves orca claude-teams instead of failing with command not found.

nwparker avatar Jul 03 '26 21:07 nwparker