Skip to content

[PR] fix(#3838): high-cost plugin banner no longer warns for explicitly disabled cordis.patch.yml entries - #3840

Merged
ranxianglei merged 2 commits into
masterfrom
2026-10-19_fix-3838-disabled-patch-alert
Oct 19, 2026
Merged

ranxianglei merged 2 commits into
masterfrom
2026-10-19_fix-3838-disabled-patch-alert

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Fixes #3838

What

The high-cost plugin banner (#2462) kept warning for a plugin the user had explicitly turned off: detection counted ANY top-level - id: entry in cordis.patch.yml as "enabled" and never read the entry's own disabled: true flag. A profile carrying

- id: auto-review
  disabled: true

still fired the orange high-cost-plugin banner on every page load (reporter: bili 0.1.201, DSH Desktop, Windows).

Why this shape

The sibling #2861 host-plugin notice already implemented the correct block-scoped state machine (patchDisabled in src/host-plugin-notice.ts); the two parsers had simply drifted apart — one respected disabled, the other did not. Instead of copying the state machine a third time, this extracts it as parseDshPatchEntries() in src/dsh-channel.ts and routes BOTH scans through it, so patch-layer enablement semantics have exactly one implementation.

Behavior change (old → new)

Tests

Local: typecheck clean, build clean, targeted suites 39/39 on the rebased head (full-suite verdict = CI).

…ml entries

The high-cost plugin banner (#2462) fired whenever the loader id appeared as a top-level entry in any profile's cordis.patch.yml — an explicitly disabled plugin (entry + 'disabled: true') kept warning forever, because dshEnabledPatchIds() only collected '- id:' lines and never read the disable flag. The sibling #2861 host-plugin notice already implemented the correct block-scoped state machine; the two parsers had drifted apart.

Fix: extract that state machine as parseDshPatchEntries() in dsh-channel.ts (single source of truth for patch-layer enablement semantics) and route BOTH scans through it — the advisory now skips entries whose own block carries an indented 'disabled: true', and patchDisabled() keeps its exact behavior (pinned by the #2861 suite).

Tests: 6 parser unit tests pinning the attribution contract (block scoping, quote stripping, CRLF, duplicate ids, non-indented/other-value flags); 4 advisory gate pairs — disabled:true yields no advisory (the regression), disabled:false still reports, unrelated-entry disable does not silence, cross-profile union still reports once.
@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-19_fix-3838-disabled-patch-alert (99468a9)

Option A — Install this exact build (recommended)

npm install -g billion-context@0.0.4538-pr.3840.3ddbb98

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

Option B — Download artifact

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

Install instructions are refreshed on each push.

@ranxianglei ranxianglei changed the title fix(#3838): high-cost plugin banner no longer warns for explicitly disabled cordis.patch.yml entries [PR] fix(#3838): high-cost plugin banner no longer warns for explicitly disabled cordis.patch.yml entries Oct 19, 2026
CI job unused-exports (scripts/check-unused-exports.mjs, #1440 P6) flagged
the new DshPatchEntry interface as INTERNAL_ONLY: both consumers
(host-plugin-notice.ts, plugin-advisory.ts) use the shape structurally
through parseDshPatchEntries() without importing the type name, and the
unit tests pin it with plain object literals. Dropping the export matches
the #3806 treatment (62d47dc kept its interface module-local for the
same gate). No behavior change.
@ranxianglei ranxianglei added bug Something isn't working dsh p3 scope/ui labels Oct 19, 2026
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

查重: 不重复。已对全部 93 个 open PR 与 #3838 线程比对:这是 #3838(高成本插件横幅无视 disabled: true)的唯一 PR。标题相近的 #3820(dsh compaction overlay latch 告警)、#3653(takeover-broken 横幅误报)都是不同横幅、不同代码路径,无共享机制。

标签: bug, dsh, scope/ui, p3 —— 缺陷类:DSH 客户端 Web 面板横幅误报,属体验干扰,不影响可用性。

独立审核进展(自己重读 diff 与消费面,未照抄 #3838 楼层结论):

  1. 代码审核通过,方向正确。 把 web UI 主动提示:检测到宿主侧计量插件(dsh-context)时告知用户其上下文口径为压缩前本地值 #2861 已有的块级状态机抽成唯一的 parseDshPatchEntries(),两个扫描都走它——比复制第三份状态机好。逐项验证了新旧等价性:patchDisabled() 旧实现对空 id 用空串做 current,而谓词永远匹配不到空串,统一后结果不变;advisory 侧唯一行为变化就是「自身块带缩进 disabled: true 的条目不再计为启用」,与修复目标精确一致,跨 profile 并集与 5 分钟缓存均未动。独立 grep 了全部消费方:detectCostAdvisories 只被 src/server/admin.ts:950(status)与 :1002(overview)两处只读调用,纯面板展示面,wire/持久化/config/kernel 零触碰。
  2. 本地验证(rebase 到 master 后的 head):typecheck clean、build clean、定向测试 39/39(含 web UI 主动提示:检测到宿主侧计量插件(dsh-context)时告知用户其上下文口径为压缩前本地值 #2861 三个 disable 语义测试原样通过)。PR base 之后 master 只动了 CI 工作流与 pi-subagents 文件,与本 PR 的 5 个文件零重叠,「behind」不构成冲突。
  3. 发现一处 CI 红,已直接修掉:head 5bacb41 上 unused-exports job 失败——新增的 export interface DshPatchEntry 只在声明文件内被引用(两个消费方结构化使用、测试用对象字面量),gate 判 INTERNAL_ONLY。作者本地验证覆盖了 typecheck/build/定向测试,但没跑这个 CI 专属脚本。按 gate 自己的建议修(与 Compression conflict banner (bili v0.1.201, node v24.14.0, win32-x64) #3806 的处理 62d47dc 一致):去掉 export 改 module-local,一行改动、零行为变化,已作为独立标注 commit 推到 PR 分支:99468a997。本地复跑 gate 干净 + 定向套件 39/39。

等 99468a9 的 CI 全量结果出来后给最终八问结论。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

CI 全量结果已出,最终结论如下。

CI 状态(head 99468a9):主 CI 全量跑绿——19/20 job success(唯一 skip 是 red-signal,常态),含全部 6 个 test 分片(ubuntu 22×3、ubuntu 24×1、windows 22×2)、unused-exports、全部 guard;11 个独立工作流(e2e codex/pi/dsh/opencode 各真实客户端 lane、registry、build artifact)全部 success。后续重复触发的 run 按 ci.yml 的去重逻辑(LAST == HEAD_SHA ⇒ scope=skip)自动跳过矩阵并记 success,属设计内行为。唯一红点 .github/workflows/ci-gate-plugins.yml(push 事件、0 job)在旧 head 5bacb41 上同样失败(13:17 的 push-run),与本次 diff 无关,正是 #3715 记录的零 job 幽灵红,已有修复 PR 在途,不在本 PR 处理也不重复立项。

结构化八问(独立重审产出,未照抄 #3838 侧结论):

  1. 是什么问题:用户在 cordis.patch.yml 里用 disabled: true 明确关掉的插件,bili-issue-0.1.188-sub-session-cache-regression #2462「高成本插件」橙色横幅仍在每次页面加载时误报。
  2. 什么原因导致的:同一套 patch 层启用语义存在两份漂移的实现——web UI 主动提示:检测到宿主侧计量插件(dsh-context)时告知用户其上下文口径为压缩前本地值 #2861 host-plugin 通知侧的 patchDisabled() 有正确的块级状态机,而 bili-issue-0.1.188-sub-session-cache-regression #2462 成本通知侧的 dshEnabledPatchIds() 只平铺收集 - id: 行、从不读条目自身的 disabled 标志。
  3. 影响范围与严重程度:仅影响横幅展示面(detectCostAdvisories 只有 admin.ts:950 status 与 :1002 overview 两个只读调用点)。触发条件:profile 的 cordis.patch.yml 存在带 disabled: true 的条目且该插件命中高成本清单。程度为体验干扰(p3),不影响任何功能与数据。
  4. 怎么修复的:不复制第三份状态机,把 web UI 主动提示:检测到宿主侧计量插件(dsh-context)时告知用户其上下文口径为压缩前本地值 #2861 的正确实现抽成 src/dsh-channel.ts 的唯一 parseDshPatchEntries(),两个扫描都路由过去——patch 层启用语义从此单一实现。逐项验证了新旧等价性:patchDisabled() 对空 id / early-return vs .some() / 跨 profile 并集 / 5 分钟缓存全部不变;唯一行为变化就是「自身块带缩进 disabled: true 的条目不再计为启用」,与修复目标精确一致。
  5. 是否有回归问题:无。web UI 主动提示:检测到宿主侧计量插件(dsh-context)时告知用户其上下文口径为压缩前本地值 #2861 三个 disable 语义测试原样通过;advisory 只读契约(检测失败不得拖垮页面加载)未动;wire/持久化/config/kernel 零触碰;PR base 之后 master 的变更(CI 工作流 + pi-subagents)与本 PR 5 个文件零重叠,无跨分支交互。
  6. 是否破坏缓存:不涉及。5 分钟扫描缓存键与策略未变,wire 前缀缓存不受影响。
  7. 是否改了设计方向:没有。这是两份漂移实现的收敛,不是新方向。
  8. 是否引入新配置:无。

审核中我做的一个补充提交:原 head 5bacb41 的 CI 红在 unused-exports gate(新增的 export interface DshPatchEntry 只被本文件引用,判 INTERNAL_ONLY;作者本地验证没覆盖这个 CI 专属脚本)。已按 gate 建议与 #3806 先例(62d47dc)去掉 export 改 module-local,一行改动零行为变化,独立标注 commit 99468a9 推到 PR 分支,本地复跑 gate 干净 + 定向套件 39/39,CI 已绿。

判定:可合并。 方向正确、等价性成立、双向 gate 测试齐备(#3617)、全量 CI 绿。合并请人工操作(系统规则禁止 agent 合并 PR):#3840

@ranxianglei
ranxianglei merged commit c77e221 into master Oct 19, 2026
77 of 114 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

📦 Merged Build Published

This merge to master was published as 0.0.607-master.c77e221 (rolling master tag).

npm install -g billion-context@0.0.607-master.c77e221  # 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 p3 scope/ui

Projects

None yet

1 participant