Skip to content

[PR] feat(web): changelog section — per-release notes from GitHub Releases (#3719) - #4152

Merged
ranxianglei merged 12 commits into
masterfrom
2026-10-21_web-changelog
Oct 23, 2026
Merged

ranxianglei merged 12 commits into
masterfrom
2026-10-21_web-changelog

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Fixes #3719

这是什么

Web 面板新增「更新日志」区块:自动拉取 GitHub Releases 每个版本的发布说明,用户点开就能看到更新了啥,附 GitHub 链接;/acp 命令尾部同步显示最新版本号+链接。填补 critical 横幅(只弹严重版)之外的常规更新通道。

改动(8 文件 +407/−0)

  • src/web/changelog.ts(新):GitHub Releases 拉取+缓存。10 分钟节流(失败也节流,离线机器不打扰)、inflight 去重、失败保留旧视图、永远 HTTP 200({releases:[],error:"offline"})、stopIdleTimer() 守 billion-context: 400 Bad Request when codex sends role: "developer" messages — request a request-body compat transform hook #552 契约
  • src/server/admin.ts:GET /__bili/changelog,与其他只读 __bili GET 同一鉴权链(loopback/trusted-origin 先于分发)
  • src/web/page.ts+client.ts+styles.ts:总览页折叠卡片,首版本默认展开;正文 escapeHtml 后做 URL 链接化(函数式 replacer 防 $/& 注入),零 markdown 依赖
  • src/web/i18n.ts:6 键 ×zh/en(en 无汉字按 web-i18n 钉)
  • src/plugin.ts:/acp 尾行 changelog: <tag> <url>——同步读缓存(status 路径零网络);每进程一次后台 warm-up,fail-silent
  • tests/web-changelog.test.ts(新):8 测试——字段映射/排序/20 上限/坏行跳过/节流+force/失败永不抛+节流/旧视图保留恢复/HTTP 500 与非数组

设计边界

  • 零新 config、零新 env、零新依赖(配置面 owner-gated,本功能不需要)
  • 网络暴露面:代理进程请求 api.github.com(每 10 分钟最多 1 次),与既有 npm update check 同级;UI 链接直达 GitHub
  • /acp 尾行只在缓存已暖时出现(首查后台进行,下次 status 出现)

验证

  • tsc --noEmit 0 错;web-changelog 8/8、web-i18n 10/10、admin-origin 4/4;全部 web-* 130/130;npm run build 过
  • 真机冒烟:起真代理 → GET /__bili/changelog → 200 + 20 版本(v0.1.203 正文 22973 字符与 GitHub Release 一致)

实现由 worker delegate (ai: vllm/qwen3.8-27b) 完成,主会话 (ai: zhipuai-lb/glm-5.3) 审阅 diff、复跑测试并冒烟验证。

@ranxianglei ranxianglei changed the title feat(web): changelog section — per-release notes from GitHub Releases (#3719) [PR] feat(web): changelog section — per-release notes from GitHub Releases (#3719) Oct 21, 2026
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-21_web-changelog (fcd8ffe)

Option A — Install this exact build (recommended)

npm install -g billion-context@0.0.5170-pr.4152.a16d88c

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-pr4152.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei

Copy link
Copy Markdown
Owner Author

(ai: zhipuai-lb/glm-5.3)

扩展提交 5cff125(同 qwen worker 实现、主会话独立复验):独立的「更新 / Updates」导航 tab,与总览/会话/设置并列:

  • 当前版本卡:running/disk/最新已知/上次检查时间 + 「立即检查更新」按钮(POST /__bili/update/check,与后台更新循环共用同一把锁/节流/代理闸)
  • 推送信息卡:companion 发版分级通知(critical/recommended 徽章+摘要+日期)
  • 版本操作卡:「立即升级到 vX」+ 版本下拉(GitHub Releases)+「安装所选版本」;选旧版本弹回退确认;装完提示「重启宿主后生效」
  • changelog 卡片从总览挪入本 tab;/acp 尾行不变
  • 安全链全部复用现成机制:forceInstallVersion(搞一个自动强制更新,针对重大bug的版本 #1481)跨进程锁/备份回滚/auto-update overwrites tracked files when run from a git source checkout (findInstallDir resolves to repo root) #580 source-checkout 拒绝/native模式下自动更新问题需要解决 #991 host 托管拒写;版本入参字符集白名单(400 拒 "1.0.0; rm -rf")
  • 不改 src/update.ts(只 import);cli.ts 仅一处:把 startAutoUpdate 的 opts 提成 const 同对象传 registerUpdateActions,行为不变
  • 新增 8 文件面:update-actions.ts(151 行)+admin 三端点+web 四文件+tests/web-updates.test.ts(5 用例);i18n 25 键×zh/en

主会话复验:tsc 0 错;27/27 测试;build;真机冒烟——GET /__bili/update/state 返回正确快照;坏版本形状 400;合法版本在源码 checkout 上被 #580 守卫正确拒绝(预期行为,真 npm 安装上才会执行);面板 HTML 含新 tab 全部元素。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

CI 修复完成 + 剩余红分片取证结论

修复:去掉 4 个类型声明的 export 前缀——src/web/changelog.ts 的 ChangelogRelease/ChangelogData、src/server/update-actions.ts 的 UpdateNotice/UpdateStateSnapshotData。四个类型全仓 grep 确认仅本模块使用(无任何其他文件含测试 import)。commit 987a3ab9a 已推到 PR 分支,unused-exports job 转绿,其余静态门与全部 e2e workflow 均绿。

剩余红:只剩 test (windows-latest, 22, 2)。已重跑 3 次全红,受害测试每次轮换:issue760 waitFor 超时 → #4079 事件循环 drain + #3818⑨ → #4079 再犯 + #2317 + #2399/#2469 adoption 族。对照实验:master 自身同一时间窗在同样 shard 红掉(run 39597779204,#3818⑥ same-tick 断言)。结论:严格时序断言被共享 Windows runner 高负载下的事件循环延迟打穿——环境问题,与本 PR 代码无关:

  • 本 PR 相对 base 的增量是纯类型级(类型编译期擦除,零运行时影响);
  • 前一 head(5cff12523)跑过全部分片绿,证明 PR 其余行为本来就是绿的;
  • 红分片涉及的文件(storage-full-flip / persist / web)自 base 以来未被任何 master 提交触碰。

已立项 #4161 跟踪(标签 bug + scope/ci + p2),附完整观测表与三个候选修法(逐个加固受害测试 / 把这类形状加入 run-ci-tests.mjs 的有界重试分类 / 组合)供拍板。其中 #4079-egress-window-fuse 在 4 个分片流里中 3 次,是最脆的一个。

建议:runner 池恢复后人工 rerun 一次即可(或等 #4161 落地后 rerun);master 自身红着时继续烧 rerun 收益很低。


八问

  1. 是什么问题:PR [PR] feat(web): changelog section — per-release notes from GitHub Releases (#3719) #4152 的 CI unused-exports 门红——新增 4 个类型导出了但只在模块内用;修复后暴露出第二个既有问题:windows node22 shard 2 测试分片因环境负载时序 flake 反复红。
  2. 什么原因导致的:① 门失败 = 4 个 export 是死对外面(模块内自用);② 红分片 = 严格时序断言(waitFor ~5s 预算 / same-tick / safety-valve 窗口)在共享 runner 高负载下被事件循环延迟打穿,受害者随运行轮换;master 同窗同 shard 也红,钉死是环境因素而非本 PR。
  3. 影响范围与严重程度:门修复只影响本 PR(类型级,零运行时影响)。红分片影响所有调度到该 shard 的 CI——每次命中浪费 ~30min 并阻塞对应 PR/master 合并;今天 3 小时内命中 4 个分片流(含 master 自身)。严重度 p2(有绕行 = rerun)。
  4. 怎么修复的:去掉 4 个类型的 export(commit 987a3ab,独立 commit,不动其他行);红分片超出本次任务范围 → 立项 CI: windows-latest node-22 shard 2 intermittently red on timing-sensitive e2e tests under load (rotating flakes: issue760, #4079, storage-full-flip #3818) #4161 跟踪,修法方向待 owner 拍板。
  5. 是否有回归问题:无。审计清单:删除前全仓 grep 确认 4 类型无外部 import;本地 tsc 0 错 / build 过 / 定向测试 13/13 过(web-changelog + web-updates);前一 head 全测试分片绿;无语义变化。高危模式逐项过:无语义漂移、无 fail-fast 变吞错、无阈值/时序/输出格式变化。
  6. 是否破坏缓存:不涉及——未触碰任何缓存/重试/游标/去重逻辑。
  7. 是否改了设计方向:否。
  8. 是否引入了新的配置:否。

判定:unused-exports 修复完成且可验证(job 绿);剩余红为环境性 flake(master 对照实验同红 + 受害者轮换 + diff 纯类型级三重证据),已立项 #4161。建议 runner 池恢复后 rerun 一次收尾。

@ranxianglei

Copy link
Copy Markdown
Owner Author

(ai: zhipuai-lb/glm-5.3)

Round 2 of the #3719 polish, now on this branch (commit 771d62c):

  • changelog card opens by default; 「全部展开 / 收起全部」 action row at the bottom
  • version select jumps to that release (expand + scroll into view + flash highlight)
  • release bullets grouped into fixed-order categories with counts (新功能/缺陷修复/压缩引擎/宿主车道/存储与会话/自更新与发版/Web UI 与文档/构建·CI·测试/其他), empty groups skipped
  • carried bug fixes from the earlier working session: mutable paragraph buffer (a reassignment TypeError was being swallowed by loadChangelog's catch and rendered as the offline wording), well-formed <details> open tag, bold **… rendering in intro paragraphs

Verification on the pushed head: tsc clean, web-changelog/web-updates/web-i18n/admin-origin 27/27, build OK, live CDP DOM dump (first=SUMMARY, dOpen=true, clean serialization) + zh screenshot.

Note: these edits were first made in the shared checkout which was force-moved by the v0.1.204 release flow (uncommitted work lost); they were rebuilt byte-for-byte from the captured served page in an isolated worktree and re-verified end-to-end before pushing.

ranxianglei and others added 7 commits October 23, 2026 00:46
…#3719)

- GET /__bili/changelog: GitHub Releases API (per_page=20), in-memory cache,
  one network hit per 10 minutes (mirrors update-notes throttle discipline);
  fail-soft — offline/HTTP/malformed failures return 200 {releases, error:"offline"}
- web panel overview page: collapsible 更新日志 / Changelog card, per-release
  expandable notes (escaped plain text + URL links, no markdown dependency),
  GitHub links; bilingual i18n
- /acp panel footer: 'changelog: <tag> <url>' line once the cache is warm
  (sync read only; once-per-process background warm-up, fail silent)
…3719)

A nav tab parallel to config/connect holding everything self-update:
running/disk version + last-check time, pushed release notices with
tier badges, a forced check now, upgrade-now and install-specific-
version actions (a selection below the running version confirms as a
rollback), plus the changelog card moved here from overview.

src/update.ts stays untouched: the new update-actions module only holds
the process's UpdateOptions (registered once by the CLI alongside
startAutoUpdate on the SAME object) and calls its existing exports —
checkForUpdate(force) / forceInstallVersion / readDiskVersion /
lastUpdateCheckTime — each behind an in-flight dedupe flag. Three new
admin-gated routes (/__bili/update/state|check|install) follow the
existing POST 400 shape and the DNS-rebinding origin gate.
…3719)

Round-2 polish of the Updates tab, re-played in an isolated worktree
after the shared checkout was force-moved by the v0.1.204 release flow
(uncommitted round-2 edits were lost at 2026-10-22 00:49; rebuilt byte-for-byte
from the captured served page + verified end-to-end again):

- changelog opens by default; 「全部展开 / 收起全部」action row
- version select jumps to that release (open + scroll + flash highlight)
- release bullets grouped into fixed-order categories with counts
  (feat/fix/kernel/host-lane/storage/update/web-ci-tests/other), empty groups skipped
- fixes carried from the previous round: mutable paragraph buffer,
  well-formed <details> open tag, bold **…** rendering in intro paragraphs
…#3719)

registerUpdateActions lived inside if (opts.autoUpdate) in the CLI
startup path, so installs running with auto-update off
(ACP_AUTO_UPDATE=0 / config autoUpdate:false) got a panel whose
check/upgrade buttons always returned "self-update not wired in this
process". Manual and auto channels are independent by design (#1481
advisory watcher already is): hoist the shared updateOpts out of the
gate, start the background loop only when enabled, register the manual
actions unconditionally.
…de + bilingual targeted release notes (#3719)

Follow-ups requested on #4152:

1. Rename the updates tab to 版本/Versions (zh nav.updates/up.title,
   en counterparts) — the page covers changelog + version operations,
   not just updates.
2. dsh settings panel gains the matching tab (PAGE_IDS + PAGE_KEYS +
   zh/en tab_updates) so the embedded panel exposes the versions page
   like the standalone web UI does.
3. The critical-update banner now carries a one-click upgrade button
   when the fix is still 'available' (ready = restart-only, no button).
   It posts the phase-2 install endpoint and keeps feedback inside the
   banner; new i18n keys sys.update_now/updating/update_done.
4. Release-notes entries gain optional summaryZh / minVersion /
   maxVersion: zh-locale web surfaces pick the Chinese one-liner
   (banner + notices), entries only reach RUNNING versions inside the
   inclusive [min, max] window. /acp text stays English (compat
   boundary); unset fields keep the exact historic behavior — existing
   entries need zero changes. CI validator + README document the new
   fields; tests are bidirectional (#3617).
@ranxianglei
ranxianglei force-pushed the 2026-10-21_web-changelog branch from 0cd4005 to da8425c Compare October 22, 2026 16:47
#4177 landed the storage durability trio but its new suite spawns
child processes without registering in scripts/live-files.mjs, so the
#1248 SPAWN_RE tripwire fails every CI run — master aa198fe is red
and every branch rebased onto it inherits the failure.

Concurrency review: the suite only spawns `node -e setTimeout` probes
(no port binding) and isolates data in mkdtempSync dirs; slot 31 /
zone band 19811 is free. Fixes #4333.

(cherry picked from commit 9759e3e)
@ranxianglei

Copy link
Copy Markdown
Owner Author

(ai: zhipuai-lb/glm-5.3)

四项小需求已落上新 head da8425ca(+005e75d9):

  1. 改名:zh nav.updates/up.title 「更新」→「版本」,en 同步 Updates→Versions。
  2. dsh 设置面板:PAGE_IDS 加 updates tab(zh「版本」/en Versions,tab_updates 字典键)。
  3. 横幅一键升级:critical available 横幅加 banner-upgrade-now 按钮 → POST /__bili/update/install,busy/成功/失败反馈全在横幅内;ready(已装待重启)不加按钮。新 i18n 键 sys.update_now/updating/update_done。
  4. 推送双语+版本定向:release-notes 条目新增可选 summaryZh/minVersion/maxVersion——zh 面板(横幅+通知)优先显示中文;条目只触达 RUNNING 版本落在闭区间 [min,max] 内的实例;不设=历史触达完全不变(现有条目零改动,/acp 文本保持英文=兼容边界)。CI validator 与 README 已同步。

验证:typecheck 0 错;六测试文件 38/38(update-notes/web-update-banner/web-updates/web-i18n/web-changelog/admin-origin,含 #3617 双向断言);build OK。

另:本分支此前 4 分片秒红不是本 PR 引入——master aa198fe6(#4177)的 tests/storage-durability.test.ts 未登记 LIVE_FILES 触发 #1248 绊线,master 自身 CI 也红。已开 #4334 一行修复(Fixes #4333),并 cherry-pick 到本分支(005e75d9)让 CI 立即恢复;两处内容一致,合并 #4334 后本分支 rebase 会自动去重。

Since #4177 the storage contract suites transitively import acp-kernel
at runtime (backend -> store -> runtime-status -> knobs -> config), and
tsx resolves it to kernel/dist — which this job never built. Mirror the
prerequisite the main test matrix (run-ci-tests pretest parity) and
ci-e2e-dsh.yml already carry. Fixes #4336.

(cherry picked from commit 0f21448)
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

CI 排查收口:本分支的红已全部定位,mysql-contract 修复已验证生效;余 3 个 test 分片仍在跑(runner 偏慢)。

mysql-contract 红的根因(非本 PR 引入)

windows (22,1) 分片红 = 环境 flake

当前 CI 状态(head d23b88b,run 39818643648)

项 状态
全部静态门禁(含 unused-exports) ✅ 绿
全部 e2e workflows(real codex/dsh/opencode/pi/registry/persona/ws/overlay/artifact) ✅ 绿
mysql-contract ✅ 绿(修复验证生效)
ubuntu 22,1 / 22,3 ✅ 绿
windows 22,1 ❌ 2 个 EBUSY flake(已记 #4161)
windows 22,2 / ubuntu 22,2 / ubuntu 24,1 ⏳ 仍跑(16:59Z 起 ~63min,正常约 19min,runner 慢)

八问:

  1. 是什么问题:CI 红其实是两个独立问题——①mysql-contract 车道起不来(缺模块);②windows 分片间歇性环境 flake。
  2. 什么原因导致的:①车道从源码直跑测试却从不构建 file:-linked 的 kernel(dist 不入库),[PR] storage: durability trio — open-time quick_check + online VACUUM INTO backup + second-process lockfile (#4175) #4177 扩展导入图后高频触发;runner 工作区复用又让旧 commit「侥幸绿」掩盖了它。②Windows 临时文件锁 + 时序敏感,与代码变更无关。
  3. 影响范围与严重程度:①波及基于当前 master 的所有 PR 的 CI(merge ref 含 master)——纯构建阻塞,无用户面影响;②单分片间歇红,rerun 可解。
  4. 怎么修复的:①job 内补一行 kernel 构建步骤,与主测试矩阵的前置条件对齐(疏:让车道自己具备运行前提,而不是在别处打补丁);②flake 不改码,记录证据 + 给出有界重试方向。
  5. 是否有回归问题:无。纯增量 CI 步骤,零代码行为变更;静态门禁与全部 e2e 车道均绿。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:无。
  8. 是否引入新配置:无。

判定:待余下 3 分片落地——若绿,本分支唯一红即 windows(22,1) 的环境 flake,rerun failed jobs 可清、可合;若其中任何一个出现已知 flake 家族之外的新失败签名,我会单独跟进并回帖。

@ranxianglei

Copy link
Copy Markdown
Owner Author

接冲突

awork added 2 commits October 23, 2026 09:18
…4152 merge

Merging master into the changelog branch kept two placements of tests/storage-durability.test.ts (PR's alphabetical insert + master's appended entry). The appended form follows the file's own rule (mid-list inserts renumber every later port band), so keep that one and match master exactly.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

已接冲突:把最新 master merge 进 PR 分支并推回,冲突已解除(mergeable: true;当前 blocked 只是 CI 还没跑完,dirty 已消失)。

做了什么

验证(本地定向,非全量)

八问

  1. 是什么问题:PR 分支与 master 冲突(双方都改了同一批 web 面板文件 + CI 文件清单),merge 状态变 dirty。
  2. 什么原因:master 自 PR 基线起前进了 19 个提交,独立加了相邻功能(Add a changelog section to the web page. Explore whether we can at least auto-fetch the release notes for each version a | web页面增加changlog,看是否可以至少自动拉去每个版本release 的内容,并在适当的地方用户点击能看到更新了啥 #3719 updates、The "compressed structure" tree diagram for large sessions is scaled down to sub-pixel size (180 session blocks, fit ≈ 0 | 大会话的「压缩结构」树图被缩成亚像素(180块会话 fit≈0.05,方块只剩~6px) #4173 树旋转、Master CI is all red: tests/storage-durability.test.ts in #4177 is not registered in LIVE_FILES, triggering the process- | master CI 全红:#4177 的 tests/storage-durability.test.ts 未登记 LIVE_FILES,触发 #1248 进程生成绊线 #4333/master mysql-contract lane red: #4177's store→runtime-status chain pulled acp-kernel runtime imports into the storage co | master mysql-contract 车道红:#4177 的 store→runtime-status 链把 acp-kernel 运行时 import 带进了 storage 契约测试,job 没构建 kernel #4336 CI),与本 PR 触碰的文件重叠;且本 PR 有两条提交是 master 已有改动的近似 cherry-pick。
  3. 影响范围与严重程度:仅 PR 分支自身的集成问题,无用户可见行为变化;不解决只是挡住合并,本身零功能影响。
  4. 怎么修复:merge master 入分支一次解决;唯一文本冲突取并集;另修掉 live-files 重复登记这一处 auto-merge 产物。
  5. 是否有回归:审过 auto-merge 的四个静默合并文件 + 冲突文件——typecheck / build / 37 项定向测试全过,两边功能(changelog 与 updates/tree/i18n)共存正常;分歧处以 master 的规范形态为准,没有改变任何既有行为。
  6. 是否破坏缓存:不涉及——没碰压缩/缓存逻辑,纯 web UI + CI 清单。
  7. 是否改了设计方向:不涉及——纯集成,无架构改动。
  8. 是否引入新配置:不涉及。

冲突已解除,等 CI 转绿后即可由你合并(合并是人工操作,我不代做)。

@ranxianglei
ranxianglei merged commit 994a467 into master Oct 23, 2026
11 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

📦 Merged Build Published

This merge to master was published as 0.0.745-master.994a467 (rolling master tag).

npm install -g billion-context@0.0.745-master.994a467  # 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

Projects

None yet

1 participant