Skip to content

feat(installation): enforce vendor identity, per-line version ranges, and host checks across all runtimes - #1084

Merged
stamp-build[bot] merged 3 commits into
mainfrom
agent/lookout/installation-guards
Nov 20, 2026
Merged

stamp-build[bot] merged 3 commits into
mainfrom
agent/lookout/installation-guards

Conversation

@stamp-build

@stamp-build stamp-build Bot commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Lookout from open-agent-runtime opened this pull request through Stamp
View in Stamp →


Summary

Implements #core:#350 (Phase 1 of Raft's runtime-branch inventory: items D1, D2, H4, H6): one shared installation() rule across all 15 runtimes so every unsupported snapshot carries a typed code, non-vendor executables are refused, per-line version floors and upper bounds work declaratively, and bundled/SDK runtimes declare host-environment constraints inside installation().

Contract & Shared Primitives

  • packages/oar/src/contracts/installation.ts (re-exported in contracts/index.ts and index.ts):
    • Every unsupported InstallationSnapshot now carries a typed code:
      • version_unsupported (VersionUnsupportedInstallation, unchanged shape; only variant admitted to checkUpdate() / upgrade())
      • unrecognized_executable (UnrecognizedExecutableInstallation: via: "executable", command, reason; never admitted to updaters)
      • readiness_failed (ReadinessFailedInstallation: via: "executable", command, reason)
      • unsupported_platform, unsupported_node_version, unsupported_host, dependency_missing (HostUnsupportedInstallation)
  • packages/oar/src/shared/version-range.ts:
    • Declarative ExecutableVersionPolicy and VersionLineConstraint supporting per-major-line inclusive floors, implicit/explicit exclusive upper bounds (major or maxExclusive), and stableOnly gating.
  • packages/oar/src/shared/host-environment.ts:
    • Shared checkHostEnvironment() / currentHostEnvironment() checking platform-arch sets, minimum Node semver, compiled single executable (nodeEvalExecutable() === null), Electron (process.versions.electron), and on-disk module/file resolvability.
  • packages/oar/src/shared/installation.ts:
    • One candidate loop in executableInstallation() enforcing readiness, vendor identity (help and/or version), and versionPolicy, falling through failed candidates to a usable fallback or returning the first candidate's typed refusal. Unrecognized executables, readiness failures, and unsupported versions are never cached.

Per-Runtime Results (All 15 Runtimes)

Runtime installation() guards Version policy Native evidence
antigravity --help identity (Usage of + agy flags/ACP) + readAntigravityVersion Stable >= 1.5.0 Real agy 1.5.13 --help (verified argv[0]-independent via symlink); experiments/old-cli-upgrade/README.md (1.4.9)
claude --version identity ((Claude Code)) None Real claude 2.1.292 --version: 2.1.292 (Claude Code)
codebuddy --help identity (codebuddy|cbc) on direct and npm-prefix probes None Real codebuddy 2.173.0 --help: Usage: codebuddy|cbc ... CodeBuddy Code
codex app-server --help identity (Usage: codex app-server) + --version (codex[-cli] <semver>) None Real codex 0.170.0: Usage: codex app-server [OPTIONS] [COMMAND] / codex-cli 0.170.0
cursor Host checks: 5 companion platforms (darwin/linux arm64/x64, win32-x64), Node >= 22.13.0; subprocess also forbids Node SEA / Bun standalone (unsupported_host) and requires resolvable sdkModule (dependency_missing) Host Node >= 22.13.0 @cursor/[email protected]/package.json (optionalDependencies, engines.node: ">=22.13"); shared/executable/node-script.ts:67
devin acp --help readiness + --version identity (^devin <semver>) None docs/runtimes/devin.md, tests/devin/installation.test.ts (devin 3000.12.57 (96542e930752))
dsh --help identity (Usage: dsh / DeepSeek Harness) Semver >= 0.2.1-rc.5 (prerelease-aware) Real dsh 0.2.1-rc.5 --help and experiments/old-cli-upgrade/dsh-commands.json (0.2.1-rc.4)
factory exec --help identity (Usage: droid exec) None Real droid 1.12.1 exec --help: Usage: droid exec [options] [prompt]
grok agent stdio --help identity (Usage: grok agent stdio) + --version (^grok <semver>) None Real grok 1.0.89: Usage: grok agent stdio [OPTIONS] / grok 1.0.89 (...) [stable]
kimi acp --help identity (kimi) None Real kimi 2.1.1 and 2.6.3 acp --help: Usage: kimi acp [options] ... kimi-code
opencode --help identity (opencode) >=1.18.30 <2.0.0 || >=2.0.27 <3.0.0 Real opencode 1.18.30 and 2.2.7 --help; docs/runtimes/opencode.md baselines; opencode/version.ts:30
pi In-process: bundled SDK; subprocess default: non-SEA/Bun (unsupported_host), non-Electron (unsupported_host), resolvable @earendil-works/pi-coding-agent/rpc-entry (dependency_missing); subprocess with explicit command: locates command and checks --version Explicit command: stable >= 1.4.0 (version_unsupported) pi/rpc/launch.ts:8,21, pi/rpc/open.ts:109, pi/rpc/version.ts:24, gating CI pi-rpc-windows & pi-rpc-minimum
pi-durable Refuses non-empty env, returns available (via: "bundled") None Host-owned open Harness (pi-durable/index.ts:33)
qoder --help identity (Usage: qodercli / Qoder CLI) Stable >= 1.1.78 Real qodercli 1.1.78 --help: Usage: qodercli ... Qoder CLI
qwen --help identity (Usage: qwen / Qwen Code) None Real qwen 0.26.0 --help: Usage: qwen ... Qwen Code

