Repository navigation
[PR] fix: payload-aware image identity in fold reconciliation (#6075) - #6082
ranxianglei wants to merge 1 commit into
Conversation
Image cores all carry the same "[image]" placeholder text, so normalizedIdentity / positionalFingerprint were payload-blind: two different uploads produced identical fingerprints, and planReconciliation claimed a missing covered image id onto the new upload through the normalized fallback and Pass-0 positional match. The new image then inherited the old fold coverage and was trimmed from the outbound request while its metadata text remained. - mediaIdentity(): sha256 over the image payload ([mediaType, base64], or the raw sidecar blocks for sidecar-only images; split remote images disambiguated by occurrence id), namespaced with a "media:" prefix; folded into normalizedIdentity, normalizedIdentityNoToolCallId, identityWithText and positionalFingerprint. Pure-text signatures are byte-identical to before. - Media messages are excluded from every cross-id heuristic claim path (candidates, missingMiddle, recordGap, head/tail positional scan): kernel ids are payload-addressed since #3767, so only an exact id can prove the same upload occurrence. - anchorFrom no longer seeds simhash/word-bag sketches for media messages (the placeholder text is not content evidence). - reconcileFoldCoverage repair mode releases coverage of wire-present media cells whose stored anchor evidence does not match the current payload-aware identity (legacy text-only anchors may already have claimed unrelated images); ids, summaries and the remaining text fold stay intact. warn/off modes untouched. Known boundary (documented): sessions folded under pre-fix builds keep legacy image anchors without payload evidence; their coverage is released once on the first post-upgrade repair pass (images return to the request until re-folded). A legacy image anchor whose cell is replaced IN PLACE by a text cell at the same index, bracketed by verified positional claims, could still be claimed through the gap-tier order bracket — narrower than the pre-fix behavior, tracked in #6075. Tests: new tests/fold-reconcile-images.test.ts (25 cases) pins both directions of every gate plus self-heal, seeding and positive controls. Local targeted suites green (fold-reconcile family 273/273); full regression on remote CI. Fixes #6075
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.8878-pr.6082.bfd3184This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr6082.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) 查重: 不重复。 本单是 PR #6082(修 #6075)的 [PR] 跟踪单;在途 [PR] 里另有两条图片相关——#6089(image spill 修复)、#6086(rescale 缓存键)——机制不同(spill/rescale 缓存 vs fold reconciliation 身份层),无平行冲突。 标签: bug / dsh / p1 / scope/kernel(缺陷类;复现现场为 DSH Responses wire;属上下文管理/会话核心逻辑域;用户上传图片静默从模型视野消失 = 数据丢失类,按 2026-10-19 口径 p1)。GitHub PR 侧已有 bug/p1/scope/kernel/image,与我的独立判定一致。 本轮对既有 PR 做代码核对 + 状态确认(未重做),结论如下。 代码核对(独立 review)
本地验证(定向跑,PR head bd00d94)
状态(live 核实)
八问
判定:代码与本地定向验证均通过,待 CI 转绿即可合并(人工合并)。CI 结果出来我会回帖跟进。 |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) CI 结果跟进(live 核实):head bd00d94 全绿。 全部 160 个 check run 终态:78 success / 42 skipped / 40 cancelled,0 failed。那 40 个 cancelled 是开跑数秒内被 re-trigger 自动取消的第一波(取消时间集中在 03:42:33–03:42:35Z),已逐一按名称核对——每一个都有对应的成功/跳过重跑,无一遗漏。 至此:代码核对 ✓、本地定向验证(含与当前 master 的合并模拟)✓、CI 全量 ✓、标签齐(PR: bug/p1/scope/kernel/image;镜像单: bug/dsh/p1/scope/kernel)、PR 正文已修复。PR #6082 可以合并了,等你人工合并。 |
Closes #6075
Problem
On v0.1.213,
src/fold-reconcile.tsmatched image cells on TEXT alone: two different images both parse totext: "[image]", so they got identicalnormalizedIdentity/positionalFingerprint. When message ids churned across a history resend, fold-coverage repair claimed the NEW image under the OLD folded block's coverage; later trimming then dropped the new image while its filename/size/hash metadata text stayed — the model saw metadata for an image it could no longer see.Fix (payload-aware identity, host-side only)
All changes in
src/fold-reconcile.ts; nokernel/changes:carriesReconciliationMedia()+mediaIdentity(): a media cell's identity mixes a sha256 over its payload (imageBase64+ media type, else the raw wire sidecars; split remote-image occurrences sharing one raw item additionally mix their occurrence id). Media identity strings carry amedia:prefix so they can never collide with legacy text-only digests.normalizedIdentity/normalizedIdentityNoToolCallId/identityWithText/positionalFingerprintmix the media factor in. Non-media messages hash byte-for-byte exactly as before (empty media factor, no prefix) — zero drift for text-only histories.[image], useless as shape evidence).Verification
tests/fold-reconcile-images.test.ts(25 tests): distinct identities for distinct payloads (inline base64, sidecar-only, split remote images sharing one raw item); no inheritance across replacement / shared-tail-fenced / same-payload-independent-upload shapes; legacy-sketch bypasses closed (simhash, tool-call, byOrder, shape census); self-heal releases only the image's coverage without unfolding the text fold; positive controls (whitespace-only churn still reanchors; unchanged and duplicate-retained images keep coverage).npm run typecheckclean. Full-suite verdict = CI lanes on this head.Behavior change disclosure (intended, per #6075)
Sessions that ALREADY contain a folded image cell anchored by a pre-fix text-only anchor: on the first repair-mode pass after upgrade, that image cell's coverage is released (the image returns to outbound requests) while the rest of the fold stays intact. Text-only sessions: zero change (identities byte-identical when no media is present). No config surface, wire protocol, or persistence format changes — identity strings are internal session-metadata state.