Skip to content

[PR] fix: make startup-failure paths self-contained and actionable (#5104) - #5157

Merged
ranxianglei merged 12 commits into
masterfrom
2026-10-29_issue5103-startup-recovery-visibility
Oct 30, 2026
Merged

ranxianglei merged 12 commits into
masterfrom
2026-10-29_issue5103-startup-recovery-visibility

Conversation

@ranxianglei

@ranxianglei ranxianglei commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner

(ai: zai/glm-5.3)

Closes #5104

Stacked on #4625 — merge that first; the 2 lower commits are its head, GitHub retargets this PR automatically once it merges.

What & why

「启动问题」这一类(现场:#5104/#5154/#3823/#4614)的共同形态:listen 之前任何一步失败,用户只看到死端口 + %TEMP% 里的原始错误,自己排查数小时。本 PR 把启动失败路径变成自查自明:失败的每一类都说清「这是哪类问题、第一步该做什么」。

Changes

Behavior changes

CA 重写失败但旧 bundle 可用时:进程存活并 warn(以前:退出)。存储 ingest 失败:第一次就 warn(以前:静默递增计数)。其余为文案/提示增强。

Verification

Config surface

无新增。launcher 提示里宣传的 native.attachExternal / BILI_NATIVE_ATTACH_EXTERNAL 是既有面(#1335),本 PR 未改动。

ci-check and others added 12 commits October 25, 2026 06:44
…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)
@github-actions

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-29_issue5103-startup-recovery-visibility (d47c6dc)

Latest build — install this exact version

npm install -g billion-context@0.0.6825-pr.5157.cd8942d

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Recent builds (commit → version)

commit version build
d47c6dc billion-context@0.0.6825-pr.5157.cd8942d build

Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr5157.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei
ranxianglei merged commit 577406a into master Oct 30, 2026
40 of 47 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

📦 Merged Build Published

This merge to master was published as 0.0.919-master.577406a (rolling master tag).

npm install -g billion-context@0.0.919-master.577406a  # 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 added a commit to fathonix/billion-context that referenced this pull request Oct 30, 2026
…p; Low-label-aware failure hints (ranxianglei#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 ranxianglei#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 (ranxianglei#5154: the label was the real switch; the AV detour cost the
  most hours), antivirus exclusions second (ranxianglei#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 ranxianglei#5157 (ranxianglei#5103) — merge that first.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant