Repository navigation
fix(serve): explain what to run when an SSH host's orca cannot start or install a server - #28003
Conversation
…or install a server
📝 Walkthrough
Priority: ➖ Normal Merge Risk: 🟡 Moderate · up to A service installed through such a symlink can stop starting after a version update. Check launcher targets before merging. Pre-merge checks |
|
…l; share the app-CLI check
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟠 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 winCheck the symlink target before accepting a service command.
If
/usr/local/bin/orca-idelinks to a launcher under the profile,isVersionScopedDir(dirname(explicit), userData)checks/usr/local/bin.accessSyncfollows the link, so the resolver accepts the version-scoped launcher through both--commandandPATH. 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
📒 Files selected for processing (4)
src/cli/handlers/serve-service.test.tssrc/cli/handlers/serve-service.tssrc/cli/runtime/profile-state-recovery-launch.tssrc/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.
ELI5
On a remote machine that Orca reaches over SSH, the only
orcacommand is the one Orca's own SSH server drops into its terminals. That command can't start a server, soorca serve --superviseandorca serve service installcan'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
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 installfailed with "Could not find theorcacommand on PATH. Install it from Orca Settings, or pass --command". There are no Orca Settings on that host. Following the--commandhint 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.orca servesays thisorcaisn'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 runorca-ide serve(orca serveon macOS) from a plain login shell, or setORCA_APP_EXECUTABLE.orca serve service installstill uses an installed app's launcher when one is on PATH (orca-ideon Linux,orcaon macOS), so a terminal of a local server keeps working. When none is found and thisorcais a server-only one, the error says the same thing and namesorca-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.--commandnow 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.orca-ideon Linux).serve service installhelp notes say the Orca app must be installed on the machine.ELECTRON_RUN_AS_NODE=1, set by every packaged and dev launcher), orORCA_APP_EXECUTABLEpoints at one. That is exactly the conditionorca servealready needed to find an executable. Profile-state recovery had its own copy of the check, and it now uses the shared one.serve-service.tsintoserve-app-launcher.tsnext 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. Theorcain 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. Soorca servefrom 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:orcaon 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.--commandstill installs.--commandis refused.launch.test.ts:orca serve --supervisewithout an app executable throws the new guidance and spawns nothing.Both new tests failed before the change.
The full
src/clisuite,pnpm tc, oxlint,pnpm run check:code-quality:changedandpnpm lintpass locally.Not run: a real SSH host. No serve processes were started.
Review
Agent skill upstream boundary
Notes
--commandinside the profile used to be accepted; it could only produce a unit that breaks on the next update, or never starts.serve servicestill refuses first with the existing "not available on Windows" message.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)