Skip to content

fix(serve): explain what to run when an SSH host's orca cannot start or install a server - #28003

Merged
OrcaWin merged 2 commits into
mainfrom
np/d1e-orcad-host-service
Oct 12, 2026
Merged

OrcaWin merged 2 commits into
mainfrom
np/d1e-orcad-host-service

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​62 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​60
Prod 5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​96 $\color{#cf222e}{\Huge{\mathbf{−}}}$​60 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​36

ELI5

On a remote machine that Orca reaches over SSH, the only orca command is the one Orca's own SSH server drops into its terminals. That command can't start a server, so orca serve --supervise and orca serve service install can't work with it. Today they fail with messages that send people the wrong way ("Install it from Orca Settings", or "set ORCA_APP_EXECUTABLE"). This PR makes both say what is going on and what to run instead.

What Changed

  • Before:
    • orca serve (supervised or not) in an Orca terminal on such a host failed with "Could not determine how to start Orca server. Set ORCA_APP_EXECUTABLE to the Orca executable."
    • orca serve service install failed with "Could not find the orca command on PATH. Install it from Orca Settings, or pass --command". There are no Orca Settings on that host. Following the --command hint with the terminal's own launcher (~/.orca/cli/bin/orca) would write a unit that can't start a server and crash-loops until the brake gives up.
  • After:
    • orca serve says this orca isn't running from an installed Orca app and can't start a server of its own, and names what to run: install the Orca app on the machine and run orca-ide serve (orca serve on macOS) from a plain login shell, or set ORCA_APP_EXECUTABLE.
    • orca serve service install still uses an installed app's launcher when one is on PATH (orca-ide on Linux, orca on macOS), so a terminal of a local server keeps working. When none is found and this orca is a server-only one, the error says the same thing and names orca-ide serve service install (orca … on macOS). It tells the user to run that from a plain login shell, so the service uses the app's own profile rather than the SSH connection's.
    • --command now refuses a launcher tied to one Orca version (inside the profile, an orcad slot, or a mounted AppImage), the same rule that PATH discovery already applied.
    • The not-found message names the right command per platform (orca-ide on Linux).
    • The serve service install help notes say the Orca app must be installed on the machine.
  • How "can start a server" is decided: the CLI is running on the Orca app's executable (ELECTRON_RUN_AS_NODE=1, set by every packaged and dev launcher), or ORCA_APP_EXECUTABLE points at one. That is exactly the condition orca serve already needed to find an executable. Profile-state recovery had its own copy of the check, and it now uses the shared one.
  • Command discovery moved from serve-service.ts into serve-app-launcher.ts next to this check. The logic is the same, and the move keeps the handler under the line limit.

Why

The servers on these hosts are started by a desktop client over SSH and run from versioned slots under ~/.orca-remote. The orca in their terminals is a plain-Node script, rewritten for each server version, that runs that slot's CLI. It has no app executable, and the slot doesn't ship the app's runtime selector. So orca serve from it can't start Electron serve or orcad today, with or without --command.

Making it work was considered: the CLI could start its own slot's orcad directly. That would compete with the SSH-launched server for the same profile, and a service would point at a slot that the next client update removes. That is a feature with its own design, not a fix. A clear refusal that names the working route is the safe step now.

Linked Issue

Part of the headless-serve robustness work (D1, service-install follow-up). No separate issue.

Visual Proof

N/A. This changes CLI error text and refusals only.

Testing

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

  • serve-service.test.ts:

    • With only a server-only orca on PATH, install fails on Linux and macOS with an error that names the command to run. Nothing is written and no service manager is called.
    • From the same terminal, an app launcher found on PATH or passed with --command still installs.
    • A version-scoped --command is refused.
    • The existing install tests now model the app CLI explicitly.
  • launch.test.ts: orca serve --supervise without an app executable throws the new guidance and spawns nothing.

  • Both new tests failed before the change.

  • The full src/cli suite, pnpm tc, oxlint, pnpm run check:code-quality:changed and pnpm lint pass locally.

  • Not run: a real SSH host. No serve processes were started.

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • SSH: this is the SSH-host case. Nothing about the SSH-launched server itself changes.
  • Compatibility: no wire or file change. A --command inside the profile used to be accepted; it could only produce a unit that breaks on the next update, or never starts.
  • Windows: serve service still refuses first with the existing "not available on Windows" message.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

📝 Walkthrough
📝 Walkthrough

Walkthrough

Shared runtime helpers now check whether the environment can start the Orca server and resolve an app CLI for service installation. Supervised serving and profile-state recovery use the shared eligibility logic. Tests and installation notes cover app-launcher selection, version-scoped commands, and server-only environments.


Priority: ➖ Normal

Merge Risk: 🟡 Moderate · up to a1645

A service installed through such a symlink can stop starting after a version update. Check launcher targets before merging.

Pre-merge checks | Passed 3 | Failed 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 12 functions across 7 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check Warning The description is detailed and covers the user impact, implementation, rationale, testing, compatibility, and checklist. However, the required Linked Issue section does not provide an actual issue li… Add an actual linked issue in the Linked Issue section, such as Fixes #<issue-number>, unless the author is a repository maintainer and the repository policy explicitly permits omitting a needless issue.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title clearly identifies the serve guidance change for SSH hosts where the available Orca command cannot start or install a server.

Full details: Description check

Explanation

The description is detailed and covers the user impact, implementation, rationale, testing, compatibility, and checklist. However, the required Linked Issue section does not provide an actual issue link and explicitly states that no separate issue exists.


  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

🟠 Major · Check the symlink target before accepting a service command. · serve-app-launcher.ts:66

src/cli/runtime/serve-app-launcher.ts:66
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Check the symlink target before accepting a service command.

If /usr/local/bin/orca-ide links to a launcher under the profile, isVersionScopedDir(dirname(explicit), userData) checks /usr/local/bin. accessSync follows the link, so the resolver accepts the version-scoped launcher through both --command and PATH. Service installation can then persist a command that stops working when that version is replaced. Resolve each candidate’s real path and reject targets in version-scoped directories before returning the command.


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: dc1676d0-f99b-419a-ab6a-8bbdb140df3e
📥 Commits

Reviewing files that changed from the base of the PR and between e40926b and a164545.

📒 Files selected for processing (4)
  • src/cli/handlers/serve-service.test.ts
  • src/cli/handlers/serve-service.ts
  • src/cli/runtime/profile-state-recovery-launch.ts
  • src/cli/runtime/serve-app-launcher.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

@OrcaWin
OrcaWin merged commit 65a1611 into main Oct 12, 2026
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant