Skip to content

docs(pi): the pi-ai split comes from undici - #388

Merged
xxchan merged 1 commit into
mainfrom
docs/pi-single-copy-undici
Oct 13, 2026
Merged

xxchan merged 1 commit into
mainfrom
docs/pi-single-copy-undici

Conversation

@xxchan

@xxchan xxchan commented Oct 13, 2026

Copy link
Copy Markdown
Member

Corrects #387 for #386. Raft's daemon fix confirmed that the two pi-ai copies differ by how undici resolves, an optional peer of pi-ai's openai dependency: the daemon depended on undici 7, while pi-coding-agent (and OAR) pin 8.10.2. earendil-works/pi#10458 reports the same split from discord.js pinning undici 6. My earlier text blamed the AWS credential-provider group. The page now names undici first, and gives the host-side fix: pin undici and the other openai peers to pi-coding-agent's versions, check for a single @earendil-works+pi-ai@ variant, and keep a build check that derives auth for a dummy OAuth credential through pi-coding-agent's own ModelRuntime. Docs only, so no CI and no release.

🤖 Generated with Claude Code

@xxchan
xxchan merged commit 53d0e55 into main Oct 13, 2026
@xxchan
xxchan deleted the docs/pi-single-copy-undici branch October 13, 2026 12:10
@xxchan xxchan mentioned this pull request Oct 13, 2026
xxchan added a commit that referenced this pull request Oct 13, 2026
Release OAR and CLI 0.62.1. This PR changes only the two package version
fields.

**Fixed: pi's proxy plane connects the way pi does** (#389)
- When pi's settings or the environment name a proxy (or set a
non-default idle timeout), OAR installs an undici `EnvHttpProxyAgent` as
the process-global dispatcher for an embedded pi.
- It now carries the connection options pi's own dispatcher sets
(pi-coding-agent 1.2.0 `core/http-dispatcher.js`):
  - `allowH2: false`;
  - `proxyTunnel: true`;
  - a 2 s address-family attempt timeout.
- Before this, undici 8 could negotiate HTTP/2 and send http targets to
a proxy without a CONNECT tunnel. An embedded pi connected differently
from `pi` itself, and so did every global `fetch` in the host, because
the dispatcher is process-global.
- A test reads pi's own file, so a change in pi shows up.
- A dispatcher the host set itself is still never replaced.

**Docs** (#387, #388)
- `docs/runtimes/pi.md` says a bundled host must keep one copy of pi-ai,
and why: an `undici` that differs from pi-coding-agent's pin splits it.
It also says how to check a bundle (#386).

**Behavior changes**
- Only when the plane is installed: HTTP/1.1 instead of possibly HTTP/2,
and CONNECT tunnels for http targets behind a proxy, as `pi` does.

Validation: #389 passed all 17 checks on its final head, and its merged
tree equals its CI tree. Typecheck, lint, the unit suite (1782 tests)
and the pi-aimock vendor suite (38) pass. The proxy tests now go through
a stand-in that answers CONNECT. After this PR passes CI and merges, tag
its exact squash commit as `v0.62.1` 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 20, 2026
…ut and requestsForTurn (#1090)

<!-- 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_f6c76621d2478e1dae1e46c8e9cfefc0"><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

Fix the Windows `behavior (windows-latest, dsh-aimock)` failure in
`sea-trial/vendor/configured-append.vendor.test.ts` (blocking `0.126.0`
on `main` since `#1057`, tracked in `#core:#388`).

## Root Cause (test-helper bug, not an OAR bug)

- In failed Windows job
[44784700637/136456409926](https://github.com/botiverse/oar/actions/runs/44784700637/job/136456409926),
the two `mcp-client` stderr lines came from
`sea-trial/vendor/dsh-mcp.vendor.test.ts` (tests 2 and 3 intentionally
trigger those native errors; all 3/3 passed).
- In `configured-append.vendor.test.ts`, the real DSH turn succeeded
(`runTurn` returned `completed`) and sent the user prompt. On Windows,
DSH appends two synthetic trailing `role: "user"` messages after the
user input: `"Current runtime context..."` and a standalone
`"<system-reminder>\nA skill is a reusable set of task-specific
instructions...\n</system-reminder>"` (bundled `skill-catalog`).
- `dsh-provider.ts` (`lastInput`) already skipped both, while
`resumed-prompts.ts` (`requestsForTurn`) had its own copy that skipped
only `"Current runtime context."`, so it stopped on the trailing
`<system-reminder>` instead of matching `"Check these instructions"`.

## Changes

- **`sea-trial/vendor/support/dsh-provider.ts`**: Extracted one shared
predicate `isDshSyntheticContextMessage(content)` matching `"Current
runtime context."` or a single standalone
`<system-reminder>...</system-reminder>` block (string or all-synthetic
text-part array), never matching combined reminder-plus-prompt envelopes
like Qoder's `<system-reminder>...\n\n<prompt>`. Wired `lastInput` to
it.
- **`sea-trial/vendor/support/resumed-prompts.ts`**: Replaced the
duplicated inline check in `requestsForTurn` with
`isDshSyntheticContextMessage(message.content)`.
- **`tests/dsh/provider-fixture.test.ts`**: Verified both `lastInput`
and `requestsForTurn` against the exact Windows DSH sequence, Qoder's
combined `<system-reminder>...\n\n<prompt>`, and reminder-sandwiched
user prompts.

## Call-site audit

Grepped all occurrences of `Current runtime context` and
`<system-reminder>` across `sea-trial/`, `tests/`, and
`packages/oar/src/runtimes/dsh/`:
- `sea-trial/vendor/support/dsh-provider.ts` (`lastInput`): updated to
shared `isDshSyntheticContextMessage`.
- `sea-trial/vendor/support/resumed-prompts.ts` (`requestsForTurn`):
updated to shared `isDshSyntheticContextMessage`.
- `sea-trial/vendor/support/echo-mcp.ts` (Kimi `<system-reminder>`
comment only) and `tests/qwen/projection.test.ts` (Qwen projection
test): unrelated, unchanged.

## Verification

- `CI=1 pnpm run check` passes locally (typecheck, `oxlint --type-aware
--deny-warnings`, unit tests including
`tests/dsh/provider-fixture.test.ts` and `tests/ci-select.test.ts`, mock
`sea-trial`).
- Needs a `workflow_dispatch` run of `ci.yml` on branch
`agent/lookout/dsh-windows-configured-append` to verify `behavior
(windows-latest, dsh-aimock)` on Windows (alongside the PR's Linux
`dsh-aimock` job).

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.

1 participant