Platform Evidence Note for Raft (D2 / H6)

Two host checks in Raft's older loader differ from OAR's measured native evidence and remain host policy rather than OAR refusals:

  1. Cursor platforms: @cursor/[email protected]/package.json ships native companion packages for five targets (darwin-arm64, darwin-x64, linux-arm64, linux-x64, win32-x64), and OAR CI runs cursor-skills.vendor.test.ts and tests/cursor/cursor-subprocess-lifecycle.test.ts on Linux, macOS, and Windows. OAR therefore checks those five targets in installation() rather than restricting to Linux; verifiedPlatforms omits cursor because live runs are Linux-only.
  2. Pi RPC on Windows: OAR gates pi-rpc-windows (behavior and vendor) on windows-latest and includes win32 in verifiedPlatforms.pi. OAR therefore does not refuse Windows in Pi RPC installation().

Raft Rows Unblocked

  • D1: installation() refuses non-vendor executables across all 12 executable runtimes (unrecognized_executable / readiness_failed, verified with Devin adapter, generic ACP bridge, AiderDesk, and node in the Grok slot and across all 12 slots) and supports per-line floors plus upper bounds.
  • H4: opencodeInstallation() returns unsupported (code: "version_unsupported", requiredVersion: ">=1.18.30 <2.0.0 || >=2.0.27 <3.0.0") outside OpenCode 1.x >= 1.18.30 and 2.x >= 2.0.27 < 3, replacing Raft's hardcoded isOarOpencodeVersion.
  • D2 / H6: cursor and pi (execution: "subprocess") enforce host-environment availability inside installation() with typed unsupported codes (unsupported_platform, unsupported_node_version, unsupported_host, dependency_missing, and version_unsupported for explicit Pi command), replacing Raft's piRpcAvailable host checks (apart from Raft-only OS policy noted above).

Caller Audit

