Skip to content

[PR] 2026 11 09 iot incompat notice upstream - #6015

Merged
ranxianglei merged 4 commits into
ranxianglei:masterfrom
El1mir:2026-11-09_iot-incompat-notice-upstream
Nov 9, 2026
Merged

ranxianglei merged 4 commits into
ranxianglei:masterfrom
El1mir:2026-11-09_iot-incompat-notice-upstream

Conversation

@El1mir

@El1mir El1mir commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

对应issue #6014

增加了与dsh-plugin-iot-thinking共用时的消息提示

防止出现首字几倍拉长和出现锯齿缓存却不知道问题出现在哪的情况:
QQ_1794209992183

效果图:
image

同时:修复了 #5548 统一通知渲染循环缺 .show 类导致所有通知(内置/本地文件/远程 feed)在 Web 面板上始终不可见;

iot-thinking issues its own extra compress/rewrite model call after every
reply; both calls share one session lane, so the step keeps waiting seconds
to tens of seconds after its first byte (measured: the extra request shape
was 44% of one session's requests, p50 ~7s, and vanished when the plugin was
disabled). Owners could not see the cause from bili's side.

Register a fourth builtin notice (KDD ranxianglei#16 surface, no new channel):
- src/notice-store.ts: iot-incompat id + dismissal allowlist
- src/notices.ts: probeDshIotThinking scans dsh profile dirs for
  node_modules/dsh-plugin-iot-thinking (never throws; advisory)
- src/web/i18n.ts: en/zh copy
- tests: registry id/allowlist rows + hermetic detection/dismissal suite
Installed-but-disabled is the healthy state: the plugin's extra rewrite call
is what produces the post-first-byte wait, and turning it off removes it.
Gate the notice on the plugin's own effective switch instead of bare
presence (missing/broken config keeps the plugin default, enabled).

Verified on the owner's machine: installed=true, enabled=false ⇒ active=false.
@ranxianglei ranxianglei changed the title 2026 11 09 iot incompat notice upstream [PR] 2026 11 09 iot incompat notice upstream Nov 9, 2026
… as catalog keys

PR ranxianglei#6015 red CI (shards ubuntu/24/3, ubuntu/22/3, windows/22/4, all the same
subtest): ranxianglei#1024 'every referenced key exists in both locales' failed with
'referenced key missing from zh catalog: package.json'.

collectRefs()'s lenient bare-string rule (ranxianglei#5345) accepts any dot-quoted token
as a live i18n reference; the new notices.ts probe writes the literals
"package.json" / "config.json", which the rule misreads as keys. Drop
tokens whose final segment is a file extension from that rule only — explicit
t()/tr()/data-i18n references stay authoritative, and the two segments already
proven to be key suffixes (summary.key, det.log) are kept out of the exclusion.
@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

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

PR #6015 审核结论:可合并(人工合)。 已本地装齐依赖跑通定向测试 + typecheck;下面是结构化八问。

1. 是什么问题:两件事——①按 #6014 的要求给 dsh 的 iot-thinking 插件加 Web 面板冲突提示(它会在每次模型回复后串行发一轮额外压缩请求,拉高首字等待并造成锯齿状缓存命中);②顺手修 #5548 统一通知渲染循环漏加 .show 类、导致所有内置通知在面板上一直不可见的 bug。

2. 什么原因导致的:①是 #6014 报告的能力缺失(作者已按其建议实现「检测到已安装且启用 → 弹提示」);②是 #5548 落地时的真实缺陷——循环里 el.className = "banner …" 之后没补 .show,而 CSS 是 .banner{display:none} / .banner.show{display:block},所以走这条统一循环的通知(pck-default-off / wm-fastpath-intro / 以及新加的 iot)全程 display:none,等于从没显示过。

3. 影响范围与严重程度:①纯新增提示,仅当用户装了 dsh-plugin-iot-thinking 且未在其 config 关掉时才出现、可关闭,不装则完全无感;②影响面是「所有统一通知在 Web 面板不可见」——体验缺陷(通知形同虚设),非数据/可用性问题,定级偏 p2(能用、只是看不到提示)。注意:不修 ②,新的 iot 提示自己也显示不出来,所以两者必须一起上。

