Skip to content

fix(pi): align Pi family ranges to ~1.5.2 and enforce manifest/undici consistency - #1110

Merged
stamp-build[bot] merged 1 commit into
mainfrom
agent/lookout/pi-range-152
Nov 21, 2026
Merged

stamp-build[bot] merged 1 commit into
mainfrom
agent/lookout/pi-range-152

Conversation

@stamp-build

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

Copy link
Copy Markdown
Contributor

Lookout (open-agent-runtime) opened via Stamp · View →


Part of #1109 (Step 1 for 0.128.1 patch).

Problem

packages/oar/package.json pinned "undici": "8.12.3" (exact) and peerDependencies "@earendil-works/pi-durable": "~1.5.2" / "@earendil-works/chord": "~1.5.2", while optionalDependencies in packages/oar/package.json and dependencies in packages/cli/package.json declared "@earendil-works/pi-ai": "^1.5.2" and "@earendil-works/pi-coding-agent": "^1.5.2". After Pi 1.6.0 shipped with "undici": "8.12.4", a fresh npm install @botiverse/[email protected] pulled Pi 1.6.0 alongside OAR's [email protected], splitting undici and mixing Pi 1.6.0 with ~1.5.2 durable/chord peers.

Changes

  • Aligned @earendil-works/pi-ai and @earendil-works/pi-coding-agent ranges to ~1.5.2 in both packages/oar/package.json and packages/cli/package.json (and updated the 4 importer specifiers in pnpm-lock.yaml).
  • Added checkPiManifestConsistency() in tests/fixtures/clean-install-pins.ts (invoked by acceptedPiVersions(), so it runs in both pnpm run test via tests/ci-runtime-scripts.test.ts and pnpm run clean-install):
    • Requires all four Pi-family ranges in packages/oar/package.json (pi-ai, pi-coding-agent, pi-durable, chord) and both Pi ranges in packages/cli/package.json (pi-ai, pi-coding-agent) to share one identical minor-locked range (~X.Y.Z or exact X.Y.Z, rejecting caret ^ and any mismatch).
    • Requires packages/oar/package.json dependencies.undici to equal the exact dependencies.undici pinned in @earendil-works/pi-coding-agent/package.json.
  • Added unit tests in tests/ci-runtime-scripts.test.ts covering matching tilde/exact manifests plus mismatched OAR/CLI ranges, caret ranges, and mismatched undici.
  • Updated the published range lines in docs/runtimes/pi.md and packages/oar/README.md from ^1.5.2 to ~1.5.2.

