Files
orca/config/build-plugins
OrcaWinandm4air c20524168d fix(runtime): move the local RPC socket to a short path when userData is too long (#39972)
* fix(runtime): move the local RPC socket to a short path when userData is too long

A long userData path made the local RPC socket path exceed the Unix
sun_path limit (104 bytes on macOS, 108 on Linux), so listen failed with
EINVAL and the CLI could not reach the runtime. Reuse the terminal
daemon's relocation: resolveDaemonUnixSocketPath moves the socket to a
private /tmp/.orca-daemon-<uid>/<hash> dir, the server creates and
verifies that dir before listening, and the orphan sweep covers it.
The CLI and the browser sidecar check the dir is private to this user
before they send the auth token, as the daemon client does.

* fix(runtime): verify the relocated socket dir before sweeping it; probe relocated holder sockets

Check that the relocated /tmp/.orca-daemon-<uid>/<hash> dir is private to
this user before the orphan sweep lists or unlinks anything in it, and skip
that dir when the check fails. The orcad stale-lock reclaim now also scans
the relocated dir for the holder's runtime socket, so a live holder there
is probed and its lock is not reclaimed.

* fix(runtime): ship the socket-dir check with the packaged CLI; keep main sync fs flat

The CLI imports daemon-socket-endpoint-path, but electron-vite replaces
out/main, so packaging lost the module and the installed CLI crashed.
Add it to the CLI main entries and unpack it with its mode constants.
The lifecycle sweep and the stale-lock reclaim now use async fs for the
relocated dir, so the main sync-fs count stays at its baseline.

---------

Co-authored-by: m4air <m4air@m4airs-MacBook-Air.local>
2026-11-08 14:21:10 -08:00
..