Repository navigation
fix(pi): the proxy plane connects the way pi does - #389
Merged
Merged
Conversation
…tunnels) OAR's pi proxy plane built undici 8's EnvHttpProxyAgent without the options pi's own dispatcher sets (pi-coding-agent 1.2.0 core/http-dispatcher.js): allowH2: false, proxyTunnel: true and a 2 s address-family attempt timeout. undici 8 otherwise negotiates HTTP/2 and sends http targets to a proxy without a CONNECT tunnel, so an embedded pi connected differently from pi itself, and, the plane being the global dispatcher, so did every global fetch in the host. Found while reviewing Raft's daemon move to undici 8 (#386), where the host keeps HTTP/1.1. piDispatcherOptions builds the options; a test reads pi's own file, so a change there fails it. The proxy tests' stand-in now answers CONNECT. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Merged
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]>
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.
Bug. When pi's settings or the environment name a proxy, or set a non-default idle timeout, OAR's pi proxy plane installs an undici 8
EnvHttpProxyAgentas the process-global dispatcher. It left out the connection options pi's own dispatcher sets (pi-coding-agent 1.2.0core/http-dispatcher.js):allowH2: false: undici 8 otherwise negotiates HTTP/2.proxyTunnel: true: undici 8.7+ otherwise sends http targets to a proxy without a CONNECT tunnel.connect.autoSelectFamilyAttemptTimeout: 2000.So an embedded pi connected differently from
piitself. And because the plane is the global dispatcher, so did every globalfetchin the host. Found while reviewing Raft's daemon move from undici 7 to 8 for #386, where Raft deliberately keeps HTTP/1.1.Fix.
piDispatcherOptions(plan)builds the agent's options with pi's three settings plus the plan.docs/runtimes/pi.mdreverses its earlier "allowH2/connect tuning not taken" and says why.undici.install()and pi's per-client error listener stay out, as before.Tests.
http-dispatcher.js, so a change in pi fails it.Behavior change. Only when the plane is installed: HTTP/1.1 instead of possibly HTTP/2, and CONNECT tunnels for http targets behind a proxy, both as
pidoes.🤖 Generated with Claude Code