Call-site audit (Pi family ranges and undici pins)

  • packages/oar/package.json: changed optionalDependencies.@earendil-works/pi-ai and optionalDependencies.@earendil-works/pi-coding-agent to ~1.5.2; peerDependencies (pi-durable, chord at ~1.5.2), devDependencies (1.5.2), and dependencies.undici (8.12.3) unchanged (already aligned).
  • packages/cli/package.json: changed dependencies.@earendil-works/pi-ai and dependencies.@earendil-works/pi-coding-agent to ~1.5.2.
  • package.json: unchanged (devDependencies already pin exact 1.5.2 and undici 8.12.3, enforced by checkWorkspacePins).
  • docs/runtimes/pi.md: changed line 11 (optionalDependencies range ^1.5.2 -> ~1.5.2).
  • packages/oar/README.md: changed line 178 (^1.5.2 -> ~1.5.2).
  • docs/runtimes/pi-durable.md: unchanged (already documents ~1.5.2 and 1.5.2).
  • .github/scripts/runtime-sdk-candidate.mjs / runtime-ci.test.mjs: unchanged (rewrites all 4 Pi packages to exact X.Y.Z and undici to Pi's exact pin, which checkPiManifestConsistency explicitly accepts).

Verification

  • pnpm run typecheck: passed.
  • pnpm run lint: passed (0 warnings, 0 errors).
  • pnpm vitest run tests/ci-runtime-scripts.test.ts: 16/16 passed.
  • Fresh npm install of packed botiverse-oar-0.128.0.tgz in an empty temp directory: npm ls undici @earendil-works/pi-coding-agent @earendil-works/pi-ai --all resolved @earendil-works/[email protected], @earendil-works/[email protected], and a single deduped [email protected].
  • pnpm run clean-install -- --mode=published: passed (clean install published ok).

@stamp-build
stamp-build Bot merged commit 78f3e78 into main Nov 21, 2026
25 checks passed
@stamp-build
stamp-build Bot deleted the agent/lookout/pi-range-152 branch November 21, 2026 10:50
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/ZXll.svg"
width="16" height="16" align="absmiddle" alt=""> <b>Lookout</b>
(open-agent-runtime) opened via Stamp · <a
href="https://stamp.build/review?receipt=prc_838eb642dbea739a8494e97ba400a650"><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 -->

Closes #1109 (Step 2, following #1110).

## Summary

- **Pi family and `undici` upgrade:** moved
`@earendil-works/pi-coding-agent`, `@earendil-works/pi-ai`,
`@earendil-works/pi-durable`, and `@earendil-works/chord` to `~1.6.0`
(exact `1.6.0` in workspace/devDependencies, including
`@earendil-works/pi-ai-durable`), moved `undici` to `8.12.4` (matching
`@earendil-works/[email protected]` and carrying its 6 security
advisory fixes from Pi #12200), and updated `pnpm-lock.yaml` and
`pnpm-workspace.yaml` (`minimumReleaseAgeExclude`).
- **Resume tool reset without private side-effect:** Pi `1.6.0` (#11996)
narrowed `AgentSession.setActiveToolsByName()` so
`_pendingToolNames.clear()` runs only when a deactivated tool belonged
to `_restoredToolNames`, breaking the previous activate/deactivate reset
workaround in `packages/oar/src/runtimes/pi/open.ts` when no currently
registered tool appeared in `_restoredToolNames`. On `options.resume !==
undefined`, `openPiAgentSession()` now passes Pi's public
`CreateAgentSessionOptions.noTools: "builtin"` option so Pi skips
`_restoreToolsFromTranscript()` completely (leaving `_pendingToolNames`
and `_restoredToolNames` empty) while keeping every non-excluded
builtin, extension, custom, and MCP tool registered and activating
default-active load-time extensions. OAR then re-applies the current
native defaults (`settingsManager.getDefaultTools() ??
createCodingTools(cwd)`) alongside `session.getActiveToolNames()` before
`session_start`. Because `_pendingToolNames` is never populated,
resuming with no activatable registered tools no longer fails with
`UnsupportedOptionError`.
- **Provider credentials:** added the four new Qwen Token Plan per-plan
API key env vars from `@earendil-works/[email protected]` (`env-api-keys.js`,
Pi #11773) to `packages/oar/src/runtimes/pi/credential-shape.ts`:
  - `QWEN_TOKEN_PLAN_TEAM_API_KEY` (`qwen-token-plan`)
  - `QWEN_TOKEN_PLAN_TEAM_CN_API_KEY` (`qwen-token-plan-cn`)
  - `QWEN_TOKEN_PLAN_INDIVIDUAL_API_KEY` (`qwen-token-plan-individual`)
- `QWEN_TOKEN_PLAN_INDIVIDUAL_CN_API_KEY`
(`qwen-token-plan-individual-cn`)
- **Tests and docs:** updated
`sea-trial/vendor/pi-resume-tools.vendor.test.ts` (all 21 cases,
updating the 2 `no activatable registered tools` cases to assert clean
resume with empty active/callable sets and inactive `late_probe`),
`docs/runtimes/pi.md`, `docs/runtimes/pi-durable.md`,
`packages/oar/README.md`, and `packages/oar/src/runtimes/pi/http.ts`.

## Call-site audit

- `packages/oar/package.json`: updated `dependencies.undici` (`8.12.4`),
`optionalDependencies` (`~1.6.0`), `peerDependencies` (`~1.6.0`), and
`devDependencies` (`1.6.0`).
- `packages/cli/package.json`: updated `dependencies` (`~1.6.0`).
- `package.json`: updated `devDependencies` (`1.6.0` for all 4 Pi
packages + `pi-ai-durable` alias, `8.12.4` for `undici`).
- `pnpm-workspace.yaml`: updated the 10 Pi `minimumReleaseAgeExclude`
entries from `@1.5.2` to `@1.6.0`.
- `packages/oar/src/runtimes/pi/open.ts`: only call site of
`createAgentSessionFromServices()` and `setActiveToolsByName()` in OAR;
switched resume path to public `noTools: "builtin"` +
`setActiveToolsByName([...defaults, ...session.getActiveToolNames()])`
and removed the `UnsupportedOptionError` fallback.
- `packages/oar/src/runtimes/pi/credential-shape.ts`: added the 4 Qwen
Token Plan env vars matching
`@earendil-works/[email protected]/dist/env-api-keys.js`.
- `packages/oar/src/runtimes/pi/http.ts`: updated comment `8.12.3` ->
`8.12.4`.
- `docs/runtimes/pi.md`, `docs/runtimes/pi-durable.md`,
`packages/oar/README.md`: updated current Pi version/range/undici lines
and the resume tool-reset documentation.
- `.github/runtime-versions.json` (`pi-rpc-minimum` at `1.4.0`):
unchanged (intentional minimum-floor pin).
- Historical version notes (1.4/1.5 upgrade warnings and dated baseline
measurements in `docs/runtimes/pi.md`, `docs/runtimes/pi-durable.md`,
`docs/spec/model-request.md`, `docs/spec/runtime-matrix.md`): unchanged
so historical measurements remain accurately dated.

## Verification

- `pnpm install --frozen-lockfile`: passed.
- `CI=1 pnpm run check`: passed (`typecheck`, `lint` 0 warnings / 0
errors, 565 passed / 3 skipped test files, 5432 passed / 110 skipped
unit tests, mock sea-trial 19 passed / 1 skipped).
- `OAR_TEST=pi-aimock pnpm vitest run
sea-trial/vendor/pi-resume-tools.vendor.test.ts`: 21/21 passed on real
`@earendil-works/[email protected]`.
- `OAR_TEST=pi-aimock`: behavior 18 passed / 2 skipped / 0 failed;
vendor 37 files / 134 passed / 0 failed.
- `OAR_TEST=pi-durable-aimock`: behavior 19 passed / 1 skipped / 0
failed; vendor 14 files / 38 passed / 0 failed.
- `OAR_TEST=pi-rpc-aimock`: behavior 18 passed / 2 skipped / 0 failed;
vendor 35 files / 120 passed / 0 failed.
- `pnpm run clean-install -- --mode=published`: passed (fresh packed
install resolves Pi `1.6.0` + single `[email protected]` + Durable `1.6.0` +
bundled OAuth derivation).

Holding merge until `v0.128.1` is tagged.

Co-authored-by: Lookout <[email protected]>
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> (open-agent-runtime) opened via Stamp · <a href="https://stamp.build/review?receipt=prc_2ce5096582e05d834584b22aa9756a40"><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 -->

## OAR 0.128.1

### Fixes

- **Pi moves to 1.6.0 as one family, with undici 8.12.4** (#1110, #1112, issue #1109). OAR 0.128.0 declared `@earendil-works/pi-ai` and `@earendil-works/pi-coding-agent` at `^1.5.2` while `pi-durable` and `chord` were `~1.5.2` and `undici` was pinned to Pi 1.5.2's exact `8.12.3`. Pi 1.6.0 (published 2026-11-20) therefore installed into fresh 0.128.0 hosts untested: a second `undici` copy, a failing resume reset of restored pending tools, and missing Qwen Token Plan credentials.
  - All four Pi packages are now `~1.6.0` in `@botiverse/oar` and `@botiverse/oar-cli`, and `undici` is `8.12.4`, the version Pi 1.6.0 pins, which carries the upstream security fixes. A fresh install has a single `undici` copy.
  - A manifest check fails if the Pi ranges differ, if one is not a tilde or exact version, or if OAR's `undici` differs from the exact `undici` Pi pins.
  - Resume no longer depends on a private side effect of Pi's `setActiveToolsByName`. OAR opens a resumed session with Pi's public `noTools: "builtin"`, which skips restoring the transcript's tool selection, then applies the current default tools. A resume whose registry has no activatable tools now opens with an empty loadout instead of failing with `UnsupportedOptionError("resume")`.
  - Pi credentials gain `QWEN_TOKEN_PLAN_TEAM_API_KEY`, `QWEN_TOKEN_PLAN_TEAM_CN_API_KEY`, `QWEN_TOKEN_PLAN_INDIVIDUAL_API_KEY` and `QWEN_TOKEN_PLAN_INDIVIDUAL_CN_API_KEY`.
  - Hosts that also depend on `@earendil-works/pi-durable` or `chord` need 1.6.x of those peers.

### New

- **DSH reports its session log file** (#1107). From DSH 0.2.2-alpha.2, `Session.nativeSessionFile()` returns the absolute path DSH reports from `sessionPersistence.stat(id).location.path` (typically `session.v4.jsonl.zstd`), `null` before the log is on disk, and the last known path after disposal. An explicit call drains DSH's 200 ms write batch with DSH's own `sessions.flush` before reading, so a just-finished turn is on disk. `sessionCapabilities` declares `nativeSessionFile: true` from 0.2.2-alpha.2, `false` below it (0.2.1-rc.5's `stat` has no location), and leaves it absent when the version is unreadable.

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

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