Repository navigation
[PR] fix(#3838): high-cost plugin banner no longer warns for explicitly disabled cordis.patch.yml entries - #3840
Conversation
…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.
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)This exact version is immutable and reproducible. The rolling Option B — Download artifact
Install instructions are refreshed on each push. |
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.
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复。已对全部 93 个 open PR 与 #3838 线程比对:这是 #3838(高成本插件横幅无视 标签: bug, dsh, scope/ui, p3 —— 缺陷类:DSH 客户端 Web 面板横幅误报,属体验干扰,不影响可用性。 独立审核进展(自己重读 diff 与消费面,未照抄 #3838 楼层结论):
等 99468a9 的 CI 全量结果出来后给最终八问结论。 |
(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 的去重逻辑( 结构化八问(独立重审产出,未照抄 #3838 侧结论):
审核中我做的一个补充提交:原 head 5bacb41 的 CI 红在 判定:可合并。 方向正确、等价性成立、双向 gate 测试齐备(#3617)、全量 CI 绿。合并请人工操作(系统规则禁止 agent 合并 PR):#3840 |
📦 Merged Build PublishedThis merge to master was published as
|
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 incordis.patch.ymlas "enabled" and never read the entry's owndisabled: trueflag. A profile carryingstill 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 (
patchDisabledin src/host-plugin-notice.ts); the two parsers had simply drifted apart — one respecteddisabled, the other did not. Instead of copying the state machine a third time, this extracts it asparseDshPatchEntries()insrc/dsh-channel.tsand routes BOTH scans through it, so patch-layer enablement semantics have exactly one implementation.Behavior change (old → new)
cordis.patch.yml⇒ advisory fires.disabled: truedoes NOT count as enabled; the advisory fires only when at least one profile has an ENABLED entry for the loader id (cross-profile union unchanged).patchDisabled()(web UI 主动提示:检测到宿主侧计量插件(dsh-context)时告知用户其上下文口径为压缩前本地值 #2861 gate): predicate results unchanged — same outcome, now computed by the shared parser. Its three disable-semantics tests pass unmodified.Tests
tests/dsh-patch-entries.test.ts(new): 6 unit tests pinning the attribution contract — block-scoped flags, quote stripping, empty-id drop, non-indented / other-value flags ignored, non-id list items reset attribution, CRLF endings, duplicate ids kept per occurrence.tests/issue2462-plugin-advisory.test.ts: 4 new gate pairs (Test Blind Spot Retrospective: Reinforcing Negative Assertion Discipline, Tightening Fake Upstream Strictness, Thin Inst | 测试盲区复盘:补反向断言纪律、假上游严格化、薄安装冒烟、形态矩阵与生命周期覆盖 #3617 both-directions discipline) — disabled:true ⇒ NO advisory (the regression), disabled:false ⇒ still reports, unrelated-entry disable ⇒ does not silence, disabled-in-profile-A + enabled-in-profile-B ⇒ reports once.tests/issue2861-host-plugin-notice.test.ts: untouched, green (behavior preserved).Local: typecheck clean, build clean, targeted suites 39/39 on the rebased head (full-suite verdict = CI).