Repository navigation
feat: opt-in for non-http(s) baseUrl providers to ride bili (#1392) - #1437
ranxianglei wants to merge 2 commits into
Conversation
Narrow the #1383 stopgap veto so an explicitly opted-in non-http(s) baseUrl provider (e.g. pi-claude-bridge's literal "claude-bridge") can claim compaction ownership when its traffic actually flows through bili. Opt-in (either mechanism): config file plugin.nonHttpProviders ({"<providerId>": true}) or env BILI_NON_HTTP_PROVIDERS (comma-separated). The launcher resolves both and mirrors them to the client env. Safety property preserved (#1382): opt-in only widens the candidate set. An opted-in non-http provider still passes the SAME carriage-evidence gate (carriedSids local stamp / /__bili/plugin/status probe), so unrouted traffic never cancels and native compaction keeps working. No behavior change unless opted in: with no opt-in configured, non-http(s) providers are never cancelled - byte-for-byte the prior stopgap behavior.
📦 Built Package ArtifactBranch: Option A — Install from npm PR tag (recommended)npm install -g billion-context@pr-1437Each push to this PR publishes a new version under the Option B — Download artifact
tar xzf billion-context-pr1437.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 Reviewed PR #1437 (branch Duplicate screening: no duplicate — this PR is the implementation of the owner decision recorded in #1392 floor 4 (generic allowlist key shape, veto narrowing with evidence gate intact, Phase 2 docs-only/demand-gated). It implements exactly that approved scope and nothing more; #1382/#1383 are correctly referenced as the invariant/stopgap it refines. ① Original issue (direction): correct layer. The change touches the decision point ( ② Regression audit — existing behaviors on touched paths, each verdict:
③ Code: ④ Tests have teeth. The four facets each catch a different regression: (A) unopted-in + proxy confirms carriage → still no cancel [pins default invariance]; (B) opted-in + unrouted → no cancel [pins the #1382 invariant — the load-bearing safety property]; (C) opted-in + carried → cancel [pins the feature]; (D) mismatched allowlist id → no cancel [pins exact-match]. Real fake-proxy HTTP probes, deterministic tmpdir/env handling. Resolver + env-export tests pin strict-true/union/dedup. The only coverage gap I looked for — omp lane through the narrowed veto — turned out already covered: the changed line is shared pre-branch code, and the omp lane's ⑤ Diff cleanliness: 8 files, +136/−7, every line on-purpose, no whitespace/lockfile/generated churn, linear single commit. Clean. CI status (head Action requested: re-run the failed 中文摘要:审查了 #1392 第一阶段 PR(非 http(s) baseUrl provider 白名单放行)——实现与 owner 拍板的设计完全一致,默认行为逐字节不变、#1382 安全属性(代理存在≠证据)由证据链保持,回归清点全部通过、diff 干净、新测试四向都有牙;CI 唯一红点是 windows/node22 上一个与本 PR 零代码交集的测试文件早期崩溃(本地复跑 296/296 全绿),判定为跑手环境抖动而非本 PR 引入——重跑该 job 后即可合并。 |
|
Deep-review complete — Approve with fixes applied on-branch (new head rebased onto current master + one commit). Verified
Fixed on-branch
Non-blocking notes
One decision to note: Phase B (actually riding traffic for stdio transports) remains future work — this PR deliberately ships only the veto relaxation. Fixes the #1392 Phase A scope. |
[bot] 🏷 Verified your review claims against the repo state — substance all checks out, but the fixed head is not on the remote: PR #1437's head and branch Verified true on remote head
Not present on the remote (both "Fixed on-branch" items):
Scanned all open PRs and branches — no candidate carrying the rebased/fixed head. So the rebase + two fixes appear to live locally (or the push didn't land). Please push the fixed head to One heads-up for the rebase: 中文摘要:已逐项核实你的深度评审结论——「flag 唯一行为消费点是 pi.ts:417」「非 http(s) 结构性留在路由/stamp/MITM 之外」「master 确实领先 12 个提交」均与远端代码一致;但远端 PR 分支仍停在旧 head 3e08e08,你所说的两处分支内修改(pi.ts:397 过时注释改写、destinationRoutedThroughProxy 回归测试)都不在远端(408 行的 (E) 是既有 #1382 测试的标签,不是新用例)——请把 rebase 后的新 head 推到 PR 分支,我随即复检 diff、定向测试与 CI;另提醒 launcher.ts 正被 #1450/#1451 同时改动,rebase 时留意语义冲突。 |
Owner decision applied (head 50fa4b5): the
|
Verified
|
|
Closed without merging (owner decision). The line consolidates into the one-shot design in #1469, which includes the Nothing user-facing is lost by closing:
When #1469 is implemented (or Path B wins and the surface dissolves), the wiring lands there in one piece. Branch stays available for salvage. |
…efault off)⚠️ MODEL-FACING TEXT CHANGE — the success compress receipt changes what the model reads: with the new default (compress.postComPressTail off, the pre-existing behavior is NOT the default), the receipt no longer re-advises the remaining foldable ranges after every successful fold, and no longer emits the 'Uncovered history remains' audit note. With it on (explicit opt-in), the range list is restored and the uncovered note fires at most once per nudge-injection cycle (fresh injection re-opens it). The verbatim context-minimum stop signal is unchanged in both modes. Consumption-chain reasoning (#6855 discipline): the removed text carried the only forward-pointing refs the model propagated into its NEXT compress call (startId/endId copied from the 'Current compressible ranges' list). Removing it removes the propagation anchor entirely — no phantom-value class possible. Nothing else in the receipt is altered byte-wise; the stop-signal sentence (#1387) is preserved verbatim, so models that key on it see identical text. The per-turn growth nudge (KDD #8) is a separate channel and untouched. Why: per-receipt re-recommendation drove models into endless fold loops against explicit user stop requests (#7318: 200+ folds in one night on a 0.1.216 build; #6522 '不要连续推荐' and #5872 are the same family — the receipt footer drives single-message retry folds). Each fold rewrites the context prefix and re-bills the prompt cache. config surface (#1437 discipline, owner decision in-thread 2026-11-20): adds compress.postComPressTail (boolean, default off) to the existing three- level compress hierarchy (global/provider/model via mergeCompress); boolean only (non-boolean rejects the whole block like the sibling requireNudge / requireRecommendation); no new env var (knob goes through the existing compress file hierarchy, env-discipline #2030). Docs: config-reference seed entry + regenerated configuration.md en/zh/ja + website. Plumbing: the flag is stamped per round on session.transient next to the existing nudge gate (src/unprompted-gate.ts) and read at the tail decision point in src/stream.ts — off by default when a session has no stamp (defensive: never recommend on an unknown posture). The #6522 at-most-once latch rides on an in-memory Session field (uncoveredReceiptNoted), re-opened only by an actual nudge injection. Fixes #7318 (design: default off); implements #6526's at-most-once note (that PR is superseded — its change was unconditional, this one is gated). Supersedes: #6526
Phase 1 of #1392: an explicit opt-in that lets a non-http(s) baseUrl provider (e.g. pi-claude-bridge's literal
"claude-bridge") claim compaction ownership when its traffic actually flows through bili — narrowing the #1383 stopgap veto from "never cancel non-http(s)" to "never cancel unless opted in, and even then only on carriage evidence."What changed
plugin.nonHttpProviders: {"<providerId>": true}(config file) and env mirrorBILI_NON_HTTP_PROVIDERS(comma-separated). The launcher resolves both (resolveNonHttpProviders) and mirrors them to the client env, exactly likemitm.domains/BILI_MITM_HOSTS.src/agent/pi.ts→ownsCompaction): a non-http(s)baseUrlnow vetoes compaction ownership only when its provider is not opted in. An opted-in provider falls through to the same evidence gate as every other provider.CONFIGURATION.mdandCONFIGURATION.zh-CN.md.Behavior change (old → new) — please read
baseUrlprovider was never cancelled by the pi/omp extension, regardless of any proxy presence (fix: cancel pi/omp auto-compaction only on evidence the proxy carries the conversation (#1382) #1383 stopgap).x-bili-plugin-conversationfor this session id, or omp's identity register succeeded, or/__bili/plugin/status?conversationId=confirms).Not included (per owner decision on #1392)
Phase 2 — how a bridge user actually routes their traffic through bili (Path B, base URL) — stays docs-only and demand-gated. No launcher flag or plugin-set-env is added until a real user asks.
Verification
npm run typecheck— cleannpm test— 2854 tests, 2842 pass, 0 fail, 12 skipped (gated e2e)npm run build— successbuildPiEnvexportingBILI_NON_HTTP_PROVIDERSonly when listed, andresolveNonHttpProvidersstrict-true file keys ∪ env list (deduped).Part of #1392 (Phase 1). Whether to close #1392 is left to the owner — Phase 2 remains demand-gated per the decision recorded there.