Repository navigation
[PR] chore(batch): land 8 open fragmented fixes (ReineLan ×4, PatelVro ×2, dimas623 ×2) in one history-preserving batch - #6464
Merged
Merged
Conversation
(cherry picked from commit affc3fb)
(cherry picked from commit ba2067e)
Retain exact source-part ownership when surviving cores are reminted or split by a summary. Cover partial folds, raw resends, short-view recovery, genuinely new identical images, cold loading, and byte-exact archived-image retrieval. (cherry picked from commit 0ee6cb2)
(cherry picked from commit 161d3d7)
Use the existing scoped payload fit result when no compression block lands. Integrate the home handoff regression fixture covering calibration direction, route and model provenance, unscaled image reserve, anonymous forwarding, cancellation, and refusal guards. (cherry picked from commit 6c91881)
process.exit() inside a worker thread ends only the worker, so a wedged proxy survived its own watchdog, kept the port and ran on unwatched. SIGKILL the process from the worker instead, and cover the real "exit" path with a child-process test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 5c650a8)
The codex clamp already applies effective_context_window_percent, which codex defines as the input share after reserving model output. Reserving bili's default 25% on top walled sessions below codex's own auto-compact point, so long sessions hit an unrecoverable 413 futile round. Skip the default reservation when the window came from codex-catalog or codex-models-cache. An explicit operator outputHeadroomMaxPct, a proven completion share and every raw-window source still reserve. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit ac9b271)
…ew nit for #6165) The #6165 change re-ran resolveCompress with identical arguments to read outputHeadroomMaxPct, duplicating the resolution already done at the headroomCap site whose comment says it is resolved once so the side-request guard and the main-path reservation measure against the SAME capped window. Capture the resolved config once and reuse it; behavior unchanged. Reviewed by agent (ai: vllm-qwen/qwen3.8-27b). (cherry picked from commit 0252702)
…kips the reservation (review nit for #6165) The 'although protocol X is exempt' clause is now also reachable via the new codex-netted skip path, where the protocol is NOT exempt — the default reservation was skipped because the codex-aligned window already nets out codex's own output headroom. Make the clause conditional so incident logs attribute the right cause; old-path wording byte-identical. Reviewed by agent (ai: vllm-qwen/qwen3.8-27b). (cherry picked from commit 03af668)
The sampled read-back verifier compared the two legs of a session's tail
positionally from index 0, but they intentionally hold different SLICES of the
same log:
- the rows hold the raw tail interned at save time (`tailSeqs`, oldest-first,
the whole resident window), and
- the envelope holds `boundedFoldedSnapshot`, which prunes from the FRONT and
keeps the NEWEST messages under `persist.tailTokens` (#2960 (5), caveat 2a).
Measured on live sessions the envelope is an exact element-wise SUFFIX of the row
tail (tail=1095/envelope=10 and tail=752/envelope=22, zero id and zero content
mismatches inside the overlap, stable across a six-sample sweep). Walking both
legs from index 0 therefore compared the oldest row against the oldest RETAINED
message — off by `tail.length - messages.length` — so `want` was undefined for
every slot outside the envelope window and `changed("lastMessages")` fired for
every tailSeq on every sampled save.
The sampled digest could then never converge: the streak latched (#5677), the
delta fast path was disabled for that session by design, and every save paid a
FULL ingest. Measured on one affected session: 44 full ingests, avg 4522 ms, max
9363 ms, 170.8 s of stalled event loop in a single episode.
Fix: align the envelope to its suffix position and compare only the overlap. A
genuine divergence inside the window still reports; a leg that is not a suffix
produces mismatches rather than silence. Row PRESENCE is still enforced for every
seq (#4390) — a recorded tail pointer with no row now also raises `changed()`,
which it previously did not, and the loop advances its index on that branch so the
suffix offset cannot drift when a gap is present.
Absence of a whole leg stays with the header digest, which already distinguishes
`undefined` from `[]` via `withoutBulk`; it is not re-litigated here.
Tests: tests/folded-tail-suffix-alignment.test.ts pins both halves — a row tail
longer than the envelope with a matching overlap verifies clean, and a content
change inside the overlap still latches drift.
(cherry picked from commit 3a196c7)
The sampled view verifier compared the same message in two different media
representations and marked drift on every sample.
Rows are written media-SPLIT: `planIngest` runs `splitMediaContent`, which
replaces an `imageBase64` payload and every >= 2 KiB data URL with a
`{"$media": hash}` CAS reference. The verifier reads the tail back through
`UnifiedStore.getMessages()`, which returns those rows media-HYDRATED
(`hydrateMedia` inlines the payload again). The envelope's `lastMessages`
keeps the split form, so `messageSignature` hashed a placeholder against the
inlined payload for the SAME message: measured 1,991 vs 201,293 bytes on one
tool result (101x), and ten 390-byte user rows that hydrate to 112-672 KB.
That is a digest-shape mismatch (#4392 family) rather than a content change,
so the sample never converges: the session latches into the #5677 full-ingest
path and transforms its whole tail on every save (measured 8-9 s per save
while latched, starving the event loop).
Normalize both legs to the split form before hashing. `splitMediaContent` is
idempotent on already-split input, so the envelope leg passes through
unchanged, and `splitMediaContent(hydrate(x)) === x` was verified
byte-identical on every media-bearing row sampled, so a genuine edit still
changes the digest and still raises drift.
Tests: new `tests/media-split-digest-parity.test.ts` builds a fixture whose
stored bytes really are split (asserted against the CAS row), folds the
envelope to the newest messages, and requires a clean sample; a second case
rewrites a row's content bytes and requires that the drift is still reported.
Replacing the normalization with the raw JSON fails the first case and
leaves the second passing.
(cherry picked from commit 6919eef)
(cherry picked from commit 6220eec)
…udget repair The budget repair replaced PreflightDeps.imageReserve's #1843 doc comment with a one-liner, dropping the load-bearing rationale for the limit-minus-reserve text-channel algebra and the conservative total-view direction. Restored it and recorded the new initial-view semantics introduced by measureImageReserve. Review-side fix, no behavior change. (cherry picked from commit 8a57bd6)
…-body gate (#5000/#4543, 2e02110) ReineLan's #4933 base (2026-10-31) predates the measured-body 413 tier that dominates inside the unknown-baseline arbitration arm; with est~=measured, an over-window estimate now dooms locally instead of forwarding. Pin the current policy and note the superseded arbitration path in the comment.
Contributor
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.9433-pr.6464.a4dc847This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr6464.tgz
npm install -g packageInstall instructions are refreshed on each push. |
…hropic cache partition The fake billed whole-body bytes/4 — ~2x any real tokenizer for these bodies because the JSON wire envelope is 2x the core text — which taught the per-route calibration factor (#1933) a false k~≈1.9 on the pi lane. After #4933 the zero-fold fit verdict runs on the calibrated scale, so the post-restart baseline (raw ≈6.4K, calibrated ≈12.3K) sat ~120 tokens over the lane's 12288 wall and the pi lane got a deterministic 413 while master (raw-scale verdict) forwarded the same payload fine. Two fixture bugs fixed in UpstreamRecorder: 1. billing scale: bill the text a tokenizer sees (message/system text chars + tool-schema JSON chars, /4) instead of whole-body bytes/4, so the learned factor stays ~1.0 as on a consistent real route; 2. the anthropic usage frame reported the FULL bill in input_tokens AND the cached prefix in cache_read_input_tokens — but promptInputTotal sums the two (anthropic partitions the prompt; the fields are disjoint), double-counting the cached prefix. Now input_tokens is the uncached remainder. The OpenAI branch already reported prompt_tokens inclusively and is unchanged. Verified: suite green 3x locally; calibration ring settles ~1.006 on the pi lane.
Contributor
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.1183-master.243709b # this exact build
npm install -g billion-context@master # always the newest merged build
|
This was referenced Nov 13, 2026
This was referenced Nov 13, 2026
ranxianglei
pushed a commit
that referenced
this pull request
Nov 14, 2026
…merge commit These files (issue-number lists recording the superseded closings of the previous four batches #6439/#6455/#6464/#6482) are present in neither parent of the #6574 merge commit yet appear in its result, and survive to the branch tip. They are not part of any source PR, are referenced nowhere, are not mentioned in the PR description, and the previous four batch merges never committed such files to master. Process scratch data does not belong at the repo root; the closing record already lives in GitHub history.
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.
chore(batch): land 8 open fragmented fixes (ReineLan ×4, PatelVro ×2, dimas623 ×2) in one history-preserving batch
Same pipeline as #6439 / #6455: every commit cherry-picked with
-x(original authorship preserved), line-by-line reviewed against the evolved master, no content dropped.type:"compaction"items): identity persisted, ACP state rebased only when fold coverage is actually missing (#4929)process.exit()inside the worker only ended the worker, leaving the wedged proxy running unwatched (#6157)effective_context_window_percent) — stop reserving bili's default share on top (double-count that wall'd sessions below codex's auto-compact point) (#6164)persist.tailTokens): fixes the 44 full re-ingests / 170.8 s stalled-event-loop episode (#6349)getMessages()returns hydrated): fixes the permanent drift latch from a 2 KB placeholder vs a 200 KB payload (#6356)Merge notes
textTarget/refreshImagescarryfoldTarget − imageReserve − viewDeltaCorrection; both futility gates keep the corrected deficit and additionally requireimageSavingBound(...) === 0. Verified every added line of [PR] fix(preflight): measure the image payload after folds #4932's diff is present (the only variants are these union lines).test: adapt zero-fold anonymous arbitration pins…): [PR] fix(preflight): preserve calibrated fit after zero folds #4933's two anonymous-arbitration pins predate master's measured-body 413 gate ([Bug][dsh][0.1.208] Kill switch / egress fuse only measures message.text: a session with 26,903 messages and only 1.44 M | [Bug][dsh][0.1.208] 判死/egress fuse 只量 message.text:26,903 条消息、core text 仅 1.44 MiB 的会话绕过 fuse 发出 55.2 MiB 请求体,被上游 413 拒收(ModelArts.… #5000/[Bug] CJK payloads slip past the egress byte-floor fuse: a 4.1 MiB outbound was forwarded at 1,121,674 tok into a 1,000,000-token window (0.1.206, plugin lane) #4543,2e021109), which now dominates inside that arm; with est≈measured the over-window fixture is doomed locally by design. The pins now assert the current policy.cherry picked from commit …trailers) in an interactive rebase.Verification
preflight-image-budget.test.ts,responses-block-wire.test.ts,folded-tail-suffix-alignment.test.ts,media-split-digest-parity.test.ts,codex-window-no-double-headroom.test.ts)After merge (manual)
Close source PRs #4770 #4931 #4932 #4933 #6158 #6165 #6350 #6357 as superseded.
Closes #4929 #4930 #6157 #6164 #6349 #6356
Follow-up commit (CI fix, ours)
test(5631): bill the fake upstream at token scale with a disjoint anthropic cache partition—tests/issue5631-restart-survival.test.tsfailed on all CI runners because of a pre-existing fixture bug that #4933's stricter (correct) zero-fold verdict surfaced:input_tokensplus the cached prefix incache_read_input_tokens— whichpromptInputTotalsums (anthropic partitions the prompt, the fields are disjoint) → the settle total double-counted the cached prefix.After #4933 the zero-fold fit verdict runs on the calibrated scale, so the pi lane's post-restart baseline sat ~120 tokens over its 12288 wall → deterministic 413. The fixture now bills at tokenizer scale and emits a disjoint anthropic cache partition; the calibration ring settles at ~1.006 (≈1.000 on the dsh lane, unchanged). Suite verified green 3× locally.