Skip to content

feat(pi): move Pi SDK packages to optionalDependencies in @botiverse/oar - #1098

Merged
stamp-build[bot] merged 2 commits into
mainfrom
agent/lookout/pi-optional-peer
Nov 21, 2026
Merged

stamp-build[bot] merged 2 commits into
mainfrom
agent/lookout/pi-optional-peer

Conversation

@stamp-build

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

Copy link
Copy Markdown
Contributor

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


Summary

Makes @earendil-works/pi-ai and @earendil-works/pi-coding-agent optional in @botiverse/oar via optionalDependencies so hosts that want a slim install can opt out with npm install --omit=optional (pnpm install --no-optional), while keeping Pi installed by default for all existing hosts and as direct dependencies of @botiverse/oar-cli.

  • Manifests and scripts:
    • Moved @earendil-works/pi-ai (^1.5.2) and @earendil-works/pi-coding-agent (^1.5.2) from dependencies to optionalDependencies in packages/oar/package.json.
    • Added both as direct dependencies in packages/cli/package.json so @botiverse/oar-cli always ships Pi regardless of how its host installs optional dependencies.
    • Updated pnpm-lock.yaml, .github/scripts/runtime-sdk-candidate.mjs (include optionalDependencies when rewriting SDK candidate manifests), .github/scripts/runtime-ci.test.mjs, and tests/fixtures/clean-install-pins.ts (checkPublishedRanges includes optionalDependencies).
  • Installation probes (packages/oar/src/runtimes/pi/installation.ts):
    • Every Pi mode (in-process SDK, default RPC, and explicit-command RPC) checks both @earendil-works/pi-coding-agent and @earendil-works/pi-ai and reports { kind: "unsupported", code: "dependency_missing", reason } (never not_found) naming the missing package(s).
    • Explicit-command RPC explains in its refusal reason that the host process still requires both packages for session lookup, project-package checks, and context-overflow detection even when pi itself runs from command.
  • Clean public declarations without Pi (packages/oar/src/runtimes/pi/auth.ts, options.ts, facade-runtime.ts, catalog.ts):
    • Moved PiModelRuntimePaths to options.ts and replaced exported ModelRuntime-derived parameter types on toLoginEvent/toLoginPrompt with structural slices (toPiInteraction still checks assignability against ModelRuntime["login"] at build time), so dist/runtimes/pi/auth.d.ts emits zero @earendil-works/pi-coding-agent imports and TypeScript hosts with skipLibCheck: false compile cleanly under --omit=optional.
  • Clean-install CI (tests/clean-install.ts, tests/fixtures/pi-clean-install.ts):
    • Added a slim-host (npm install --omit=optional) phase verifying no @earendil-works/* packages are installed, every default runtime probes without throwing, Pi SDK and Pi RPC both report unsupported/dependency_missing, tsc (skipLibCheck: false) passes on all public entries, @botiverse/oar/pi-durable works once its peers (pi-durable, chord, pi-ai, pi-ai-durable) are added without pi-coding-agent, and @botiverse/oar-cli installed with --omit=optional still lists both Cursor and Pi models.
    • Kept the default-host (npm install) checks verifying Pi installs automatically with one shared pi-ai copy.
  • Docs (docs/runtimes/pi.md, docs/spec/install.md, packages/oar/README.md):
    • Documented optionalDependencies, --omit=optional / --no-optional (and that those flags drop all optional dependencies in the tree, not only Pi's), dependency_missing across all Pi modes, why explicit-command RPC needs both host packages, and the verified finding that Pi's extension loader serves its own bundled @earendil-works/pi-coding-agent and @earendil-works/pi-ai to rpc/extension.ts (dist/core/extensions/loader.js:66, dist/core/extensions/virtual-modules.js:32).

Release notes (non-breaking opt-out)

  • @earendil-works/pi-ai and @earendil-works/pi-coding-agent are now declared under optionalDependencies in @botiverse/oar (and remain direct dependencies of @botiverse/oar-cli). Existing hosts keep Pi installed by default with no behavior change; hosts that want a slim install without Pi can install with npm install --omit=optional (pnpm install --no-optional). Note that --omit=optional omits every optional dependency in the dependency tree, not only Pi's. Without Pi installed, every Pi mode reports { kind: "unsupported", code: "dependency_missing" }.

Call-site audit

  • packages/oar/package.json: changed (dependencies -> optionalDependencies).
  • packages/cli/package.json: changed (added both as direct dependencies).
  • packages/oar/src/runtimes/pi/installation.ts: changed (all Pi modes check both packages and report unsupported/dependency_missing; explicit-command reason explains why).
  • packages/oar/src/runtimes/pi/auth.ts, options.ts, facade-runtime.ts, catalog.ts: changed (removed @earendil-works/pi-coding-agent type leak from emitted auth.d.ts).
  • packages/oar/src/runtimes/pi/rpc/extension.ts: unchanged (verified live with pi --mode rpc --no-session -e in /tmp outside node_modules and in Pi's loader.js:66 / virtual-modules.js:32 that Pi's extension loader aliases both packages to Pi's own bundle).
  • packages/oar/src/runtimes/pi/rpc/{open,session,readers,launch,version}.ts & packages/oar/src/runtimes/pi/{open,session,list-models,inventory,project,mcp,theme,static-modules}.ts: unchanged (all already lazy dynamic import()s or type-only imports; host-side Pi RPC stays on Option A per #core:#391).
  • packages/oar/src/runtimes/pi-durable/{index,options}.ts: unchanged (static @earendil-works/pi-ai/models imports verified to load and run cleanly in clean-install when a slim host adds pi-durable + pi-ai without pi-coding-agent).
  • .github/scripts/runtime-sdk-candidate.mjs & tests/fixtures/clean-install-pins.ts: changed (added optionalDependencies alongside dependencies and peerDependencies).

Verification

  • pnpm install --frozen-lockfile: passed.
  • pnpm run clean-install -- --mode=gate: passed (both slim --omit=optional host and default host, plus pi-durable, @cursor/sdk, and --omit=optional CLI install).
  • node --test .github/scripts/runtime-ci.test.mjs: 38 passed, 0 failed.
  • CI=1 pnpm run check: passed locally (full typecheck, oxlint --type-aware --deny-warnings, vitest suite, and mock sea-trial).
  • Live Pi extension-loader probe: ran pi --mode rpc --no-session -e /tmp/.../ext.mjs outside any node_modules importing all 6 symbols used by rpc/extension.ts; exited 0 with all symbols resolved.

@stamp-build
stamp-build Bot merged commit 0e6abde into main Nov 21, 2026
25 checks passed
@stamp-build
stamp-build Bot deleted the agent/lookout/pi-optional-peer branch November 21, 2026 02:27
@stamp-build stamp-build Bot mentioned this pull request Nov 21, 2026
stamp-build Bot added a commit that referenced this pull request Nov 21, 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>opened from existing branch <code>agent/cindy/release-0.127.0</code> @ <code>b15d311f509d</code>, which the agent did not push</sup><br><sup><a href="https://stamp.build/review?receipt=prc_73c76ce0b5c49eb86a194fb0d706127f"><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.127.0

### Behavior changes hosts should know

- **Pi is an optional dependency of `@botiverse/oar`** (#1098). A default install still includes `@earendil-works/pi-ai` and `@earendil-works/pi-coding-agent`, so nothing changes unless you opt out. `npm install --omit=optional` (or `pnpm install --no-optional`) leaves both out; note that these flags drop every optional dependency in the tree, not only Pi's. Pi stays in `defaultRuntimes` either way. `@botiverse/oar-cli` keeps both packages as direct dependencies.
  - Without the packages, `installation()` reports `unsupported` with code `dependency_missing` in a normal Node host for every Pi mode. In-process Pi SDK used to report `not_found` here, so hosts that branch on `not_found` should handle the new code.
  - Pi RPC with an explicit `command` now also checks the host packages, because the host process needs them for session lookup, project-package checks and context-overflow detection. Its command check runs first, so a missing or too-old `pi` still reports `not_found` or `version_unsupported`. Default Pi RPC in a single-file or Electron host still reports `unsupported_host` first.
  - The declarations of every entry point except `@botiverse/oar/pi-durable` no longer import Pi, so TypeScript hosts with `skipLibCheck: false` compile without it. `pi-durable` still needs `@earendil-works/pi-ai`.
- **Ending a process through stdin EOF takes one kill grace, not two** (#1097). When OAR closes stdin to end an idle Claude or Codex session, Codex's login process after a completed login, or a Qoder or Qwen session or model list, and the process is still alive after the kill grace (10 s by default, `OAR_KILL_GRACE_MS`), OAR now force-ends the process tree at once. Before, it sent SIGTERM and waited a second grace, so this could take up to 20 s. Processes that already ended after one grace are unchanged: Claude and Codex model, inventory and account queries, DSH, Factory and Pi RPC. A session with an active turn is still stopped at once.
- **Explicit context overflow is `input_too_large` on more paths** (#1093). The generic error-text rules now check for an explicit overflow first ("This model's maximum context length is N tokens. However, ...", "Your input exceeds the context window of this model", "Prompt is too long", with an optional `Internal error: ` prefix) and keep the original reason. A specific native category or provider code still takes precedence.
  - OpenCode 2.2.7 and 2.3.2 report an overflow and other invalid requests with the same JSON-RPC code (`-32603`) and native name (`provider.invalid-request`); an explicit overflow there is now `input_too_large`. On OpenCode, a rejected summary request still reports `kind: "failed"` with `failure: "provider"`.
  - The same rules cover the ACP fallback (every ACP runtime), Cursor, Factory, Grok, Pi in-process, Pi Durable and Morph, Claude's generic invalid-request fallback, and `invalid_request_error` provider bodies on Pi and Codex. An Anthropic-style "prompt is too long" body that used to be `invalid_request` is now `input_too_large`.
  - The runtime matrix gains "Recovery after automatic compaction fails": after a measured failed automatic compaction, Claude, Pi, DSH, OpenCode v2 and threshold-triggered Codex returned to `idle` and completed the next prompt on the same session. The failed turn stays readable from `turn_ended.outcome` and `status().value.lastTurnOutcome`.

### New

- **Codex MCP startup per server** (#1092). From Codex 0.169.0 (executable installs, stable versions), `sessionCapabilities(installation).mcpStartup` is `{ kind: "per_server", firstModelRequest: "may_start_pending" }`: Codex can send the first model request while an MCP server is still listing tools, and that tool is then missing from turn one. A missing declaration means unknown.
  - Native startup reports that carry a thread ID become `mcp_server_startup` events with the server name and `pending`, `ready`, `failed` or `cancelled` (native `starting` is `pending`). This is a new `RuntimeEventBody` variant, so code that switches exhaustively on event kinds needs a case for it.
  - `mcpStartupOf(records, sessionId)` (from `@botiverse/oar` and `@botiverse/oar/observe`, with type `McpStartupStatus`) returns the latest state per server for the root agent.
  - A host that needs a server on turn one can subscribe with `session.events(observer, { cursor: { sessionId: session.id, afterSeq: -1 } })`, which replays startup reports, and wait for its `ready` before the first input. A server that never reports stays unknown, so set your own time limit.

### Tests and CI

- The release workflow's dispatch, tag-push and `release_only` paths all require the commit to be the merge commit of exactly one merged `chore: release vX.Y.Z` pull request (#1095, #1096). `ci.yml` cancels superseded runs per ref (#1091). Tests check a fixture process's identity before cleanup (#1089), and DSH's `lastInput` and `requestsForTurn` share one trailing synthetic-context check (#1090).

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

Co-authored-by: Cindy <[email protected]>
Co-authored-by: xxchan <[email protected]>
stamp-build Bot added a commit that referenced this pull request Nov 23, 2026
…nd CI (#1140)

<!-- 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>
(open-agent-runtime) opened via Stamp · <a
href="https://stamp.build/review?receipt=prc_78c75ec72882c291476828337858f0d7"><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
→</a></sup>

---
<!-- /stamp:review:v1 -->

Weekly maintenance pass (2026-11-23): fix factual doc/CI drift, Kimi KAP
details, and broken test links across `docs/development.md` and
`docs/runtimes/*`.

- `docs/development.md`: document `OAR_COMMUNITY_TESTS=1` / `pnpm run
check` scoping for `tests/community/**`, update `ci-select.mjs` inert
paths and `shared/acp/` reachability, align `clean-install` description
with Pi `optionalDependencies` (`#1098`), and document community
runtimes under `packages/oar/src/community/<id>/`.
- `docs/runtimes/kimi.md`: address `#core:#408` non-blocking wording
note (`steer()` rejects `busy` only on unresolved manual compaction, not
active root turns); clarify `sessionCapabilities(installation)`
differences between `>= 2.7.2-botiverse.1`, `>= 2.7.3`, and `<=
2.7.2-botiverse.0` plus KAP `launchArgs`/`additionalDirectories`; update
CI matrix refs after `#1100`; replace deleted
`tests/acp/acp-vendor-snapshot.test.ts` link.
- `docs/runtimes/grok.md`, `antigravity.md`, `qoder.md`, `opencode.md`,
`codex.md`, `install.md`: align CI workflow/matrix descriptions with
`#1100` (`ci.yml` vs `platform-matrix.yml` / `runtime-latest.yml`) and
remove broken `tests/acp/acp-vendor-snapshot.test.ts` link in `grok.md`.
- `docs/runtimes/README.md`, `steer-delivery.md`, `resume-cwd.md`,
`inventory.md`, `devin.md`, `pi.md`, `update.md`: add Kimi KAP and
Cybion mappings, clarify Devin's verified live turn, clarify Pi SDK
`optionalDependencies` and `PI_RPC_MINIMUM_VERSION` explicit command
check, and update `inventory.md` baseline vs shipped `skills` readers.

Verification: `python3 tools/check-md-links.py projects/oar` (0 broken
links in edited files), 0 em/en dashes in diff, verified against code
and `.github/workflows/`.

---------

Co-authored-by: Cindy <[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