Repository navigation
[PR] fix: recognize dsh 0.2.2's auto-review sidecar shape (banner line + history-replaying body) - #6110
[PR] fix: recognize dsh 0.2.2's auto-review sidecar shape (banner line + history-replaying body)#6110gongfpp wants to merge 0 commit into
Conversation
查重: 不重复 — 镜像 open [PR] 清单里唯一针对 #6104 / dsh auto-review sidecar 的就是本 PR;无并列第二条修同一线程的 PR,也无同机制的在途 issue。标签: Review of PR #6110 (mirror #6112)I reviewed this independently against live master (PR head Direction (原 issue). #6104 root-causes this correctly: two HOST-SIDE FORMAT decisions broke both bars, neither is identity. The PR targets exactly those two bars at the right layer — a pre-pipeline lane gate, zero kernel diff, no wire-shape change, both compression modes unaffected. Good scope discipline: the deeper invariant (skip Regression audit (既有行为逐项). Every existing behavior of
No unintended semantic drift, no fail-fast→swallow, no threshold/timing/output-format drift. The ONLY behavior change is the intended recognition of the 0.2.2 shape (disclosed below). Code. Tests (有效性). Real tests with teeth — I confirmed red-before: against pre-fix Diff cleanliness. Clean — 3 files, every line on-purpose, no whitespace churn, no unrelated/generated/lockfile changes. CI: the mirror check-cache returns no checks yet (suite appears to still be running); I could not verify green/red live, so I'm deferring the full-suite verdict to CI rather than asserting a state. Local targeted: 50/50 green across the six touched suites + red-before confirmed + typecheck clean. Behavior-change disclosure (Deliverable #4): Honest residual (not blocking): 结构化八问
判定:可合(待 CI 全量绿)。 宿主侧单模块、零 kernel diff、回归测试红前置已验证、diff 干净,满足 §7.4 auto-merge 大部分条件;因涉及请求路由/车道决策且属行为变更,合并仍走人工(merge 永远 human-only)。未发现阻断项。 |
|
(ai: deepseek/deepseek-v4.1-flash) Thanks for the audit — the
Local: Your two residual notes I accept as-is: the 5-line head bound is deliberate (a deeper quote must not identify a review call), and the "skip fold accounting for structurally-non-resend requests" invariant stays out of this PR — it needs its own scope because the fingerprint doubles as the persona key. |
Update — CI state corrected with live evidence. My full review is above (floor 4); the code-level verdict stands. Since I wrote it, the thread shows CI failed on Root cause (traced — this PR's own structure, NOT inherited from master): the Consequence: This is a delivery-hygiene gap, not a logic bug. The gate logic is correct and the existing designated suites pass locally — they're simply absent from the diff, which is all the mechanical guard checks. Correct fix (for whoever lands it): add a genuine case to I'm not pushing concurrently — 八问增量(仅本次变化,其余七问见上方完整八问):
|
Re-verified against the live mirror cache (fresh fetch, 08:15 UTC): the blocker this wake reported is already cleared — no fix needed.
Stopping without further work. 八问
判定:CI 已全部转绿,无待办,收工。 |
|
(ai: deepseek/deepseek-v4.1-flash) Base refreshed to Nothing upstream overlapped this PR's four files: Re-verified locally on the merged tree (
One local failure to disclose, because it is not from this PR: |
ranxianglei
left a comment
There was a problem hiding this comment.
(ai: vllm-qwen/qwen3.8-27b)
Independent review of this PR (fixes #6104). CI green on head d1129cc0b (30 checks, 0 failed/pending via mirror cache); targeted local verification below.
Direction (①). Root cause of #6104: both bars of isDshAutoReviewRequest were keyed on host-side FORMAT decisions, not identity — dsh 0.2.2-rc.1 moved both. Verified the broken bars exist verbatim at the reporter's exact commit (541cf260c: line 149 first-line pin, line 174 users === 1). The fix attacks the right layer: the lane gate in src/server/side-request.ts, zero kernel diff; both call sites (src/server/handle.ts:1213 stamped leg, src/server/handle.ts:2536 sticky-binding leg) untouched, so the dsh-evidence gating (live header OR sticky binding) is preserved exactly.
Regression audit (②) — existing behaviors on the touched paths:
- Legacy dsh ≤0.2.1 review shape (sentence on line 1, single blob): still matches —
POLICY_LEGACYcases green. KEPT. - Every main-turn veto (tools surface / assistant turn / tool turn / no system carrier / policy quoted inside a user blob / empty content): unchanged, all still pinned (updated
issue4438unit case + new suite cases 3–4 + e2e vetoes A/B). KEPT. isDshTitleRequestandisDshSingleShotSidecar(including its OWNusers === 1atsrc/server/side-request.ts:232): untouched. KEPT.- Intended changes, disclosed in the PR body: line-1 pin → head-5-lines scan (
DSH_AUTO_REVIEW_HEAD_LINES = 5, both window ends pinned by test);users === 1→users >= 1with the replay veto carried by the entry-level loop. No other drift found on these paths.
Code (③). isDshAutoReviewPolicy: split("\n", 5) bounds the scan (deep-quoted policies cannot identify a review call); CRLF-safe (a trailing \r never affects a line-start prefix); block-array systems stay correct because systemCarrierTexts (src/util.ts) hands each block over separately, verified. The entry loop vetoes every non-user role, including Responses typed items (function_call, …) and Google model turns. The widened acceptance class (≥2 user blobs, no assistant/tool turn, no tools, reviewer sentence in the carrier head) can only be produced by dsh's classifyRisk() shape inside a dsh-evidenced session — a main turn cannot carry the reviewer policy as its system prompt.
Tests (④). Real teeth, independently re-verified: ran the new suite against the PRE-fix source at the merge base — 4 of 6 cases fail (banner shape, replay shape, window-boundary lines 5/6, google carrier); all 6 pass post-fix. 35/35 across the five targeted unit suites and 16/16 in tests/side-lane-invariants.test.ts, including the new (N) e2e case that pins the actual damage symptom end-to-end: review call forwarded but counted nowhere, no |sub lane minted, next main turn lands on the raw key.
Diff (⑤). 4 files, every line relevant; comment density matches house style for this file. No kernel involvement → no kernel-change: declaration needed; no config/env surface added.
Residual, already tracked in #6104 Asks #2 and deliberately out of scope here: skipping reconcileFoldCoverage for requests that cannot be a resend is the deeper invariant; leaving it as separate decision-level work is correct, since the fingerprint doubles as the persona |sub: key.
八问(中文结论)
- 是什么问题:dsh 0.2.2-rc.1 改动了 auto-review 侧车的两个识别条件(固定句位于首行、恰好一条 user 消息),导致每条 review 调用都走主管道,把折叠账本整段判成 DEAD 墓碑——报告者 5 个会话 107 条
compress FAILED … cannot be anchored、0 次成功压缩。 - 什么原因导致的:根因是两个条件锚定的是宿主侧「格式」而非「身份」——0.2.2 加了 banner 行把句子挤到第 2 行、
reviewMessages()回放历史让 user 计数 >1;真正的身份是那句 version-pinned 的 reviewer 句子,真正的重放否决是条目级的 assistant/tool 否决(与 user 条数无关)。 - 影响范围与严重程度:所有启用 auto-review 的 dsh 0.2.2+ 部署;p1 级——受影响会话永久失去压缩能力(DEAD 墓碑无复活路径),且每次 review 都在主会话上制造指纹翻转噪声。
- 怎么修复的:身份判定改为「系统载体前 5 行内出现固定句」(有界窗口,防深层引用误配),user 计数放宽为 ≥1,重放否决完全交给既有的 assistant/tool 条目级否决;零 kernel diff,两个调用点的 dsh 证据门不动。
- 是否有回归问题:审过触碰路径的全部既有行为——legacy ≤0.2.1 形状仍命中;所有主回合否决(tools/assistant/tool-turn/无载体/user blob 内引用/空内容)保持;title gate 与 single-shot gate(含其自身
users === 1)未动。唯一行为变更即上述两条 bar 的放宽,PR 正文已披露旧值→新值+原因。未发现无意回归。 - 是否破坏缓存:不破坏——修复后 review 流量回到 #388 side passthrough,kernel 状态与主会话前缀不再被另一种序列化反复改写(那正是原 bug 破坏缓存的方式),方向是恢复。
- 是否改了设计方向:没有。仍是「形状自证 + dsh 证据门」的车道门设计;更深不变量(非重放请求跳过 reconcileFoldCoverage)按 issue Asks #2 留作独立决策项,未混入本 PR。
- 是否引入了新的配置:没有新 env/config/默认值;
DSH_AUTO_REVIEW_HEAD_LINES = 5是模块内私有常量,测试钉死了窗口两端。
Verdict: APPROVE — 可合入;车道门触及会话键控语义,合并按 §7.4 仍走人工层。
评审完成:PR #6110(dsh 0.2.2 auto-review sidecar 形状识别)已 APPROVE — #6110 (review) 。CI 全绿(30 checks / 0 failed),本地定向复验:新测试套在修复前源码上 4/6 红、修复后全绿;5 个定向 unit 套 35/35 + side-lane-invariants e2e 16/16。无 kernel 涉及、无小修项、无回归(唯一行为变更 = PR 正文已披露的两条 bar 放宽)。合并按 §7.4 仍走人工层。 |
Independently live-verified against the mirror cache on the current head
Nothing left for me on the CI side. The only remaining gate is the owner's review/approval. 八问
判定:CI 已绿、behind 已清,CI 侧无待办;唯一剩余门禁是 owner 的人工评审/批准。 |
ranxianglei
left a comment
There was a problem hiding this comment.
(ai: vllm-qwen/qwen3.8-27b)
Re-review at updated head 849872a7ac (was d1129cc0b).
What changed since the last approval: the fix content did not change. The branch picked up three pure merges of upstream master (994465b28, 6642f09a53, 849872a7ac); no new author commits. The diff against current master (merge-base dc041dd1) is byte-identical to the diff reviewed at d1129cc0b (same 4 files, +211/−13 — verified by diffing the two patch files). No kernel involvement, no config/env surface change.
Verification carried over (content-identical code): root cause reproduced verbatim at the reporter's exact commit (541cf260c); red-before-fix proven locally (4/6 cases of the new suite fail pre-fix, all 6 green post-fix); targeted suites green (35/35 across the five side-request unit suites + 16/16 side-lane-invariants e2e); regression audit over every existing behavior on the touched paths clean; only behavior delta = the two disclosed bar widenings (banner line → 5-line bounded window; users === 1 → users >= 1, replay veto carried by the existing entry-level non-user rejection).
New-master interaction check: master moved 30 commits between bases; its only touch to src/server/side-request.ts is #5765's BLOCK_OP_TOOL_NAMES addition to BILI_TOOL_NAMES (structural demote-gate signal) — zero semantic interaction with the auto-review gate; both call sites (src/server/handle.ts:1213, :2536) unchanged at dc041dd1.
CI per head:
d1129cc0b: fully green (30 checks, 0 failed).6642f09a53: fully green (mirror cache: 30 checks, 0 failed/pending).849872a7ac(current): all 11 e2e lanes green; mainCIrun 42983739921 cancelled 2026-11-11T08:29:46Z with 22/28 jobs already succeeded (5 test shards + red-signal cancelled mid-flight, zero failures observed). No known master-side cause in #4599. Flagged there for visibility; not blocking — the content is byte-identical to two fully-green heads. A re-trigger would give a fully clean signal at this head if desired.
八问(中文结论)
- 是什么问题:(与上轮相同,本轮无新问题)dsh 0.2.2-rc.1 改动了 auto-review 侧车请求的两个格式性识别条件(reviewer 固定句被 banner 行挤到第 2 行;请求体重放整段会话使 user 计数 >1),导致 review 调用全部落入主管道、主会话折叠账本被反复改写并 DEAD 墓碑化。本轮 head 更新只是把同一修复 rebase 到新 master。
- 什么原因导致的:两条 bar 锚定宿主侧格式而非身份;身份由 version-pinned 的 reviewer 固定句承担,历史重放由既有的条目级非 user 否决兜住。未变。
- 影响范围与严重程度:启用 dsh auto-review 的部署(0.2.2+),p1 级——受影响会话的压缩能力永久丢失(refs 墓碑化不可逆)。本 PR 本身不引入新影响面。
- 怎么修复的:前 5 行有界窗口匹配固定句(容忍 banner 偏移)+ user 计数放宽为 ≥1;重放否决交给条目级否决;零 kernel diff、零配置面变化。
- 是否有回归问题:diff 与已审版本逐字节一致,上轮回归审计结论全部沿用;新 master 对本文件的唯一变更(#5765 blockOps 工具名入
BILI_TOOL_NAMES)与本 gate 无语义交互;两个调用点未动。无回归。 - 是否破坏缓存:不破坏,方向是恢复——review 流量回到 side passthrough,主会话出站前缀不再被异序序列化反复改写。
- 是否改了设计方向:没有。
- 是否引入了新的配置:没有。
Verdict: APPROVE. Content identical byte-for-byte to the previously approved-and-green version; the only open item is the cancelled (not failed) CI run at this head, noted above and in #4599. Merge remains at the human-only tier per §7.4.
[bot] 🏷 复审完成(进程曾被强制重启后已恢复,现补齐汇报)。 结论:APPROVE(第二轮,head 849872a) — #6110 (review)
|
|
Landed via batch PR #6482 (merged) — closing as superseded. |
849872a to
2153152
Compare
Fixes #6104
dsh 0.2.2-rc.1 broke both bars
isDshAutoReviewRequestwas keyed on. Neither was identity — both were host-side format decisions:startsWith)REVIEW_POLICYbanner linereviewMessages(snapshot)replays the whole conversation asrole:"user"text blobsConsequence (from the report): every review call runs the full pipeline under the main session id.
reconcileFoldCoveragereads the other serialization as a wholesale rewrite on both legs — 1,006/1,007 alternating system fingerprints across 5 sessions — and the refs minted from it are tombstoned as DEAD: 107compress FAILED … cannot be anchoredreceipts, 0 successful compressions in those sessions, no un-tombstone path short of the message reappearing in the view.Fix (host-side only, zero kernel diff)
src/server/side-request.ts:DSH_AUTO_REVIEW_HEAD_LINES) instead of line 1. Bounded on purpose: a policy quoted deep inside an unrelated prompt must not identify a review call (pinned by a test). Block-array systems work unchanged —systemCarrierTextshands each block over separately, so a banner in its own block leaves the sentence at the head of its own ([bug] dsh 原生(anthropic)的标题请求未被 isDshTitleRequest 识别,同一会话在 Web UI 拆成两行 #3149 reading).users === 1→users >= 1. The veto that actually distinguishes a resend is the entry-level loop: any assistant/tool turn returns false, and every real history resend carries assistant turns; a first main turn carries exactly one user message. Widening the count therefore adds exactly the shape the old bar was written for and admits no main-turn shape (the "vetoes every main-turn shape" unit case keeps its tools / assistant-turn / no-carrier / quoted-in-user-blob / empty-content vetoes).isDshSingleShotSidecar: its "single-shot body" contract is a different (generic) gate and this report does not need it widened. Both compression modes are unaffected — this is a lane gate that runs before the pipeline, not a wire-shape change.Evidence
Targeted suites on the pushed head (Windows 11 x64, node 22.22.2):
tests/issue6104-dsh-review-sidecar-shape.test.ts(new, 6 cases) — red before the fix, green after: 2 of the 6 fail pre-fix for the banner shape and 2 for the replay shape, plus the bounded-head, CRLF, block-array, Google-carrier and veto cases.tests/issue4438-dsh-review-lane-isolation.test.ts(its two-user-message case updated to the dsh 0.2.2-rc.1: auto-review sidecar no longer matches isDshAutoReviewRequest — reviews ride the main pipeline and tombstone the fold ledger as DEAD #6104 contract, everything else untouched),tests/side-lane-invariants.test.ts,tests/side-lane-truth-table.test.ts,tests/issue5656-single-shot-sidecar.test.ts,tests/fix-1075-side-request.test.ts— all green.npm run typecheckclean,npm run buildOK,check:unused-exports+check:test-import-graphclean.Two environment notes, not claimed as green:
tests/side-request-isolation.test.tscase 34 (#1129overflow-arm restart) fails identically on unmodified master here —EBUSY: resource busy or locked, unlink …\index.dbon Windows temp cleanup; andissue4438'smain turn that quotes the review policye2e showed onefetch failedrig-startup flake and then passed 3/3 standalone. The authoritative full-suite verdict is CI on this head.On the issue's Asks
reconcileFoldCoverage/noteSystemPromptFingerprintbe skipped for requests that cannot be a resend? Agreed as the deeper invariant, but it is a separate scope with its own risk surface (the fingerprint is also the persona/|sub:key). Routing the review to the side passthrough removes the reported damage without touching the prepare path; I did not bundle it here.