Repository navigation
fix(#1795): route preset BILLION_CONTEXT_PROXY to attach in the pi and omp native lanes - #1796
Conversation
…tive lane The pi native plugin treated a preset BILLION_CONTEXT_PROXY as an opt-out (nativeBootstrapGate returns false) -> no fetch intercept installed -> all model traffic direct and uncompressed. Port the #886/#983 plan-based attach mode (planNativePi + verifyAttachAndRecover) so a preset proxy attaches to it and routes through it, falling back to spawn only when dead.
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.1833-pr.1796.fee7655This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr1796.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 On it — this is a completed agent PR (
I'll post the full structured review (七问) once CI settles and I've finished reading the diff against the opencode/dsh reference implementations. |
[bot] 🏷 Review 完成(已拉取分支逐行核对代码、本地复跑、CI 日志取证)。结论:可合并 —— CI 仅有的两处红是 pre-existing 的 dsh Windows flake,与本 PR 无关(已单独立项 ranxianglei/billion-context#1797)。 结构化七问
验证证据
判定可合并,建议直接 merge。 合并前无需任何改动;Windows matrix 的红由 ranxianglei/billion-context#1797(来源标记:分析本 PR 时发现)跟踪,不阻塞本 PR。 |
…ative lane omp had the same pseudo-attach hole as pi (#1795): a preset BILLION_CONTEXT_PROXY closed nativeBootstrapGate, so the fetch intercept never installed — model traffic went direct and uncompressed while tools still found the proxy through the env, and every tool forward 404'd. ompTrafficRidesBili even treated the preset as "riding bili" for the #1774 watchdog, hiding the hole. Port the #886/#983 posture to the omp lane (mirrors pi PR #1796 and opencode/dsh): - planNativeOmp: kill-switch > /bili/ rewrite launch > attach (BILLION_CONTEXT_ATTACH ?? BILLION_CONTEXT_PROXY) > spawn; garbage/blank presets fall back to spawn, never dead-off - armNativeOmp: attach mode arms even under NODE_TEST_CONTEXT — env written synchronously (pi.ts readers align), runtime death re-probed via verifyAttachAndRecover, #1365 routed-origin rebind - verifyAttachAndRecover: healthy target stays attached (no migration); DEAD + routed evidence waits for the pinned origin (no second instance that would 404 tools); DEAD with no evidence past BILI_ATTACH_EVIDENCE_GRACE_MS unfreezes the env and falls back to a self-spawned proxy - installNativeFetchIntercept now installs whenever mode !== off — the actual hole ompTrafficRidesBili keeps its pinned semantics (a preset proxy means a launcher owns routing, regardless of the native opt-out). Tests: plan semantics incl. the #1795 regression pin, dead-target fallback spawn replacing the env origin, healthy-target stay-put against a real manifest server.
Closes #1795.
Two commits, two lanes, one posture (#886/#983 mechanism):
06dd0b64pi lane —planNativePi/armNativePi/verifyAttachAndRecover39aa7372omp lane (from fix(#1795): route preset BILLION_CONTEXT_PROXY to attach in the omp native lane #1845) — same skeleton:planNativeOmp/armNativeOmp/verifyAttachAndRecoverThe hole (#1795)
A preset
BILLION_CONTEXT_PROXY(outerbiliMITM launch, or user-exported proxy) closednativeBootstrapGate, so the fetch intercept never installed: model traffic went direct and uncompressed, while the shared plugin still found the proxy through the env — every tool forward 404'd against a proxy that never saw the session. omp had the same hole, withompTrafficRidesBilitreating the preset as "riding bili" for the #1774 watchdog — hiding it.The fix (both lanes)
planNative*: kill-switch (BILLION_CONTEXT_PLUGIN=0/ lane var) >/bili/launch (BILI_PROVIDER_REWRITES) > attach (BILLION_CONTEXT_ATTACH??BILLION_CONTEXT_PROXY) > spawn. Garbage/blank presets fall back to spawn (self-managed), never dead-off.NODE_TEST_CONTEXT; env written synchronously so readers align immediately; runtime death re-probed; bug: dsh-native — attach 目标瞬时不可达 → 回退 spawn 第二实例:routed baseURL 下工具/模型通道必然脑裂(工具 404 → preflight 502 → 会话不可自愈) #1365 late routed-evidence rebind (only converges on a reachable target).verifyAttachAndRecover: healthy target stays attached (no migration); DEAD + routed evidence → wait for the pinned origin (no second instance that would 404 tools); DEAD with no evidence pastBILI_ATTACH_EVIDENCE_GRACE_MS→ unfreeze the env, fall back to a self-spawned proxy.installNativeFetchInterceptinstalls whenevermode !== "off"— the actual hole.ompTrafficRidesBilikeeps its pinned semantics — unchanged.Tests
BILLION_CONTEXT_ATTACHwins, dead/healthy wiring against a real HTTP server