Repository navigation
[PR] fix: keep INLINE_ORIGIN model traffic in-process past the #1662 cutoff (pi-web-access 0.46+) - #6847
[PR] fix: keep INLINE_ORIGIN model traffic in-process past the #1662 cutoff (pi-web-access 0.46+)#6847ranxianglei wants to merge 1 commit into
Conversation
…cutoff; recognize pi-web-access 0.46+ shared marker pi-web-access >= 0.46 renamed its install marker from __piWebAccessProxyFetch to __piWebAccessSharedProxyFetch, so bili's #2435 coexistence branch became unreachable and every install fell into the generic #1158 re-chain. The re-armed top then hit the #1662 depth-1 cutoff, which handed bili's own http://billion-context.inline model URLs to the oldest live anchor (the host's native fetch) — a real DNS lookup for the pseudo-origin, i.e. getaddrinfo ENOTFOUND on every model call until the host restarted. Two defects, one repro: (1) ROUTING — the #1662 cutoff must not truncate INLINE_ORIGIN URLs to the host anchor. They are served IN-PROCESS by the inline transport link, reached via the #4527 chainHop legitimate descent. installFetchChain now takes an optional inlineOrigin; when the URL starts with it, the depth-1 branch continues the descent instead of truncating. (2) STABILITY — the chain must propagate the NEW shared-flag marker so pi-web-access's own install guard sees a wrapper already in the chain and does not re-wrap on every proxied web tool call (unbounded (wrapper, bili-link) growth). Each link now exposes a __piWebAccessSharedProxyFetch getter (reflects ds), the guard setter and the depth-1 retention recognize BOTH marker names. pi-inline.ts and native-intercept.ts pass INLINE_ORIGIN. On non-inline lanes (dsh, real loopback origin) the check is a no-op. Regression test: tests/native-intercept-selfheal.test.ts (a 0.46.0-shape wrapper + INLINE_ORIGIN origin — model traffic served in-process, wrapper stays one).
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.10213-pr.6847.808941bThis exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr6847.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 查重: 重复 #6841 — 两个 open PR 都修 #6829(pi-web-access 0.46 共享代理标记 / INLINE_ORIGIN 流量走真 DNS)。#6841(sx4im,2026-11-15 14:35 UTC)先开,本 PR #6847(ranxianglei,15:05 UTC)后开。同一 bug、同一修法,违反「一个 issue 一个修复 PR」。 结构化八问
结论与建议
🔶 需要决策 — 两个 PR 修同一个 #6829,留哪个?
我不关闭任何 PR(关闭权在 owner),也不改源 issue。 |
Closes #6829
What
Every model call fails in 10-120 ms with
getaddrinfo ENOTFOUND billion-context.inlineuntil the host process is restarted, after a single web tool call that uses a proxy (e.g.fetch_content { proxy: "http://127.0.0.1:7890" }).Root cause
pi-web-access >= 0.46 renamed its install marker from
__piWebAccessProxyFetchto__piWebAccessSharedProxyFetch(its install guard now keys on the new name). bili never reads the new name, so the #2435 coexistence branch became unreachable and every install fell into the generic #1158 re-chain. The re-armed top then hit the #1662 depth-1 cutoff, which hands the pending request to the oldest live anchor (the host's native fetch) without checking the URL origin. For bili's ownhttp://billion-context.inline/bili/...model URLs that is a real DNS lookup for a pseudo-origin — a guaranteedENOTFOUND, on every model call, until restart. (The #1662 warn is once-only, so the rest fail silently.)Two defects, one repro:
INLINE_ORIGINURLs to the host anchor. They are served in-process by the inline transport link, reached via the [PR] pi inline mode: add Codex WebSocket channel — local loopback WS bridge + relaxed toggle value constraints | pi inline 模式补上 codex WebSocket 通道:本地回环 WS 桥 + 开关取值放宽 #4527 chainHop legitimate descent.(wrapper, bili-link)growth — the DSH0.1.7-rc.2中billion-context与dsh-codex-subscription的冲突? #1662 churn shape).Fix
installFetchChainnow takes an optionalinlineOrigin. In the depth-1 branch, before the DSH0.1.7-rc.2中billion-context与dsh-codex-subscription的冲突? #1662 anchor truncation, a URL that starts withinlineOrigincontinues the descent (return send(input, init)) instead of being handed to the host anchor. The inline engine is then reached via the [PR] pi inline mode: add Codex WebSocket channel — local loopback WS bridge + relaxed toggle value constraints | pi inline 模式补上 codex WebSocket 通道:本地回环 WS 桥 + 开关取值放宽 #4527 legitimate descent and serves the URL in-process.__piWebAccessSharedProxyFetchgetter (reflectsds), so a re-armed top reads as "pi-web-access wrapper already in chain" → pi-web-access 0.46+ skips the re-wrap → one wrapper, stable.__piWebAccessProxyFetchfor < 0.46,__piWebAccessSharedProxyFetchfor >= 0.46).pi-inline.tsandnative-intercept.tspassINLINE_ORIGIN. On non-inline lanes (dsh, real loopback origin) the check is a no-op — those lanes never produceINLINE_ORIGINURLs.Behavior change (old → new)
ENOTFOUND billion-context.inlineuntil host restart.Tests
tests/native-intercept-selfheal.test.ts: a 0.46.0-shape wrapper (shared-flag guard + marker) +INLINE_ORIGINorigin → asserts the model URL is served in-process by the inline transport (NOT a real DNS lookup at the host anchor) and that a second proxied web call does not re-wrap (one wrapper).native-intercept-selfhealsuite: 26/26 pass. Related suites (native-intercept,pi-inline,launcher-pi-inline,issue1086/1542/1683-chain-*,pi-native,opencode-native,plugin-native-binding): all green.tsc --noEmitclean for the touched files.