4. 怎么修复的:①把 iot-incompat 注册进 KDD#16 的统一 NOTICES 注册表(active = 未关闭 && 已安装 && 仍启用),复用统一关闭存储(UPGRADE_NOTICE_IDS)与统一渲染循环,zh/en 各补 4 个 i18n key;检测对每个 dsh profile 查 node_modules 下该包是否存在,再读全局 <DSH_HOME>/plugin-data/iot-thinking/config.json 判断 enabled,任何读失败都 fail-safe 成「视为启用 → 显示」,且 visibleNotices() 对每条 active 有 try/catch,绝不让探测拖垮页面加载。②一行 el.classList.add("show")。

5. 是否有回归问题:唯一行为变化是 ②把「内置通知不可见」改成「可见」,而这正是 #5548 批准设计的本意(旧值 = 全部 display:none,新值 = active 通知可见;属修 bug 恢复意图,非漂移)。审过的既有行为:host-plugin 横幅(#2861)、status 的 up-notices 列表都是独立元素 / 独立代码路径,不受影响;overview 的 d.notices 只有这一处消费,无双渲染;新通知对既有 pck/wm 无副作用(独立 id、独立关闭)。高危模式逐项过:无阈值/时序/输出格式漂移,无 fail-fast 变吞错(相反加了 try/catch),无缓存/重试改动。

6. 是否破坏缓存:不涉及。纯展示层 + dsh 插件状态探测(fs stat/read),不碰压缩 / 前缀缓存 / 增量车道 / 水位。

7. 是否改了设计方向:不涉及架构转向。新通知严格落在 KDD#16 统一通知面(一个注册表 / 一套关闭 / 一套渲染),没另起炉灶;与 #2861 host-plugin 面、thirdparty-scan 关键词面不同症状不同机制,不会重复触发(dsh-plugin-iot-thinking 既不匹配 KEYWORD_RE 也不在 KNOWN_HOST_PLUGINS 白名单里)。

8. 是否引入了新的配置:不涉及。没有新增 env / BILI_* / 配置字段;只读 dsh 侧已有的插件目录与其 config.json。

一个非阻塞点(建议作者确认):安装检测是按 profile 扫 node_modules,但「是否启用」只读全局单一路径 <DSH_HOME>/plugin-data/iot-thinking/config.json。若 dsh 实际按 profile 分存该 config,多 profile 场景可能读不到——不过失败方向保守(读不到就视为启用 → 照常提示),最多是可关闭的误报,不会漏报,故不拦。

本地验证证据:全量装依赖后跑定向测试 tests/iot-incompat-notice.test.ts(6)+ tests/notice-registry.test.ts(4)= 10/10 通过;npm run typecheck 干净(exit 0)。新测试不 spawn 进程,无需进 LIVE_FILES,glob 自动发现;未改任何配置面。

CI 现状(镜像缓存实时读):30 项检查 0 failed / 14 pending,快速静态门已过(unused-exports、lifecycle-ledger-guard、pi-subagents-guard、test-import-graph、docs-sync 均 success),test 分片与 static-gates 仍在排队/运行中——最终绿红以 CI 为准。

