Repository navigation
[PR] feat: block dsh auto-review traffic by default (#4634) - #4639
ranxianglei wants to merge 9 commits into
Conversation
(ai: vllm-qwen/qwen3.8-27b) 查重:不重复。检索 open+closed issue/PR(关键词 auto-review / autoReviewBlock / 4634)唯一命中是本 PR 自身;相关条目均非同项——#4634 是原始问题(成本事故)、#4636 是同线程的 D2-1 截断诊断小修(不同机制)、#4640 是根因方向跟踪(车道无界增长/前缀缓存劣化,本 PR 明确声明不覆盖)。 标签:pr / dsh / scope/wiring / p2 —— feat 实现 owner 在 #4634 的拍板(默认拦截 dsh auto-review 流量),主机制是请求管道门控;按「确定性成本问题、会话可用」定 p2,车道无界增长部分归 #4640。 开始独立审核(不复读 PR 描述结论):拉分支核对代码 → 既有行为清单回归审查 → 测试有效性 → CI 状态(含 #4599 继承红核对)。完整八问结论随后补上。 |
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.9601-pr.4639.fbe5428This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr4639.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) 独立审核完成(未照抄 PR 描述——以下结论全部对着 diff、代码与本地实测重新验证过)。 审核中在分支上补的提交(已推送,新 head
本地定向验证(全量判定以 CI 为准):
结构化八问:
CI 状态(撰写时):新 head 判定:代码、测试、文档面均达标;唯一自引入红(种子登记缺失)已在分支上修掉并本地门禁复绿。主 CI 分片确认除继承簇外无新增红即可合并——继承红归 #4599 收敛轨道(哨兵 ci-fixes + 存储车道待拍板),不阻塞本 PR 自身变更的可合并判定。 |
…ck-banner test seam (#4639) The new block landed between the // #2645 and // #2861 seam comments in WEB_CLIENT; tests/issue2645-pck-banner-escape.test.ts slices exactly that range and executes it under a $() stub that aliases every element id to one backing store, so the autoreview block's hide-branch wiped the pck banner's innerHTML in the harness (CI red: 'escaped ids must land in the banner markup'). Moved after the #2861 host-plugin banner block — no behavior change in the real browser (distinct DOM elements), seam content restored.
(ai: vllm-qwen/qwen3.8-27b) 主车道 CI 出结果了(最终 head CI 终态(d8b63e679,28 个红项逐一归类,自引入红归零)
监控期新发现的自引入红(独立标注 commit)
四个 commit(含上条消息报过的种子登记 判定:本 PR 自身无新增红、无回归,具备合并条件;合并后主车道剩余红全部是 #4599 存量簇(等决策)+ 偶发抖动。 |
(ai: vllm-qwen/qwen3.8-27b) CI auto-fix lane 判定(attempt 1/2):无范围内可修项——不 push 任何代码。 Head d8b63e6(run 40162658807)7 个 test shard 红、共 28 项失败,已逐项核对 check 日志,分四类,均非本 PR 代码所致:
为何不合 ci-fixes:哨兵已 help-merge(floor 99,head → dcfa2d6);已验证 八问:
判定:verdict comment,不 push。等 owner A/B/C 决策 + 哨兵 ci-fixes 收敛后重跑验证。 |
(ai: vllm-qwen/qwen3.8-27b) CI auto-fix lane 最终判定(attempt 2/2,车道关闭):无范围内可修项——不 push 任何代码。 Head dcfa2d6(run 40164524872)7 个红 shard、共 29 项失败,已逐项核对 check 日志,与上一轮(同 tree,
为何不合 ci-fixes:ci-fixes tip 仍 a11e170(上轮后未变),merge-tree 内容 delta 对本 head 验证为空——纯 no-op,重跑只会再复现同样的红。 八问:
判定:verdict,不 push;auto-fix 车道(2/2)关闭。待 owner A/B/C 决策 + 哨兵收敛 ci-fixes 后重跑一次即预期转绿(flake 除外)。 |
cca55ec to
809e4ad
Compare
…ier) e209109. All 16 PR-#4634 file changes now byte-verified against the locally built tree. Repaired files: src/config.ts, src/knobs.ts, src/server/admin.ts, src/server/handle.ts, src/web/client.ts, src/web/i18n.ts, src/web/page.ts, tests/dsh-persona-fingerprint.test.ts, tests/issue4438-dsh-review-lane-isolation.test.ts, website/config-reference/env-only.yaml, website/config-reference/server.yaml
809e4ad to
8ee14d2
Compare
8ee14d2 to
e9fceeb
Compare
…arlier tree build src/server/dsh-auto-review-block.ts and tests/issue4634-auto-review-block.test.ts were absent from previous heads (build imported them => red). All 16 PR files byte-verified.
e9fceeb to
6b78cc3
Compare
…arlier tree build src/server/dsh-auto-review-block.ts and tests/issue4634-auto-review-block.test.ts were absent from previous heads (build imported them => red). All 16 PR files byte-verified.
6b78cc3 to
242c488
Compare
…arlier tree build src/server/dsh-auto-review-block.ts and tests/issue4634-auto-review-block.test.ts were absent from previous heads (build imported them => red). All 16 PR files byte-verified.
242c488 to
54dadf1
Compare
…arlier tree build src/server/dsh-auto-review-block.ts and tests/issue4634-auto-review-block.test.ts were absent from previous heads (build imported them => red). All 16 PR files byte-verified.
54dadf1 to
6396c4a
Compare
…arlier tree build src/server/dsh-auto-review-block.ts and tests/issue4634-auto-review-block.test.ts were absent from previous heads (build imported them => red). All 16 PR files byte-verified.
6396c4a to
1f01f52
Compare
Two small mechanical defects found during review, fixed on the PR branch:
- src/config.ts: the DshFileSettings doc comment was left garbled by a botched
edit — it carried BOTH the new "Live keys: authoredCompaction, contextTab/
contextTabLabel, autoReviewBlock" wording AND the stale "(irreversible), so no
opt-in remains. The one live key is authoredCompaction" text. Drop the two
duplicated lines so the sentence reads cleanly. Comment-only, zero runtime impact.
- src/web/client.ts: the new autoreview-banner block in loadOverview was nested
inside the host-plugin if(hns.length>0){...}else{...} else-branch because its
two closing braces were left at the end instead of right after the hb hide.
Result: the auto-review banner only rendered when there were NO host-plugin
notices (suppressed exactly when a high-cost host plugin coexists with blocked
reviews). Hoist it back to a sibling of the host-plugin block, matching its
indentation and the "placement outside the seams" comment. Verified: WEB_CLIENT
still parses (vm.Script); issue2645 / issue2861 / issue4634 suites green.
(ai: vllm-qwen/qwen3.8-27b) APPROVE — 方向对、范围收得住、两条门都钉了测试。我在批准前先顺手修掉了分支上的两处小机械缺陷(commit 已顺手修(均在 PR 分支,commit
结构化八问:
行为变更披露(旧→新):dsh auto-review 请求 —— 旧:转发上游、逐次计费;新:本地以零 usage 低风险裁决应答(默认 ON)。opt-out: CI 绿(镜像缓存 summary failed=0;e2e 车道 gated/skipped)。两处小缺陷已在分支顺手修掉( |
(ai: vllm-qwen/qwen3.8-27b) 复审新 head
判定不变:APPROVE(可合)。 无新增需修项。 |
(ai: vllm-qwen/qwen3.8-27b) 复审 head
可合(待 owner 人工 approve 解除 blocked)。 |
# Conflicts: # CONFIGURATION.md # CONFIGURATION.zh-CN.md # LIFECYCLE.md # src/server/handle.ts # src/web/client.ts # src/web/page.ts
…owKey The #4634 change added the autoReviewBlock live-key + updated the comment but left the old two-line comment block in place, producing a duplicated stale comment (it still read 'contextTab + contextTabLabel' without autoReviewBlock). Zero runtime impact — comment only. Cleaned up in passing while resolving the master merge conflict on this branch.
[bot] 🏷 Merge conflict resolved & pushed. I merged Why merge, not rebase: the PR history is already messy (multiple prior master-merges + a "repair rebase tree" commit that once dropped two files); the author's established pattern is merge-master (done twice); merge is non-destructive and needs only a plain push (no force) and preserves the already-approved history. A rebase risked dropping files again and rewriting approved commits. The 6 conflicts (all resolved by union — keep the PR's #4634 feature + master's concurrent work):
Verification (this run):
In-passing fix (小问题直接修, separate commit CI status (honest): the mirror cache is stale — it still shows the pre-merge head ( 结构化八问
判定:冲突已解决并推送,可进入 CI 全局把关;新 head 的 CI 在本轮无法实时验证(镜像缓存仍停在合并前的旧 head),待其跑完确认。 |
Resolve 2 conflicts in website/config-reference/{env-only,server}.yaml:
master's Japanese-docs work (#6072) added desc_ja to every seed entry at
the same lines where this PR inserts the new dsh.autoReviewBlock /
BILI_DSH_AUTOREVIEW_BLOCK entries. Resolution keeps BOTH: master's desc_ja
lines + the PR's new entries, with desc_ja added to the two new entries
(the generator requires desc_ja on every entry) and the dsh-section desc_ja
updated to list dsh.autoReviewBlock. Regenerated docs/configuration.ja.md
from the seeds (en/zh blocks unchanged).
Merge conflict resolved & pushed. I merged Why merge, not rebase: the PR history already carries two prior master-merges (the author's established pattern); merge is non-destructive, needs only a plain push (no force), and preserves the already-approved history. A rebase risked rewriting approved commits. (Push discipline: re-fetched before pushing — the remote branch was unchanged at The 2 conflicts (both in the config-reference YAML seeds): master's Japanese-docs work (#6072/#6076) added a
All resolved by union — keep master's Verification (this run):
CI status (honest): the mirror cache is stale — it still shows the pre-merge head ( 结构化八问
判定:冲突已解决并推送,新 head |
[ework] CI fix verified green ✓ |
(ai: vllm-qwen/qwen3.8-27b) 复审 head 本轮增量核验
CI(镜像缓存,sha=
八问(相对已批准版本,无功能变更)
判定:APPROVE(可合),待 owner 人工 approve 解除 blocked。正式 approve 事件仍因「作者不能批准自己账号的 PR」(GitHub 422) 机械不可用,以本评论为评审记录。 |
[ework] CI fix verified green ✓ |
# Conflicts: # src/server/handle.ts
(ai: vllm-qwen/qwen3.8-27b) Merge conflict resolved and pushed. The PR branch is now fully up to date with master — no remaining conflict. What happened this run:
One push hiccup (self-corrected): my first Live status (mirror cache, this run): head 八问(中文,供人工评审)
判定:冲突已解决、分支已与 master 对齐、可合并态(待 CI 与评审通过)。 |
(ai: vllm-qwen/qwen3.8-27b) Confirmation — task complete. (Full 八问 detail posted in my previous comment.)
Nothing further to do this run. |
Part of #4634
What & why
Every dsh auto-review call re-sends a self-contained snapshot of the main conversation (fixed REVIEW_POLICY system + one user blob) and bills it in full:
Since #4438 these requests ride the stateless passthrough lane (no session pollution), but they are still forwarded and billed per call. Owner direction in #4634: block by default, notify through several channels, provide an opt-out, settable from the web.
How it works
dshReviewSidecarinsrc/server/handle.ts): shape-detected review request (isDshAutoReviewRequest) + live dsh stamp OR sticky session binding. No new detection surface, no false positives beyond what [Bug][dsh] 0.1.204: auto-review side request collides with the main session → false native-compaction rebase → aux usage skips #453 clamp → permanent upstream 400 #4438 already routes.{"risk":"low","decision":"allow"}(finish=stop, zero usage in every wire shape) instead of being forwarded. Tools execute unchanged, agent behavior unchanged.readDecision()and dsh denies EVERY tool call under the Auto preset. The verdict above passesparseDecision;AUTO_REVIEW_BLOCK_TEXTinsrc/server/dsh-auto-review-block.tsis the one-line swap point if a better payload is ever found.autoreview-banner) ·/__bili/statusoverview fieldautoReviewBlock: {enabled, blockedCount, savedEstTokens}.config surface
New key
dsh.autoReviewBlock(boolean, default true) under the existingdshsection, env twinBILI_DSH_AUTOREVIEW_BLOCK(env > file > default, per-request hot read), documented in CONFIGURATION.md en+zh. Settable from the web config page (raw-file editor path preservesdsh.*keys, no writer change needed).Why the existing surface cannot express it: the
providerstable and thecompresshierarchy govern upstream routing/compression decisions; this is a traffic-class gate on an identified host-side side lane, which has no home there (the precedent isdsh.authoredCompaction, same section, same pattern).Compat/migration: nothing to migrate — absent key = old behavior would NOT be preserved (see below); users who want forwarding restore it explicitly.
Behavior change (old → new)
dsh auto-review requests: forwarded upstream and billed per call → answered locally with a zero-usage low-risk verdict (default ON). This is the intended fix of #4634's cost problem, per owner direction. Opt-out:
dsh.autoReviewBlock=falseorBILI_DSH_AUTOREVIEW_BLOCK=0. Note for users: turning OFF dsh auto-review itself migrates active Auto sessions to full access (danger-full-access) — less strict, not more strict (stated in the panel banner text).No other wire/session/stats surface changes: main-lane traffic untouched, non-dsh clients untouched, explicit
x-bili-plugin-agent: mainveto untouched, session state untouched (the block returns before any pipeline stage).Tests
tests/issue4634-auto-review-block.test.ts(new, 14 tests, both gate directions per #3617):tests/dsh-persona-fingerprint.test.ts); google wire fall-through;x-bili-plugin-agent: mainveto forwards;tests/dsh-persona-fingerprint.test.ts: one module-levelBILI_DSH_AUTOREVIEW_BLOCK="0"so that suite keeps pinning the #4438 LANE contract (stateless passthrough forwarding) while this PR pins the new DEFAULT — the two suites cover complementary behaviors instead of colliding.Labeled incidental fix (same commit, clearly separate concern):
pluginadv.descwording still described the pre-#4438 sub-session isolation ("隔离到独立子会话" / "isolates into a separate sub-session"); corrected to the stateless-passthrough fact (en+zh).CI note
4 tests in
tests/dsh-persona-fingerprint.test.ts(openai/responses/google/cross-lane #4438 contract) are born-red on current master — verified identical failure set on a clean tree without this PR's changes (part of the #4599 born-red cluster; converging on ci-fixes via the sentinel). Not a regression of this PR.