Skip to content

[PR] fix(storage): name OS-level suspects in win32 CANTOPEN degrade output (#3823) - #3855

Merged
ranxianglei merged 4 commits into
masterfrom
2026-10-19_cantopen-win32-hint
Oct 20, 2026
Merged

ranxianglei merged 4 commits into
masterfrom
2026-10-19_cantopen-win32-hint

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

What / Why

#3823(同家族 #3788/#3385/#3338)报告 Windows 上统一存储降级 legacy-only。前三例都是「Node < 22.5 无内置 SQLite 引擎 → 自下载失败」;本例不同——Node 24 有内置引擎(诊断里 engine bootstrap: not-needed),失败点是 OS 拒绝打开 index.db(SQLite unable to open database file,SQLITE_CANTOPEN)。这类失败在 Windows 上几乎总是环境因素(Defender/杀软锁目录、OneDrive 占位文件、路径超 260 字符),不是文件损坏。

但当前降级告警只说 delete the file to reset the index——对锁类失败删文件无效,提示会误导用户。本 PR 在两个展示面补上 Windows 专属的可操作提示。

How

Behavior change disclosure (old → new)

仅影响 win32 且错误文本含 "unable to open database file" 的情形;其他平台与错误类型字节级不变:

warn 行:

[storage] unified sidecar failed to open ...index.db (Error: ...) — staying legacy-only; delete the file to reset the index
→ ... — staying legacy-only (win32: the OS refused to open the file — usually antivirus/Defender locking the sessions dir, OneDrive placeholder files under the profile dir, or a path over 260 chars; exclude %USERPROFILE%\.local\share\billion-context\ from antivirus real-time scanning first; deleting the file will not clear a lock); delete the file to reset the index

降级 reason(diagnostics + /__bili/status):

index database failed to open (Error: ...)
→ index database failed to open (Error: ...) (win32: ...)

不引入新配置/env;存储行为本身不变(降级路径照旧,legacy JSON 照常服务)。

与在途 PR 的重叠(hot-file 提示)

Verification

本地定向跑绿:新 suite 4/4;相邻 suite(acp-status-storage-degraded + web-storage-banner + storage-engine-bootstrap + storage-mode-label + storage-unified)= 52 pass / 0 fail / 1 skipped(常规门控跳过);typecheck 干净;build 成功。全量判定 = 远程 CI on this head。

Related: #3823(triage 进行中——等 reporter 环境取证;本 PR 是其中无需决策的诊断面改进,故不关 issue)

@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-19_cantopen-win32-hint (74c6598)

Option A — Install this exact build (recommended)

npm install -g billion-context@0.0.4572-pr.3855.fb2ce29

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

Install instructions are refreshed on each push.

@ranxianglei ranxianglei changed the title fix(storage): name OS-level suspects in win32 CANTOPEN degrade output (#3823) [PR] fix(storage): name OS-level suspects in win32 CANTOPEN degrade output (#3823) Oct 19, 2026
@ranxianglei
ranxianglei force-pushed the 2026-10-19_cantopen-win32-hint branch from 049c217 to f75bd6b Compare October 19, 2026 15:28
@ranxianglei

Copy link
Copy Markdown
Owner Author

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

Rebased onto current master (48d45e7) — the branch was ~30 merges behind, including the #3818/#3819 storage-mode flip and #3790 bootstrap diagnostics. Hint code verified intact on the new base; targeted suites green locally (storage-cantopen-hint + log-mask).

Two labeled drive-by commits added on top (no behavior change), because master itself is currently red on two gates this PR's CI also runs — reproduced locally on pure master, so this is inherited redness, not from this diff:

  1. docs(config) — the committed CONFIGURATION.md / .zh-CN.md still carry two superseded storage table rows each; tools/gen-config-docs.mjs generate deletes exactly those 4 lines (the master-red docs-sync gate).
  2. fix(log-mask) — maskUrlForPublish is exported but every reference sits inside src/log-mask.ts ([security][web] Diagnostics blob prints private relay hosts verbatim in the config section — the "secrets masked" header only masks values, not hosts | 诊断包 config 段原样输出内网中转地址:标题说"密钥已遮蔽",但只遮值不遮主机 #3811); dropping the leading export restores the master-red unused-exports gate.

No new issue filed for these (few-line fixes riding an in-flight PR); flagging so the same two commits can ride whichever in-flight PR lands first.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

查重: 不重复。 本 PR 是 #3823 家族(#3788/#3385/#3338)的诊断面改进:那四个 issue 是各自的 bug 报告(Windows 环境因素导致统一存储降级 legacy-only),本 PR 不改存储行为,只为 win32 × CANTOPEN(unable to open database file)的降级输出补可操作提示。无其他在途 PR 覆盖此提示面;与 #3531 的唯一重叠是同一条 warn 行的一个模板字面量,两者条件互斥(缺引擎 vs CANTOPEN),合入后是同一行的两个独立后缀,语义不冲突。

标签: pr, bug, dsh, scope/storage, p2 —— #3823 家族存储降级缺陷的修复面;字段实例来自 DSH 拉起的子进程;范围限存储诊断展示层;能用但降级+旧提示误导,p2。

审核进行中,当前状态:

下一步:重跑该失败 windows job 确认 tunnel-guard ECONNRESET 属环境 flake,然后给最终八问结论。

awork added 4 commits October 20, 2026 01:23
…#3823)

On win32, 'unable to open database file' (SQLITE_CANTOPEN) at index.db open time is almost always an OS-level refusal (AV/Defender lock, OneDrive placeholders, MAX_PATH), not a corrupt file — the generic 'delete the file' advice misleads for that class. New sqliteOpenFailureHint() fires exactly when win32 && CANTOPEN and is appended to the maybeOpen warn line plus the degradeReason() output (diagnostics block + /__bili/status). Both directions pinned in tests/storage-cantopen-hint.test.ts (#3617).
#3823)

Field evidence from #3823: the affected machine's DSH-launched bili child ran
at low integrity — its CA bundle write was refused by Windows integrity
control (EPERM, fixed by icacls Low), and the same restriction class is a
plausible producer of the index.db open refusal. Add it to the hint's suspect
list so the diagnostics point at process restrictions, not just AV/OneDrive.
…ed-exports gate)

Drive-by fix, labeled: master 48d45e7 fails the unused-exports gate on this
symbol (INTERNAL_ONLY — every reference sits inside src/log-mask.ts: its own
doc comment and the maskUrlsInText call added by #3811). Dropping the leading
export restores the gate; no behavior change.
…ows (master-red docs-sync gate)

Drive-by fix, labeled: master 48d45e7 fails docs-sync because the committed
CONFIGURATION.md / .zh-CN.md still carry two superseded table rows each (the
old storage.unified 'unset (shadow)' row and an old storage.sqliteAutoDownload
row without the #3788 cooldown text). tools/gen-config-docs.mjs generate
deletes exactly those 4 rows; no other content changes.
@ranxianglei
ranxianglei force-pushed the 2026-10-19_cantopen-win32-hint branch from f75bd6b to 74c6598 Compare October 19, 2026 17:26
@ranxianglei ranxianglei added bug Something isn't working dsh p2 scope/storage labels Oct 19, 2026
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

审核完成(独立重审,非复读 issue 结论)。判定:可合入。

先交代一个审核中发现并处理的事:接单时分支落后 master 12 个 commit(#3697 hermes /acp、#3737 dsh-authored-compaction、#3850 等已合入)。按规范 rebase 到当前 master(39fb841)——零冲突(新 master 的 docs commit 与本 PR 的再生成表格区不重叠),diff 保持原样 8 文件 +143/−11,已推送,新 head 74c6598。rebase 后本地复验:typecheck 干净;定向 suite(storage-cantopen-hint + 5 个相邻)= 58 跑 / 57 过 / 0 败 / 1 常规跳过;重跑 gen-config-docs 生成器与提交文档零差异(与 #3737 的 docs 变更无语义冲撞)。CI on 74c6598:主 CI run 全绿(CORE 矩阵 6 测试腿 + static-gates×2 + 全部门禁)+ 各 e2e lane(dsh/opencode/codex/pi/pi-ws/registry/windows-codex-overlay)全绿。旧 head 上唯一的红(windows node22 shard1 的 tunnel-guard ECONNRESET)经重跑确认是网络 flake,与本 PR 触碰面无关;单次未复现,暂不立项,再出现会跟。

结构化八问:

  1. 是什么问题:Windows 上 OS 拒绝打开统一存储 index.db(SQLITE_CANTOPEN)导致降级 legacy-only 时,告警与诊断只说「delete the file to reset the index」——对锁类失败删文件无效,提示把用户引向无效操作。
  2. 什么原因导致的:旧文案按「文件损坏」心智模型写,没有区分失败类别;而 Windows 上的 CANTOPEN 几乎总是环境因素(AV/Defender 锁目录、OneDrive 占位文件、路径超 260 字符、低完整性受限进程——SQLite unified storage degraded to legacy-only (bili v0.1.202, node v24.21.0, win32-x64) #3823 字段实例即此类)。
  3. 影响范围与严重程度:仅 win32 且错误文本含 "unable to open database file" 的降级输出面(SQLite unified storage degraded to legacy-only (bili v0.1.202, node v24.21.0, win32-x64) #3823 家族字段实例全属此类);p2——存储行为照旧降级、legacy JSON 照常服务,无数据丢失,变的只是恢复指引从误导变为可操作。
  4. 怎么修复的:新增纯函数 sqliteOpenFailureHint()(win32 && 文本匹配才返回提示,否则空串),接到两个展示面(maybeOpen warn 行 + degradeReason() → diagnostics 块与 /__bili/status reason);提示点名四个嫌疑 + 排除目标目录 + 明确「删文件清不掉锁」。
  5. 是否有回归问题:逐项审过既有行为——(a) warn 行在非 win32/非 CANTOPEN 下字节级不变(hint 空串);(b) recordSidecarOpenFailure 入值不变(String(err) 仅提为局部变量);(c) degradeReason() 其余分支(auto-disabled / no-engine / bootstrap cooldown / unsupported-platform)未动;(d) log-mask 导出移除经实证零外部引用,且 master-red 的 unused-exports 门禁修后转绿;(e) docs 再生成删 4 行陈旧表项,rebase 后重新生成零差异,docs-sync 绿。无意回归:无。有意变更 = win32×CANTOPEN 的两处输出追加后缀(PR 正文已披露 old→new,我核对了实际渲染串与披露一致)。
  6. 是否破坏缓存:不涉及(不触碰缓存/重试/游标/去重键)。
  7. 是否改了设计方向:不涉及(纯展示面;存储降级路径、数据流不变;无新配置/env)。
  8. 是否引入了新的配置:无。

测试有效性:4 个新测试双向钉住(#3617)——win32×CANTOPEN 触发并断言提示内容、win32×其他错误(含 no-engine)静默、linux/darwin×CANTOPEN 静默、端到端接线用名为 index.db 的目录跨平台确定性触发 CANTOPEN 断言 reason 前后缀;windows 分片日志里还抓到了真实 win32 渲染出的完整 warn 行。

收工判定:可合入(mergeable;合并动作留给你)。若 #3531 先行合入,本分支只需解那一个模板字面量的冲突(保留两侧后缀即可)。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

这条是分支创建时的作者侧说明(首次 rebase 到 48d45e7 + 两个 drive-by 的来历),平台晚到转发。状态其后已推进,同步一句以免混淆:

结论维持上一条八问回复:可合入,合并动作留给你。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b)

CI 已全绿。 期间出现过一次 test (windows-latest, 22, 1) 失败,定性为网络抖动(flaky),与本 PR 无关:

  • 失败测试:tests/tunnel-guard.test.ts 「integration: metadata destination never contacted (403 before any socket)」,错误 read ECONNRESET(真实 socket 集成测试);
  • 本 PR 的 diff 只碰 src/storage/shadow.ts / runtime-status.ts + 文档 + 新测试文件,不触及任何隧道/网络路径;
  • 抖动证据:同一分片(shard 1,含 tunnel-guard)在 [PR] fix(logger): log file open failure now warns + falls back to stderr instead of total silent loss #3858 旧 head(cfd2f7cc8,基于同一 master 48d45e7)上约 30 分钟前刚跑绿过;
  • 处置:请求了失败作业重跑(rerun-failed-jobs),重跑后通过。

当前状态:全部检查通过(28 success + 12 skipped 为默认门控的 e2e 车道,属正常)。待人工合并。

@ranxianglei
ranxianglei merged commit ca9a996 into master Oct 20, 2026
73 of 106 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

📦 Merged Build Published

This merge to master was published as 0.0.633-master.ca9a996 (rolling master tag).

npm install -g billion-context@0.0.633-master.ca9a996  # 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 p2 scope/storage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant