mirror of
https://github.com/stablyai/orca.git
synced 2026-11-19 04:23:57 +00:00
* fix(agents): detect opencode/pi CLIs installed under ~/.opencode/bin and ~/.vite-plus/bin Packaged Electron inherits a minimal PATH without shell rc files, so agent install-script fallback dirs stay invisible to `which` probes — the Agents settings page then shows OpenCode/Pi as "Not installed" even when the user can run them from Terminal. Add ~/bin, ~/.opencode/bin, and ~/.vite-plus/bin to the packaged PATH augmentation so preflight detection matches shell behavior. Fixes #829 * feat(agents): hydrate PATH from user's login shell + Agents Refresh button Packaged Electron inherits a minimal launchd PATH that misses whatever the user's shell rc files append — ~/.opencode/bin, ~/.cargo/bin, nvm shims, pyenv, custom tool dirs. The preceding commit hardcoded two known install locations; this replaces that whack-a-mole pattern with a generic approach. On packaged startup (non-Windows), spawn `${SHELL} -ilc 'echo $PATH'` with a 5s timeout, parse the delimited PATH, and prepend any new segments to process.env.PATH. The result is cached for the app session so we pay the shell-init cost at most once. Surface a Refresh button in Settings > Agents that forces a re-probe and re-detects installed agents — handy right after installing a new CLI, no restart needed. Live-verified that a `zsh -ilc` spawn with a minimal launchd-style env still resolves the user's full PATH (32+ segments including the rc-appended dirs). * refactor(hydrate-shell-path): simplify dedup with Set + Set.difference Set preserves insertion order, so PATH first-match-wins semantics are preserved without manual tracking. Set.prototype.difference (Node 22+) expresses the new-segments calculation in mergePathSegments as the set-difference operation it always was.