Repository navigation
feat(installation): report the copies on PATH that never run (#160) - #162
Merged
Merged
Conversation
On a Ferry user's machine, Codex's updater ran `npm install -g`, printed success, and oar correctly reported `unchanged`: npm had installed the new version into a prefix that is not on PATH, while the codex that runs was one of five copies. Hosts could not see that other copies exist, so someone had to SSH in to find out. `ExecutableInstallation` gains an optional `shadowed`: the other copies of the same command that PATH lists after the one found, in PATH order, as PATH spells them. This is part 1 of #160 in the shape decided on the issue: paths only, no `--version` per copy (a process per copy on every probe; a host reads versions on demand) and no npm/Homebrew/standalone classification. It is absent when an `OAR_*_BIN` override names the executable (as a path or a bare name), when a fallback outside PATH found it (codex's macOS app bundle, kimi's and grok's installer folders), and when PATH lists no other copy. The PATH walk is shared (`locateOnPath` over `which -a` order in shared/installation.ts), so `executableInstallation` reports it for every executable runtime: claude, codex, grok, kimi, opencode, antigravity and the community morph. A copy is a real file: a folder listed twice, `/bin` beside `/usr/bin` on merged-usr Linux, or a symlink to the running copy is not another one. A folder holds one copy, its first match: on Windows the first PATHEXT extension, since npm's `.cmd` and `.ps1` side by side are one install. Folders and non-executable files never match. Validation: `pnpm run check` (also with `CI=1`) and `pnpm tsx sea-trial/all.ts` (mock and the three aimock backends) pass. New temp-dir tests cover order, a repeated folder, a symlinked folder, a symlink to the running copy, non-executable files, launchers in one folder, Windows PATHEXT, and overrides and outside fallbacks reporting none. On this machine `oar installation` reports kimi's second copy (`/usr/local/bin/kimi`) and nothing for grok, whose two PATH entries resolve to one file. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review on #162: the contract comment and the `unchanged` row in docs/spec/update.md implied that `shadowed` shows the copy an updater updated. It does not in the case that prompted #160: npm installed into `~/.npm-global/bin`, which is not on PATH, so that copy is not in `shadowed`. Both now state the fact instead: `shadowed` lists copies on PATH only, and a copy installed off PATH is not among them. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Merged
xxchan
added a commit
that referenced
this pull request
Oct 7, 2026
Release OAR and CLI 0.27.0. This PR changes only the two package version fields. **New** - `ExecutableInstallation.shadowed` (#162, part 1 of #160): when PATH found the runtime's command, the other copies of it that PATH lists later, which never run, in PATH order and as PATH spells them. Paths only, no versions. Entries that resolve to one file count once. Absent when an `OAR_*_BIN` override or a fallback outside PATH found the executable, and when there are no other copies. A copy installed off PATH is not listed. `oar installation --json` prints it. Validation: all 13 checks passed on #162's final head (`390945d`). After this PR passes CI and merges, tag its exact squash commit as `v0.27.0` to trigger npm trusted publishing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: exe.dev user <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
stamp-build Bot
added a commit
that referenced
this pull request
Nov 5, 2026
<!-- stamp:review:v1 --> <sup><img src="https://cdn.slock.ai/avatars/6aabf32c-20bc-4cba-b55a-2aa72b60999b/8ba4452ceb890f1930886ef4286fdb99.webp" width="16" height="16" align="absmiddle" alt=""> <b>Otter</b> from open-agent-runtime opened this pull request through Stamp</sup><br><sup><a href="https://stamp.build/review?receipt=prc_79892a3340b0f81c316fddd6141f962a"><picture><source media="(prefers-color-scheme: dark)" srcset="https://stamp.build/assets/brand/stamp-glyph-dark.d907ffcadb44.svg"><img src="https://stamp.build/assets/brand/stamp-glyph-light.58a2c10ed108.svg" width="13" height="12" align="absmiddle" alt=""></picture> View in Stamp →</a></sup> --- <!-- /stamp:review:v1 --> A Pi prompt refused before native start can leave held inputs stranded and retain cancellation intent for the next run. Recover that path by recording the refusal, clearing stale abort state and draining held work. SDK disposal during pending admission now reports disposed, late failures cannot settle a later extension run, and RPC clears a cancellation fallback rearmed while terminal statistics or observers finish, preventing a healthy child from being killed later. Ordinary terminal publication keeps its existing order: publish `turn_ended`, then release the native run gate and drain. A synchronous SDK/RPC observer can therefore see idle while prompt is still busy; submit after the observer returns. The earlier synchronous-submission implementation is withdrawn, including its preflight admission helper, deferred dispatch, isStreaming checks and front requeue. The design decision documents why settlement-time extension scheduling makes that approach unsafe and what evidence would reopen it. Pi Durable product behavior is unchanged. Extension-handled inputs, competing extension runs, missing queue ownership and a reentrant prompt from a pre-start refusal observer remain explicit limitations. Task #173 owns their separate record/ownership design. No completion is fabricated here, and this change does not claim to fix those existing gaps. Validation on main `91c626a5`: - Full check: 3,202 tests and 18 mock behavior cases passed. Build and clean packed consumption passed. - 21 focused regressions cover refusal draining, stale cancellation, disposal, late failures, terminal callback ordering and ordinary FIFO. Eight focused mutations are caught; the main product code fails eight of the retained independent regression cases. - Native Pi SDK/RPC 1.5.0 vendor suites passed (101/99 cases), Durable passed 26 cases, and all three Pi behavior backends passed. Missing-key refusal uses a local scripted provider and verifies recovery. Ordinary terminal observer prompt/queue controls preserve FIFO; Durable remains a separate control. - The supplied review probes for extension preparation failure, delayed extension input and competing observer prompts were compared with main in SDK and RPC. Their recorded facts match byte for byte after narrowing. Those diagnostics are retained locally, not installed as public tests; their existing limitations remain documented. Task #162, intended for 0.87.2 with #626. No package version or release tag change. Windows/macOS results require this head's CI. Rebased after #626; all four commit patches are unchanged. --------- Co-authored-by: Otter <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 1 of #160, in the shape decided on the issue (comment): parts 2 and 3 stay out of oar, so this is all of oar's side.
Why
On a Ferry user's Linux machine, Codex's updater ran
npm install -g, printed success, and oar correctly reportedunchanged. npm had installed 0.160.1 into~/.npm-global, which is not on PATH, while thecodexthat runs was nvm's, one of five copies on the machine. Ferry could not show that other copies exist, so someone had to SSH in.What
ExecutableInstallationgains an optionalshadowed?: readonly string[]: the other copies of the same command that PATH lists after the one found, in PATH order, as PATH spells them. These copies never run.--versionper copy, since that would add a process per copy to every probe; the host reads versions on demand. No npm/Homebrew/standalone classification.OAR_*_BINoverride names the executable (as a path or a bare name), and when a fallback outside PATH found it (codex's macOS app bundle, kimi's and grok's installer folders). A bare-name fallback (morph'smistermorph, kimi'skimi-code) is a PATH lookup, so it reports its own name's copies.versionis omitted.locateOnPathinshared/installation.tswalks PATH inwhich -aorder (resolveExecutableAll).executableInstallationkeeps every PATH match of a candidate and reports the winner's, so claude, codex, grok, kimi, opencode, antigravity and the community morph get it without runtime code.locateExecutable(used by login) is unchanged.oar installationprints it in its JSON;oar listshows no installations), and theunchangedrow indocs/spec/update.md.Edge cases
/bin→/usr/binon merged-usr Linux, fnm's multishell folders) or a symlink to the running copy. Copies are compared byrealpathSync.nativeand reported as PATH spells them.codex.CMD). A folder holds one copy, its first match. Windows runs the first PATHEXT extension there, and npm'scodex.cmdandcodex.ps1side by side are one install, so they do not show up as a second copy when.PS1is in PATHEXT.app-server --helpfailing moves on to the next candidate, not the next PATH copy). Which copy runs stays the same.Test evidence
tests/installation-shadowed.test.tsbuilds temp-dir PATHs with fixture executables (.CMDon Windows) and covers: PATH order and a repeated folder; a symlinked folder (a junction on Windows); a symlink to the running copy; non-executable files and a folder named like the command; launchers in one folder; first-PATHEXT-match on Windows (runIf(win32)); the probe reporting through the command name and a bare-name fallback; the field missing for one copy, for an override (path and bare name), and for a fallback outside PATH. If Windows refuses to create the file symlink (EPERM without Developer Mode), that one case skips instead of failing.tests/installation.test.ts: the two exact snapshots of the realnodenow probe with PATH set to node's own folder, so the machine's other node copies stay out of them.pnpm run checkandCI=1 pnpm run checkpass (696 tests), andpnpm tsx sea-trial/all.tspasses on all four backends (mock, claude-aimock, codex-aimock, pi-aimock). On this machine,oar installationreports"shadowed": ["/usr/local/bin/kimi"]for kimi (two real copies) and nothing for grok (~/.local/bin/grokand~/.grok/bin/grokresolve to one file) or codex (one folder listed six times).🤖 Generated with Claude Code