判定:可合并(人工合)。方向正确(#6014 明确点名要这个能力且声明已完成开发)、diff 干净聚焦(7 文件 +154/-7)、测试有牙、无回归、唯一行为变化已如实披露。

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

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

CI red fixed — all 30 checks now pass on head 8d202c38b9 (verified via live check state at 08:51 UTC: 18 success + 12 skipped, 0 failure, including the previously red test (ubuntu-latest, 24, 3), test (ubuntu-latest, 22, 3) and test (windows-latest, 22, 4)).

What was red. All three failing shards died on the same subtest: #1024: every referenced key exists in both locales and no catalog key is dead (tests/web-i18n.test.ts), asserting referenced key missing from zh catalog: package.json.

Root cause. collectRefs() in that test has a lenient rule (added for #5345's pair-array labels) that accepts ANY dot-quoted token appearing verbatim in src/web/page.ts, client.ts, report.ts, notices.ts as a live i18n-key reference. The new notice probe in src/notices.ts writes the filesystem literals "package.json" and "config.json" — dotted shapes the rule misreads as catalog keys, so the parity assertion fails. It would have failed on config.json next even after fixing the first token.

Fix (one commit, test file only, pushed to the PR branch): test(web): stop i18n ref scanner treating filenames like package.json as catalog keys (8d202c38b9). The lenient rule now skips tokens whose final segment is a file extension (json, db, pem, yml, …). Explicit references (t("…"), tr(…, "…"), data-i18n="…") stay fully authoritative; the two segments already proven to be key suffixes in this codebase (summary.key, det.log) are deliberately kept OUT of the exclusion, and both keys are referenced through the explicit t() rule anyway — verified no real key is dropped (all 742 catalog keys still resolve in both directions of the assertion).

No source/runtime change, no new config, no behavior drift. Verified locally before pushing: reproduced the exact failure, then tests/web-i18n.test.ts 11/11, the PR's own tests/iot-incompat-notice.test.ts + tests/notice-registry.test.ts green, repo typecheck clean. Pushed fast-forward (fetched remote head first — no concurrent work on the branch).

Note: the PR head is currently behind master (mergeable state behind, no conflict) — that's not a CI failure and needs no action from this lane.


八问(结构化结论)

  1. 是什么问题:PR [PR] 2026 11 09 iot incompat notice upstream #6015 的三个测试分片(ubuntu 24/3、ubuntu 22/3、windows 22/4)红——同一个守护测试 #1024: every referenced key exists in both locales and no catalog key is dead,断言报 referenced key missing from zh catalog: package.json。
  2. 什么原因导致的:tests/web-i18n.test.ts 的 collectRefs() 有一条为 [PR] (ai: anthropic/claude-opus-4-6) Settings panel pack editor: guided form (per-field descriptions + base template loading) | (ai: anthropic/claude-opus-4-6) 设置面板 pack 编辑器:引导式表单(逐字段说明+底本载入)+ AI 辅助提示词生成,原始 JSON 降为高级页签 #5345(pair-array 标签)引入的宽松规则——把四个扫描文件里任何「点分隔引号字符串」都当作 i18n key 引用;本 PR 在 src/notices.ts 新增的文件名字面量 "package.json" / "config.json" 恰好是点分隔形状,被误判成目录 key。
  3. 影响范围与严重程度:只影响该守护测试本身(误报),不影响任何运行时行为与用户功能;严重度 = PR 被 CI 卡住无法合并。
  4. 怎么修复的:只改 tests/web-i18n.test.ts 一处——宽松规则跳过「末段是文件扩展名」的 token;显式引用规则(t()/tr()/data-i18n)不受影响;summary.key、det.log 这两个已被证明是 key 后缀的段不进排除集,且二者本就经显式 t() 引用,实测 742 个现有 key 双向断言全部保持成立。
  5. 是否有回归问题:无。审计过的既有行为:Web UI 英文翻译开关(i18n)— 社区 PR #807 (@amirzamli) #1024 的两个方向(引用必须存在 / 目录 key 不得死)对全部现有 key 结论不变(本地 11/11 复验);未触碰任何 src/ 运行时代码;typecheck 干净;本 PR 自带的两个通知测试均绿。高危模式逐项过:无语义漂移、无阈值/时序/输出格式变化。
  6. 是否破坏缓存:不涉及(纯测试文件改动,不碰缓存/重试/增量游标逻辑)。
  7. 是否改了设计方向:无。
  8. 是否引入了新的配置:无。

判定:CI 全绿,可进入正常 review/合并流程(提醒一句:分支落后于 master,合并前建议作者 rebase)。

@ranxianglei
ranxianglei merged commit 63a4060 into ranxianglei:master Nov 9, 2026
48 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.1116-master.63a4060 (rolling master tag).

npm install -g billion-context@0.0.1116-master.63a4060  # 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.

ranxianglei pushed a commit that referenced this pull request Nov 9, 2026
… to clean

Follow-up sync: master advanced 5 commits (web/i18n/notice work, #6015 et al.)
past the previous sync base; none touch src/launcher.ts or scripts/live-files.mjs,
so this is a conflict-free auto-merge bringing the PR to mergeable_state=clean.
Louie0806 added a commit to Louie0806/billion-context that referenced this pull request Nov 9, 2026
…incompatibility notice

Master moved five commits (8 files) under the notice-registry surface:
1c069c6 adds `src/pck-notice.ts` plus `src/notice-store.ts`/`src/notices.ts`
wiring, 65fcba1ba narrows the warning to enabled installs, 549bc54 restores
the built-in notice banners' `.show` class, 8d202c3 stops the i18n ref
scanner treating filenames like `package.json` as catalog keys, and 63a4060
is the PR merge.

Zero overlap with this lane's 17 files; the only shared directory is `src/web/`
and the two sides touch different files there (`i18n.ts`/`client.ts` upstream,
none of mine). Nothing of mine was touched.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants