Repository navigation
[PR] fix(#2791): heal setter-invisible globalThis.fetch evictions in the native intercept chain - #2804
[PR] fix(#2791): heal setter-invisible globalThis.fetch evictions in the native intercept chain#2804ranxianglei wants to merge 2 commits into
Conversation
…ative intercept chain
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.3092-pr.2804.575f7caThis exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr2804.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 PR #2804 review 完成 — 已拉分支逐行审完 diff(6 文件 +202/-4)、核对 #2791 方向、本地定向验证。发现并顺手修掉一处 CI 门禁失败,已推送到 PR 分支。 顺手小修(已推送,独立标注 commit 结构化八问:
行为变更披露确认(作者已披露,复核无误):NEW 每 30s 一次 判定:代码与测试质量达标,方向正确,唯一红灯(unused-exports)已修并推送;CI 在 new head 全绿后可合并(合并由人执行)。复发判别逻辑(warn 有 ⇒ 主 realm delete/redefine 已修;无 ⇒ 触发点在 patch 够不到的 realm)写进了 PR 描述,合理。 |
[bot] 🏷 CI 全绿确认(new head 之前唯一红灯( |
|
(ai: zhipuai-lb/glm-5.3) 孤儿票清理:标题指向的 issue 已关闭,修复已由其他路径落地。关单;误判请 reopen。 |
Follows #2791 — intercept-layer hardening for the dsh anthropic-messages lane bypass class. The silent-layer half (orphan-suspect detection at mint) is #2802; this PR covers the root-cause layer #2802 explicitly left open ("host fetch-capture timing").
What this changes
The #1158 guarded accessor on
globalThis.fetchsees every ASSIGNMENT to the property, but not DELETE or REDEFINE — both bypass setters entirely on a configurable property. That shape silently un-routes every model request while the host keeps working: no setter write, no #1158 diagnostic, traffic leaves un-stamped, and the proxy mints an anonymouspfa-*session per cross-protocol switch (fold ledger orphaned, cold full-history re-fold — the incident shape).installFetchChainnow arms a periodic integrity watchdog alongside the guard (guarded install only; the classic path is untouched):cur.get === accessor.get && cur.set === accessor.set, the same comparisonresetFetchChainForTestuses);[bili-native] … lost the bili guarded accessor (#2791) … (reinstall N);resetFetchChainForTeststops it (no timer leak across the suite).Durability: new optional
NativeInterceptState.onFetchIntegrityEventhook receives each full diagnostic line; dsh-native wires it topersistClientEventso GUI hosts (stderr invisible, #1158 lesson) keep the event in the shared bili.log. All other hosts stay console-only.Behavior change disclosure
getOwnPropertyDescriptorper tick.kernel/.Config surface
No new knobs. The watchdog rides the existing
BILI_RECLAIM_FETCH_PATCHescape hatch (=0→ classic install → no guard, no watchdog). The CONFIGURATION.md en/zh entries for that var are extended accordingly.Tests
Five new suites in
tests/native-intercept-selfheal.test.ts: intact-silent / defineProperty-eviction (+ durability hook + downstream adoption) / deletion-reanchor / budget-exhaustion-give-up / reclaim-off-no-watchdog — deterministic, console wording pinned. Local evidence: typecheck clean, selfheal suite 26/26, sibling native/dsh/pi/omp/opencode-native suites 141/141.Not covered here: the exact host-side trigger of the original incident needs in-process instrumentation on the reporter's machine (static analysis eliminated options.fetch injection and cached-client capture for stock dsh 0.2.0-rc.2 — see issue thread). On any recurrence the watchdog discriminates: warn line present ⇒ main-realm delete/redefine eviction (repaired); absent ⇒ the trigger lives elsewhere (e.g. a worker realm the patch never reached).