Audited every call site of InstallationSnapshot and executableInstallation across packages/oar/src/ and packages/cli/src/:

  • Changed: contracts/installation.ts, contracts/index.ts, shared/installation.ts, shared/version-range.ts, shared/host-environment.ts, all 14 non-pi-durable runtimes/*/installation.ts, runtimes/cursor/index.ts, runtimes/pi/index.ts, docs/spec/install.md, docs/runtimes/{opencode,cursor,pi}.md.
  • Verified unchanged: shared/update.ts, packages/cli/src/upgrade.ts (admit only available or code === "version_unsupported", never unrecognized_executable or host refusals), shared/orientation/index.ts, packages/cli/src/{index,login,logout,models,run,usage}.ts, agents/helpers.ts, runtimes/{antigravity,devin}/install.ts, runtimes/claude/limit-reset/driver.ts, community/morph/installation.ts (untouched).

Verification

  • Real-binary probe on this host (antigravity 1.5.13, claude 2.1.292, codex 0.170.0, codebuddy 2.173.0, grok 1.0.89, kimi 2.1.1, opencode 1.18.30, qoder 1.1.78, qwen 0.26.0, pi in-process/subprocess, cursor in-process/subprocess) plus cross-runtime mismatch checks (node, agy, opencode in foreign slots).
  • Local CI=1 pnpm run check (before clean rebase onto 00e7bc5e): typecheck passed, oxlint --type-aware --deny-warnings 0 errors / 0 warnings, vitest run 592 passed / 149 skipped (5589 passed / 705 skipped), mock sea-trial 19 passed / 1 skipped / 0 failed. Re-checked typecheck and tests/installation-guards.test.ts on rebased head fed223da.

@stamp-build
stamp-build Bot merged commit 47db6d9 into main Nov 20, 2026
25 checks passed
@stamp-build
stamp-build Bot deleted the agent/lookout/installation-guards branch November 20, 2026 14:13
@stamp-build stamp-build Bot mentioned this pull request Nov 20, 2026
stamp-build Bot added a commit that referenced this pull request Nov 20, 2026
<!-- stamp:review:v1 -->
<sup><img src="https://api.raft.build/api/avatars/pixel/bXVn.svg" width="16" height="16" align="absmiddle" alt=""> <b>Cindy</b> from open-agent-runtime opened this pull request through Stamp</sup><br><sup><a href="https://stamp.build/review?receipt=prc_010f166b1c3ba63a625f97aa49c7a328"><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 -->

## OAR 0.126.0

### Behavior changes hosts should know

- **`installation()` refuses programs that are not the vendor CLI, and every refusal is typed** (#1084). The `unsupported` snapshot now always carries a `code`, and the old untyped variant is gone, so custom runtime probes must set one:
  - `version_unsupported`: the vendor CLI is outside the supported range. This is the only code admitted to `checkUpdate()` and `upgrade()`. Hosts should show every other code as a setup problem, not reinstall.
  - `unrecognized_executable`: the program in the slot does not identify as the vendor CLI. Identity comes from its version output, so a wrapper (for example an `OAR_CLAUDE_BIN` script) that prints a bare version is now refused; Claude must print `(Claude Code)`.
  - `readiness_failed`: the runtime's readiness check (`--help`, `app-server --help`, `acp --help` and the like) exited nonzero, or `--version` failed where the runtime declares an identity or version policy.
  - Host refusals: `unsupported_platform`, `unsupported_node_version`, `unsupported_host` (for example Pi RPC inside a single executable or Electron, or Cursor subprocess mode inside a single executable) and `dependency_missing` (a required module such as Pi's RPC entry or Cursor's SDK cannot be resolved). Cursor now refuses Node below 22.13.0 in both modes.
  - **OpenCode now has a version range**: `>=1.18.30 <2.0.0 || >=2.0.27 <3.0.0`. Installs below 1.18.30, at 2.0.0 to 2.0.26, or on 3.x that worked before are now `version_unsupported`.
  - Candidate selection changed: a refused candidate falls through to the next one, and a vendor install that is only too old wins over a refusal of another kind. Antigravity, DSH, OpenCode, Qoder and Qwen gained a `--help` readiness probe, so an uncached probe starts one more process.
- **`rateLimited` means the whole account is limited** (#1073). On Codex only the account bucket and its credits set it; a single-model bucket such as Spark stays in `windows`. On Claude only the five-hour and seven-day windows set it; per-model windows and `seven_day_oauth_apps` do not, and unlimited Extra Usage counts as headroom. `usedRatio` never rounds an unexhausted reading up to 1, and on Codex it no longer exceeds 1. Codex no longer reports `reauth_required` or `unsupported` for process exits, initialize failures or timeouts, and its usage and limit-reset errors carry the native `cause`. Grok reports `reauth_required` only for ACP code `-32000`, not for any error mentioning sign-in. Codex's legacy single-bucket view gets `scope: account`. Antigravity sets `rateLimited` when every group is exhausted and credits are at or below zero.
- **`plan` is the name the runtime shows the user** (#1076). Claude reads `oauthAccount.planDisplayName` when the stored account matches the signed-in one, and falls back to the native plan code otherwise. Hosts that compared `plan` against native codes such as `max` will now see display names on `authStatus`, `login` and `accountUsage`.
- **Idle sessions and short-lived queries end through stdin EOF** (#1061, #1074). Claude and Codex now end an idle session, and their query processes (usage, models, skills, inventory; on Codex also limit reset and a completed login), by closing stdin and killing the tree only after the kill grace. Factory's account process does the same. A session with an active turn is still stopped at once. Qoder and Qwen share the same path, so their grace moved from a fixed 5 s to the kill grace (10 s by default, `OAR_KILL_GRACE_MS`).
- **Antigravity quota notices mid-turn fail the turn as `quota` with `resetsAt`** (#1068), after earlier tool work too. Normal text that quotes the notice still completes.

### New

- **Credentials declared for every runtime** (#1085). `Runtime.credentials` on all 15 built-in runtimes lists its stores (`directoryEnv`, `fallbackDirectoryEnvs`, keychain `service`), its variables with the `provider` and logical `field` each belongs to (for stripping, redaction and error attribution), `scope` (`single_account` or `per_provider`), `management` (`native`, or `external`: no native login, the person or host supplies the credential), `signInPaste`, `usageDirectoryEnv` and key `interpolation`. `LoginAccount.accountId` is set on Claude (`oauthAccount.accountUuid`, only when the stored account matches the signed-in one) and on Codex (only when the login lives in Codex's default file store and the file's sign-in token matches the signed-in account). A missing `accountId` never means "no account".
- **Latest model request** (#1060, #1072). Open with `modelRequests: "latest"` and call `Session.lastModelRequest()` for the last attributed root request, read on demand and redacted. Claude (2.1.274 and later; resume verified on 2.1.326) reads its own capture, which writes the body of every model call, child and auxiliary calls included, to a private directory. Pi SDK keeps the body after Pi and extensions have transformed it, for Anthropic Messages, OpenAI Chat Completions and OpenAI Responses models; other model APIs are refused at open. Pi RPC and all other runtimes declare the option refused. `RefusableSessionOption` gains `"modelRequests"`.
- **Native session file** (#1065, #1086). `Session.nativeSessionFile()` returns the file Codex (0.169.0 and later) or Pi has saved, once it exists, on fresh, resumed and forked sessions, and still after disposal. It returns `null` for a path that contains a credential. The path is the runtime's own spelling and can differ between opens of the same session (Codex on Windows adds `\\?\` on resume); compare files by filesystem identity.
- **Claude side questions** (#1066). `Runtime.sideQuestion` answers one question about a saved Claude session from a disposable native fork with no tools, no MCP servers, no slash commands and no user or project hooks. It makes its own provider request with Claude's default model unless `model` is given, and times out after 60 s by default. The source can be running or stopped and is left unchanged. Claude Code 2.1.326 and later.
- **Codex applied file changes per path** (#1063) on `tool_call_ended.fileChanges` and the session view, with moves kept together. Codex 0.160.1 and later.
- `SessionCapabilityDeclaration` gains `sideQuestion`, `fileChanges` and `nativeSessionFile`. New exported types include `ModelRequest`, `FileChange`, `SideQuestionOptions`, the installation refusal types and `CredentialField`.

### Fixes

- **Steer and abort** (#1070).
  - Pi RPC no longer kills a live process 10 s after a refused abort, and Pi SDK aborts between `agent_end` and `agent_settled`.
  - Factory retries reach `droid` after a refused interrupt.
  - Cursor bounds `abort()` at 10 s. In subprocess mode it stops the child if the run ignores cancel; in-process, a hung cancel answers `accepted` after 10 s while the run may continue. A live native refusal is `runtime_refused`.
  - Codex abort refusals keep `session_not_found` and the native error.
  - DSH maps process exit to `runtime_exited`, answers a prompt sent while another is starting with `busy`, and answers idle steer with `no_active_turn` before checking images.
  - Pi Durable agrees with `status()` right after `prompt()`, answers idle steer with `no_active_turn`, still returns `accepted` when a status read fails after a durable commit, bounds `abort()` at 10 s and reports aborted inbox inputs as `input_dropped`.
- **DSH cold profile initialization** (#1080). Concurrent session, model and skill startup on a fresh DSH profile no longer races (3 in 100 shared-profile pairs failed on 0.2.2-rc.5): it now uses the one-opener coordinator Codex already had. This holds within one OAR process; separate processes can still race.

### Tests and docs

- Configured-append contract on Antigravity, DSH, Factory, Grok, Pi Durable and Qoder (#1057, #1077); Qoder notification abort (#1059); Windows OpenCode startup diagnostics (#1064, #1078, #1083); tests tell processes apart across PID reuse (#1081, #1087).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Cindy <[email protected]>
stamp-build Bot added a commit that referenced this pull request Nov 20, 2026
<!-- stamp:review:v1 -->
<sup><img src="https://api.raft.build/api/avatars/pixel/ZXll.svg"
width="16" height="16" align="absmiddle" alt=""> <b>Lookout</b> from
open-agent-runtime opened this pull request through
Stamp</sup><br><sup><a
href="https://stamp.build/review?receipt=prc_78d6154b7fa5b739f485cde40249b6e1"><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 -->

## Summary

Add a workflow-level `concurrency` group per ref with
`cancel-in-progress: true` to `.github/workflows/ci.yml` (`#core:#387`):

```yaml
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
```

## Why

On `main`, each push schedules ~15 macOS jobs. Without workflow-level
concurrency cancellation, successive merges queue superseded `main` runs
ahead of the release commit's run, starving the macOS runner pool until
`release.yml`'s 60-minute CI gate times out. `main` has now had to be
unblocked by hand three times:
- `0.122.0` on 2026-11-19
- `0.125.0` on 2026-11-20 at 06:02 UTC (9 queued runs, `#378`)
- `0.126.0` on 2026-11-20 at 18:50 UTC (5 older queued runs)

With `group: ${{ github.workflow }}-${{ github.ref }}` and
`cancel-in-progress: true`:
- `push` to `main` and `workflow_dispatch` on `main` share
`ci-refs/heads/main`, so newer `main` pushes and manual recovery
dispatches cancel older queued/running `main` runs immediately.
- Each pull request uses `ci-refs/pull/<N>/merge`, so pushes to a PR
cancel only older runs on that same PR and never collide with `main`,
other PRs, or a `workflow_dispatch` on the branch ref
(`ci-refs/heads/<branch>`).

## Dependency Audit (verified before changing)

- **`.github/workflows/release.yml` (untouched):** Lines 79-80 query
only `actions/workflows/ci.yml/runs?head_sha=$GITHUB_SHA`, selecting
`.event == "push" or .event == "workflow_dispatch"` and taking `first`
(newest run for that exact commit). It never reads older commits' runs.
If another commit merges to `main` while a release commit's CI is
running, the superseded commit's run is cancelled and `release.yml`
fails closed (`CI did not succeed on $GITHUB_SHA`), matching its
contract that a dispatched release is only ever the current head of
`main`.
- **Other workflows in `.github/workflows/`:** None use `workflow_run`
on `ci.yml` or depend on older `ci.yml` runs. `osv-scanner.yml`,
`runtime-latest.yml`, and `release.yml` already declare workflow-level
`concurrency`.
- **Stamp (`stamp settings -R botiverse/oar`, `stamp repo guard list -R
botiverse/oar`):** `merge_hold` has no active holds (`holds: []`),
`ci_on_ready` has no custom rules, and `workflow_guard` is off. Verified
empirically on the 5 cancelled `main` runs from 2026-11-20
(`44738501140`, `44751339691`, `44758089023`, `44770042974`,
`44777833935`): Stamp posted zero false post-merge failure comments on
their PRs (`#1084`, `#1085`).

## Verification

- Validated `.github/workflows/ci.yml` YAML parsing.
- `CI=1 pnpm run check` passes locally (typecheck, `oxlint --type-aware
--deny-warnings`, unit tests, mock `sea-trial`).

Co-authored-by: Lookout <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants