mirror of
https://github.com/stablyai/orca.git
synced 2026-10-31 09:07:40 +00:00
On macOS a second Electron main aborts inside _RegisterApplication before any Orca JavaScript can apply the one-Orca-per-profile rule, so supervisors and agents retrying 'orca serve' loop on SIGABRT (#14541). The CLI now checks the profile before it execs Electron serve. A runtime that answers, or whose socket accepts, is live; one whose socket neither accepts nor refuses, or that refuses this CLI's credentials, is unverifiable; both refuse with exit code 3, the single-instance code systemd units already key off. Only a definitive refusal (ENOENT or ECONNREFUSED) lets it start. A fresh profile keeps the old synchronous launch. A macOS startup abort is remembered per environment, so a later separate 'orca serve' from the same launchd session refuses for 30 minutes with exit 78 instead of aborting again; --force overrides, and a serve that reaches readiness clears it. Adapted from #14768; the Launch Services diagnostic wording and the exit code 3 contract come from #14542. Co-authored-by: m4air <m4air@Mac.localdomain> Co-authored-by: Jinwoo-H <jinwoo0825@gmail.com> Co-authored-by: thiagomsoares <5190162+thiagomsoares@users.noreply.github.com>
4 lines
255 B
TypeScript
4 lines
255 B
TypeScript
// Why shared: the CLI refuses a duplicate `orca serve` before exec with the same code the Electron
|
|
// main uses, and systemd's RestartPreventExitStatus= keys off it; changing it un-fixes #11935.
|
|
export const SINGLE_INSTANCE_ALREADY_RUNNING_EXIT_CODE = 3
|