Repository navigation
fix(#1812): fold integrity — net-shrink gate, post-rebuild meter anchor, summary budget, image-arb compression (A/B/D/E, review pending) - #1818
Conversation
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.2382-pr.1818.db13b28This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr1818.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 PR #1818 review — 可合并(mergeable)。逐项核验如下(审核姿态:先审原 issue,再回归清点,再代码/测试/diff)。 验证过的证据(不是只读 diff)
结构化七问
行为变更披露(有意,已按政策在 PR 正文列出旧→新):① vLLM 方言 400:恒透传 → 识别+arm(stated 窗口)+同请求一次 refold 重发,失败则回退透传,客户端可见契约只会变好;② refold 期间输出预算:对照声明窗口+armed baseline → 对照 stated 窗口+fresh estimate(仅 refold 路径)。附带效应:nudge meter 在 arm 后按 stated 窗口计量,从虚假的 ~46% 回到接近真实的占比——这正是修复目的之一。 Auto-merge gate(§7.4)八项全过;合并动作本身留给人工。判定:可合并。 |
62cf0d6 to
5f444f5
Compare
71520a8 to
576cb68
Compare
576cb68 to
97e72ea
Compare
…r strips x-bili-plugin-context-window for the process lifetime Root cause of the ranxianglei#1812 mis-sizing handshake gap: dsh's catalog always knows a window (user-set models[].contextWindow or the built-in default), and headersFor stamps x-bili-plugin-context-window from the ModelInfoCache — but refreshModelInfo cached {provider, model} (no window) whenever resolveModelInfo failed once, and the early-return only compared provider+model, so a single boot-time race (catalog still loading) latched the process headerless. Every request of the session then sized against bili's unconfigured 200k fallback. Observed live on the same dsh install against the same model: two proxy runs sent x-bili-plugin-model without any context-window header (proxy warned ranxianglei#1569 and only survived via a lucky registry-peek match), a third run sent the header on every request — intermittency = the boot race. Fix: a matching cache entry is final only when it carries a window; a failure-shaped entry retries after a 30s cooldown (test hook: BILI_MODEL_INFO_RETRY_MS). Successful resolves with a window clear the retry state; selection-change semantics from ranxianglei#956 are untouched. Test: new dsh-native unit test — resolve fails twice, model id still stamped, window absent; after the cooldown the next stamp carries x-bili-plugin-context-window: 262144 (attempts >= 3). Part of ranxianglei#1812 (handshake root cause; the error-text extraction rework stays in ranxianglei#1818).
…n compress receipt
97e72ea to
437f63e
Compare
summarizeRange prompt now carries an explicit per-chunk character budget (maxSummaryLength spread across chunks minus join gaps); an assembled summary over the cap but still shorter than the folded content is truncated at a line boundary to the cap and folded instead of being discarded whole after halving retries.
…w estimate On bytes-billing upstreams (unknown hosts) the conservative base64/4 image estimate can push the payload estimate over the context window while the TEXT portion still fits. The #496 arbitration branch returned `prepared` unconditionally in that case, skipping preflightCompress entirely and recording no compression state — so auto-compression stayed permanently disabled for image sessions (issue #1800: preflightCompress ran 0 times across the whole session while every request was forwarded). The branch now short-circuits ONLY when there is genuinely nothing to fold (compressibleRanges empty). Otherwise it remembers the arbitration, runs preflightCompress to fold the compressible text portion, and — if images alone still keep the residual estimate over the window with no upstream overflow evidence — forwards the folded payload for the upstream to arbitrate billing. The image rides along byte-exact either way. No config/env surface added. Adds tests/issue1800-image-arbitration-compress.test.ts pinning the regression (verified: fails without the fix with 0 summarization calls, passes with it).
Rebase adaptation only — no behavior change: - issue1819 suite: applyRanges now returns ProxyToolResult (#1875); read .text - issue1820 suite: narrow server.address() like every other e2e harness
437f63e to
99e2150
Compare
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.86-master.2ab0903 # this exact build
npm install -g billion-context@master # always the newest merged build
|
Fold-integrity bundle from #1812 — four defects, all
ework-agentoriginals, directional review pending (per owner). The other two legs of #1812 landed in their own PRs: dialect recognition/honest-failure → #1838, dsh window handshake → #1836.6ee3c8b4d5572e45c180330697e72ea4Semantics kept from the original stack assembly:
outbound = rebuiltpreserved alongside B's post-rebuild meter anchor (setPostRebuildAnchor).Local: typecheck clean; per-defect suites (issue1819/issue1820/summary-length-budget/issue1800/preflight*) + e2e-overflow-selfheal/e2e-grow-compress all green on this head. These fixes only pin post-fix behavior — red/green verification against the pre-fix defect is part of the pending review.
Behavior changes (disclosed, old → new)