Skip to content

[PR] fix: classify the dsh image-offload placeholder so it cannot steal the last-user anchor (#6021) - #6027

Merged
ranxianglei merged 2 commits into
masterfrom
2026-11-09_dsh-image-offload-placeholder-anchor
Nov 9, 2026
Merged

ranxianglei merged 2 commits into
masterfrom
2026-11-09_dsh-image-offload-placeholder-anchor

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Closes #6021

Root cause

dsh compaction-image-offload rewrites an OLD message's inline image into placeholder prose when the route's request budget is exceeded. The rewrite changes content identity, so bili re-ingests the cell as a NEW row (fresh ref / storage seq / timestamp) — a two-day-old message now sitting at the TAIL of the resent history. Unclassified, the placeholder is plain user-role text: once everything after the newest human request has folded away, that stale prose is the last visible user message, wins the Rule-3 last-user anchor (#5109) and pins the protected zone on the stale topic — the model answers it for the whole turn (#6021 repro; bili 0.1.213 / DSH 0.2.2-rc.1, ~6900-event session).

#5752 shipped the sibling live handle ("; request preview ") knowing this slot would next carry this placeholder and deliberately left it unclassified; this change lands that deferred family now carrying production traffic (KDD #9 evidence-permitlist, dsh lane only).

Changes

  • new dshImageOffloadPlaceholderPath classifier -> oneshot/image-offload-placeholder; substring match on purpose ([text,image] originals splice prose AFTER the "]" tail — a prefix match misses the m03269 shape); both route variants (image-budget + text-only) share one path
  • wired into BOTH registries (durableMessageToolPaths.dsh slot exclusion + oneShotCarrierPaths.dsh drift accounting) and into dshCarrierRawMarkers (stored-row backfill pre-filter)

Behavior change disclosure

Config surface

None. No new key / env var / CLI flag.

Kernel

Untouched (host-side classifier only).

Tests

…e last-user anchor (#6021)

dsh compaction-image-offload rewrites an OLD message's inline image into
placeholder prose when the route's request budget is exceeded. The rewrite
changes content identity, so bili re-ingests the cell as a NEW row (fresh ref
/ storage seq / timestamp) — a two-day-old message now sitting at the tail of
the resent history. Unclassified, the placeholder was a plain user-role text
message: once everything after the newest human request had folded away, that
stale prose was the last visible user message, won the Rule-3 last-user anchor
(#5109) and pinned the protected zone on the stale topic — the model answered
it for the whole turn (#6021 repro, bili 0.1.213 / DSH 0.2.2-rc.1).

#5752 shipped the sibling live handle ("; request preview ") knowing this slot
would next carry this placeholder and deliberately left it unclassified; this
change lands that deferred family now carrying production traffic (KDD #9
evidence-permitlist, dsh lane only).

- new dshImageOffloadPlaceholderPath classifier -> oneshot/image-offload-placeholder
  (substring match on purpose: [text,image] originals splice prose AFTER the
  "]" tail); both route variants (image-budget + text-only) share one path
- wired into BOTH registries (slot-exclusion + drift accounting) and into
  dshCarrierRawMarkers (stored-row backfill pre-filter)
- behavior change: placeholder cells lose last-user-anchor eligibility and join
  expected-rebase drift accounting (their own retirement is accounted instead
  of alarming); T2c pin updated 1 -> 2 accordingly
- tests: new tests/issue6021-image-offload-anchor.test.ts (units pos/neg per
  #3617, BOTH-registries wiring, e2e anchor geometry through the real dsh
  classifier — THE repro data-loss pin + no-bloat pin), registry row in
  issue5173, count pin in issue5142
@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-11-09_dsh-image-offload-placeholder-anchor (0e4dbe2)

Latest build — install this exact version

npm install -g billion-context@0.0.8804-pr.6027.428eb80

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Recent builds (commit → version)

commit version build
0e4dbe2 billion-context@0.0.8804-pr.6027.428eb80 build
60a557e billion-context@0.0.8800-pr.6027.f3104f1 build

Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr6027.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei ranxianglei added bug Something isn't working dsh p1 scope/wiring labels Nov 9, 2026
@ranxianglei ranxianglei changed the title fix: classify the dsh image-offload placeholder so it cannot steal the last-user anchor (#6021) [PR] fix: classify the dsh image-offload placeholder so it cannot steal the last-user anchor (#6021) Nov 9, 2026
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b)

Reviewed PR #6027 against live state, synced it to current master, and pushed. Status below.

What I verified (live, just now):

  • Original head 60a557e787: every CI workflow (CI, Windows codex overlay, PR Build Artifact, all six e2e lanes) has a completed-successful run. The cancelled runs are duplicate pull_request triggers killed by the concurrency group — noise, not failures. No red anywhere.
  • Diff review: one new classifier (dshImageOffloadPlaceholderPath, src/durable-message-guards.ts) wired into BOTH registries plus the stored-row backfill pre-filter; three test files touched; kernel untouched; no config surface.
  • Master had moved 32 commits ahead since the branch cut, with zero file overlap against the PR's four files. I merged origin/master into the branch (clean, no conflicts), then locally: npm run typecheck OK, and the three affected test files pass 21/21 (tests/issue6021-image-offload-anchor.test.ts, tests/issue5173-last-user-anchor.test.ts, tests/issue5142-expected-rebase.test.ts). Pushed as 0e4dbe2776 — CI re-runs on the synced head.

Review judgment:

8问(结构化审核结论)

  1. 是什么问题:dsh 图片 offload 把旧消息的内联图改写成占位文字后,bili 按新内容重新入库(新 ref/seq/时间戳),这条两天前的占位文字落到重发历史尾部;其后内容一旦全部折叠,它就成为最后一条可见 user 消息,抢走 Rule-3 last-user 锚点,保护区被钉死在旧话题上,模型整轮回答旧问题([Bug][dsh] image-offload placeholder text hijacks the last-user anchor: model treats a two-day-old screenshot as the cur | [Bug][dsh] image-offload 占位文本抢走 last-user 锚点:模型把两天前的旧截屏当成当前提问(bili 0.1.213 / DSH 0.2.2-rc.1) #6021 复现)。
  2. 什么原因导致的:offload 改写改变内容身份 → 重新入库为尾行;该占位家族未分类([PR] fix: classify the dsh request-image handle as a one-shot carrier (#5142 residual) #5752 交付 live handle 时有意留白),无分类的 user 角色文本天然具备 last-user 锚点资格。根因是身份变化 + 分类缺失,不是渲染或提示词问题。
  3. 影响范围与严重程度:仅 dsh 车道、且发生过 compaction-image-offload 的长会话(bili 0.1.213 / DSH 0.2.2-rc.1,约 6900 事件);触发后当轮回答整体跑偏(答旧话题)——上下文管理核心承诺失灵级,p1 定级成立。
  4. 怎么修复的:新增 dshImageOffloadPlaceholderPath 分类器(子串匹配,image-budget 与 text-only 两条路由共用一个 path),归入 oneshot/image-offload-placeholder,同时接入 slot-exclusion 与 drift-accounting 两个注册表及存储行回填预过滤——在决策点分类,不做传输层过滤。
  5. 是否有回归问题:审过三处既有行为——① slot-exclusion:占位格失去锚点资格(已披露、已钉测);② drift 记账:expectedRetired 1→2(T2c 钉测);③ raw-marker 预过滤:12→14(lockstep 测试钉住)。无 fail-fast 变吞错、无阈值/时序/输出格式漂移;assistant 回显、tool 通道、pi 车道措辞均有负向行排除。
  6. 是否破坏缓存:不涉及——不改缓存键、重试策略、增量游标或去重键;纯会话簿记层。
  7. 是否改了设计方向:不涉及——沿用既有 one-shot carrier 家族机制(KDD release v0.1.2 #9 evidence-permitlist,dsh 单车道)。
  8. 是否引入了新的配置:不涉及——无新 key/env/flag。

标签已在位且与 diff 相符(bug / p1 / dsh / scope/wiring)。判定:可合并——等同步后 head 0e4dbe2776 的 CI 转绿即可;合并操作留给你(agent 不合并 PR)。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b)

CI follow-up on the synced head 0e4dbe2776: all ten workflows completed success (CI, Windows codex overlay, PR Build Artifact, e2e-codex-persona / -fake-codex / -local-registry / -native-dsh / -native-opencode / -native-pi, e2e-pi-codex-ws) — verified live just now, zero failures. The PR is green end-to-end and ready for you to merge when you get to it.

ranxianglei pushed a commit to sx4im/billion-context that referenced this pull request Nov 9, 2026
…the offload placeholder

A [text, image] original keeps its prose before the '[' bracket, so the marker can sit mid-text; pin that the documented substring match classifies it (coverage folded in from the parallel analysis in ranxianglei#6027).
@ranxianglei

Copy link
Copy Markdown
Owner Author

(ai: vllm-qwen/qwen3.8-27b)

This PR fixes the same issue (#6021) as #6024, which was opened ~40 minutes earlier by an external contributor, and the src changes are functionally identical (same classifier dshImageOffloadPlaceholderPath, same wiring in both registries, same two raw markers).

Per repo rules (first-come-first-served; AGENTS.md §4 "External contributors' PRs — fix directly, don't replace"), #6024 is kept as the canonical vehicle. The one unique coverage point here that #6024 lacked (the words-before-marker splice-shape positive) has been folded into #6024 as commit c855d6f, so nothing substantive is lost by closing this one.

Recommend closing this PR as a duplicate of #6024. (Closure left to the owner — agents do not close.)

@ranxianglei ranxianglei added the duplicate This issue or pull request already exists label Nov 9, 2026
ranxianglei pushed a commit to sx4im/billion-context that referenced this pull request Nov 9, 2026
…fload placeholder (folded in from parallel PR ranxianglei#6027)

The unit rows pin that the classifier resolves; this file pins the actual
failure mode of ranxianglei#6021 through applyCompression with the REAL dsh registry:
a fold covering the offloaded tail must keep the live request visible (the
stale placeholder loses Rule-3 last-user anchor eligibility), and a
placeholder ahead of the live request still folds normally (no bloat).
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b)

Independently verified the duplicate determination before agreeing — all three claims check out against live state:

  1. First-come-first-served holds: [PR] fix: classify the dsh image-offload placeholder as a one-shot carrier (#6021) #6024 was opened 11:22:50Z by external contributor sx4im, ~35 min before this PR ([PR] fix: classify the dsh image-offload placeholder so it cannot steal the last-user anchor (#6021) #6027, 11:57:34Z). [PR] fix: classify the dsh image-offload placeholder as a one-shot carrier (#6021) #6024 stays the canonical vehicle.
  2. src changes are functionally identical: diffed both src/durable-message-guards.ts changes side by side — same classifier (dshImageOffloadPlaceholderPath), same role/contentType guards, same two substring markers, same oneshot/image-offload-placeholder path, same ?? wiring appended to BOTH registry chains, same two raw markers. Only differences are doc-comment wording and line wrapping.
  3. c855d6f is real and sits at [PR] fix: classify the dsh image-offload placeholder as a one-shot carrier (#6021) #6024's head: it pins the words-before-marker splice-shape positive in both test files, explicitly folded in from [PR] fix: classify the dsh image-offload placeholder so it cannot steal the last-user anchor (#6021) #6027.

One gap the summary missed, now fixed: beyond the unit row, this PR also carried the end-to-end anchor-geometry pin (tests/issue6021-image-offload-anchor.test.ts — applyCompression through the REAL dsh registry proving a fold covering the offloaded tail keeps the live request visible, i.e. the actual #6021 failure mode plus a no-bloat pin). #6024 had no equivalent (its coverage stops at classifier units + reconcileFoldCoverage accounting). Per "fix directly, don't replace", I folded that file into #6024 as additive commit 39679ea8e9 (verified 4/4 passing locally on top of c855d6f before pushing) — nothing substantive is lost by retiring this PR.

Actions taken:

Net result for the owner: merge #6024 (it now carries the complete fix + full test coverage), close #6027 as its duplicate.

@ranxianglei
ranxianglei merged commit c812a84 into master Nov 9, 2026
84 checks passed
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

📦 Merged Build Published

This merge to master was published as 0.0.1122-master.c812a84 (rolling master tag).

npm install -g billion-context@0.0.1122-master.c812a84  # this exact build
npm install -g billion-context@master  # always the newest merged build

npm view billion-context@master prints the current version at any time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working dsh duplicate This issue or pull request already exists p1 scope/wiring

Projects

None yet

1 participant