Repository navigation
[PR] fix: Root cause detection for Windows startup EPERM-type issues — self-check on startup and provide remediation command | fix: Windows 启动 EPERM 一类问题的根因检测——node.exe 被 Low 完整性标签污染时启动即自检并给出修复命令 (#5154) - #5159
Merged
Conversation
…dvice under OS-level refusals (Follows #4614)
…ot this PR's master 146b34f fails the unused-exports gate on this exact line (INTERNAL_ONLY src/agent/client-build-note.ts: ClientBuildCheck): the type-only export #4545 introduced was missed by the 4d34abf de-export sweep. This PR touches none of it — every PR rebased past that master inherits the red (#4599 storm log). Same one-word fix as #4606 commit 1 and the in-branch precedents (#4607/#4595/#4540/#4618/#4622): drop the leading export on a symbol referenced only within its own file. Drop this commit when rebasing after #4606 merges.
…-open-hint # Conflicts: # src/storage/shadow.ts
A forced power loss left the DSH-spawned child dying on EPERM at the combined-CA bundle rewrite while a manually started proxy held the lane port for 11 hours; every failure surface stayed silent or unactionable. - ca: a write-refused combined-bundle rebuild now reuses the existing bundle when it still carries the current root CA (loud warn pointing at the AV-exclusion remedy) instead of exiting before the port binds; stays fail-fast when no usable bundle exists - launcher: the "port answers health but is not the proxy this launcher spawned" info line and the final timeout error now carry the remedy (kill pid X / native.attachExternal); an explicit attachUrl target that is found but refused gets one loud line naming the reason (e.g. code-fingerprint-mismatch after a version skew) and the remedy; a dead/absent target says so instead of waiting silently - index: "bili: failed to start" gains errno-classified hints (EPERM/EACCES -> OS-level write-refusal guidance) - storage: the FIRST unified-store ingest failure now warns naming the db file (was silent until strike three); the disable warning keeps naming it; sqliteOpenFailureHint also matches "attempt to write a readonly database" (the field shape where the db opens but writes are refused) Tests: tests/issue5103-startup-recovery-visibility.test.ts (new), tests/ca-combined.test.ts (+2), tests/storage-cantopen-hint.test.ts (+1)
…p; Low-label-aware failure hints (#5154) A node.exe carrying an inherited Low mandatory-integrity label cannot write Medium-labeled files: the CA bundle rebuild, index.db, and session envelopes all fail EPERM while every ACL check passes — the field repro of the whole #5096 crash-loop class. The label usually arrives from a parent dir once labeled Low (OI)(CI) and survives reboots; ACL tooling never shows it. - src/integrity-label.ts: parseIcaclsMandatoryLabel() + a non-blocking startup self-check (icacls by ABSOLUTE path on process.execPath — PATH resolution fails under some PowerShell/cmd profiles) that logs a loud [integrity] warn with the exact fix command when the runtime is Low/Untrusted. Observability, not a gate: the proxy keeps running. - startupFailureHints (moved out of index.ts): integrity-label check FIRST (#5154: the label was the real switch; the AV detour cost the most hours), antivirus exclusions second (#3823). - ca.ts / shadow.ts CANTOPEN hints reordered integrity-first. - CONFIGURATION.md / .zh-CN.md: 'Windows: node runtime labeled Low' section — mechanism, diagnosis, fix (Medium, not Low!), non-recursive dir-root convergence, ACL backup tip. Stacked on #5157 (#5103) — merge that first.
Contributor
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.6830-pr.5159.e8c0680This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr5159.tgz
npm install -g packageInstall instructions are refreshed on each push. |
Contributor
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.920-master.4bb2bc1 # this exact build
npm install -g billion-context@master # always the newest merged build
|
This was referenced Oct 30, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(ai: zai/glm-5.3)
修什么
#5154 实测根因:node.exe 被 NTFS Low 强制完整性标签污染(通常继承自某个曾被
icacls <dir> /setintegritylevel "(OI)(CI)Low" /T打过的父目录)。Low 进程对 Medium 级文件的每次写入都被 Windows 完整性控制直接EPERM拒绝——CA bundle 重建、index.db、会话信封全中招,而所有 ACL 检查都通过。这正是 #5096「崩溃循环但看不到原因」一类的机制,标签重启不消失。改动
src/integrity-label.ts(新):parseIcaclsMandatoryLabel()解析 icacls 输出的标签行;warnIfLowIntegrityRuntime()启动自检——对process.execPath跑icacls(绝对路径C:\Windows\System32\icacls.exe,因为现场 PATH 解析失败),发现 Low/Untrusted 就打一条醒目[integrity]告警,附修复命令。不阻断(issue 要求 warn 不 stop),探测失败静默。startupFailureHints从 index.ts 移出):完整性标签检查放第一位,AV 排除第二位(SQLite unified storage degraded to legacy-only (bili v0.1.202, node v24.21.0, win32-x64) #3823)——现场走 AV 弯路最费时间。src/ca.ts/src/storage/shadow.tsCANTOPEN 提示同样重排为 integrity-first。CONFIGURATION.md/.zh-CN.md新增 "Windows: node runtime labeled Low" 小节:机制、判别、修复(恢复 Medium,不是把数据目录打 Low——[PR] fix: name the win32 READONLY index.db open failure; drop the delete advice under OS-level refusals (#4614) #4625 曾给出方向相反的建议,本 PR 链上已一并修正)、目录只改根不递归即收敛、/save备份。测试
tests/issue5154-low-integrity-selfcheck.test.ts10 例:解析器(含全大写输出、Medium、无标签、空输出)、提示顺序 pin(integrity < antivirus)、非 win32 无操作。typecheck 通过;回归issue5103/storage-cantopen-hint/ca-combined/issue5096共 29 例全绿。关系
Stacked on #5157(先合 #5157)。同链:#5097(冲突已解,可先合)→ #4625(方向修正已推)→ #5157 → 本 PR。
Closes #5154