Repository navigation
fix: web 存储降级横幅每 5 秒重复拉取诊断接口 → 按 topic 缓存 60s - #3108
Conversation
The web overview poll re-renders banners every 5s while storage is degraded, and each re-render re-invoked attachReportButtons → a fresh GET /__bili/diagnostics every 5s. Each hit rebuilds the full blob server-side (listSessions + whole-file bili.log/bili.log.old reads), and a failing endpoint re-toasted on every poll (the #1937 poll backoff does not cover this fetch). - cache the report per topic for 60s; cached hits bind without network - toast once per topic on failure instead of every poll - pin both behaviors with string assertions in the #3040 banner test
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.3555-pr.3108.87c695bThis exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr3108.tgz
npm install -g packageInstall instructions are refreshed on each push. |
|
现在修复后还会每次拿全量日志吗 |
(ai: vllm-qwen/qwen3.8-27b) 不会每次都拿了。这个修法是客户端缓存:诊断报告按 topic 成功拉取后缓存 60s,期间横幅每 5 秒的重渲染直接走缓存绑定按钮,不发网络请求——服务端也就不会重建诊断 blob(不做 listSessions、不做 bili.log / bili.log.old 的全文件读取)。开着面板时,全量日志最多每分钟读一次(原来每 5 秒一次,降 12 倍)。 两个边界说明:
完整 review 结论随后补上(CI 有四个 test lane 红了,正在核实是否与本 PR 相关)。 |
(ai: vllm-qwen/qwen3.8-27b) 结论先行:代码审核通过,可合;CI 的 4 个红灯与本 PR 无关——master 自 #3094 起就红在这 4 个 golden 测试上。已立项 #3121 + 修复 PR #3122,合并后本 PR rebase master 即转绿。 结构化八问
CI 红专项(与本 PR 无关,已独立处置)
顺带回答 @Dog 的问题修复后不会每次拿全量日志了:开着面板时每 topic 最多每分钟触发一次服务端 blob 重建(含两次全文件读),原来每 5 秒一次,降 12 倍。边界:单次请求仍是全量读两个日志文件(修的是频率不是单次成本);缓存在页面内存里,刷新重置,多标签页各一份。 收工判定:代码通过审核,#3122 合并 + 本分支 rebase master 后即可转绿合并;合并操作留给你。 |
(ai: vllm-qwen/qwen3.8-27b) 笔误更正:上一条里「打 |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.401-master.b5b73b3 # this exact build
npm install -g billion-context@master # always the newest merged build
|
这是啥问题
#3041 合入后,web 面板在存储降级时的轮询(5s)每次都重新拉取
/__bili/diagnostics:横幅每 5 秒重建一次 innerHTML 并重新执行attachReportButtons,导致:listSessions()+ 整个 bili.log / bili.log.old 的 readFileSync 再过滤[storage]行)。共享 lane 的日志有几 MB,开着面板就等于每 5 秒几 MB 磁盘 IO;怎么修
验证
npx tsc --noEmit0 错;tests/web-storage-banner.test.ts4/4 绿(含新断言);npm run build通过。review 来源:#3041 合并后 review(还发现两个可接受的小项:cooldown 场景横幅文案偏重、诊断 blob 含 12 行日志尾巴属用户主动上报,均不修)。