Skip to content

[PR] fix(#5959): install globalThis.fetch as a plain data property; heal evictions via a 1 s integrity watchdog - #6017

Open
ranxianglei wants to merge 21 commits into
masterfrom
2026-11-09_fetch-data-property-watchdog
Open

ranxianglei wants to merge 21 commits into
masterfrom
2026-11-09_fetch-data-property-watchdog

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Closes #5959

Root fix for the DSH experimental-inspector conflict first reported in #3528 (that issue shipped only the doc stopgap via #3690; its root fix was gated on #2804, which was closed unmerged under a misjudgment — master currently carries no eviction-healing at all for the #2791 shapes).

What changed

src/agent/fetch-chain/index.ts — the guarded install form of the native-mode fetch intercept (#1158):

Deviations from the #2804 draft (whose head ref still exists upstream): interval 1 s instead of 30 s (data mode moves assignment healing from instant-setter to ≤tick — 1 s bounds the unrouted window); consecutive-failure give-up instead of a lifetime reinstall counter (a lifetime counter would permanently disable the intercept after ~8 s of legitimate churn, violating #1158's "cap bounds LOGGING only"); the onIntegrityEvent hook was dropped entirely — post-#2827 all fetch-chain diagnostics flow through logHostEvent → bili.log, which is durable in dsh too, so the hook would have been dead code. No changes to native-intercept.ts / dsh-native.ts / pi-inline.ts.

Behavior changes (old → new)

  1. Descriptor: guarded accessor → plain writable data property. THE FIX — the inspector guard ("value" in descriptor) passes.
  2. Assignment-heal latency: instant (setter) → ≤1 s (watchdog tick). Window where model traffic routes away / a pi-web-access proxy may intercept model URLs; minimized by the 1 s default.
  3. Third-party read-back of globalThis.fetch: always bili's top (getter) → their own assigned value until the next tick adopts it. Also cures the identity-checking-observer pitfall noted in the [plugin] Guarded globalThis.fetch accessor blocks coexisting fetch observers (dsh experimental-inspector fails to load) #3528 thread.
  4. Own stale-link write-back: masked by the getter (readback returned the current top) → resync follows the written-back link.
  5. Give-up: new concept — after 3 consecutive unproductive repairs the guard goes quiet and logs an error; it RE-ARMS automatically when the slot becomes usable again (no restart needed).
  6. Synchronous wrap bursts: a burst of ≥~10K foreign wraps landing inside ONE watchdog period (≤1 s) can overflow the stack on the next request — the legacy accessor's setter laundered each write through a fresh top, masking such bursts. Realistic per-operation churn (~1 wrap/op, the DSH0.1.7-rc.2中billion-context与dsh-codex-subscription的冲突? #1662 dsh-codex-subscription shape) drains O(1) every tick (a test pins 16000 wraps drained tick-by-tick). An adversarial sync burst inside 1 s is a hostile/host-crash shape, same trust domain as process.exit().

Tests

tests/native-intercept-selfheal.test.ts: all existing selfheal cases adapted to the check-driven model (explicit ticks model the 1 s cadence), plus five new gate tests asserted both directions: inspector guard passes verbatim on the default install; delete/redefine evictions heal within one tick; hostile swallowing accessor gives up loudly AND re-arms on recovery; idle ticks never accumulate layers; the real timer drives the heal. Targeted suites green locally: selfheal 27/27, adjacent fetch-touching suites (native-intercept, pi-inline, opencode-native v1+v2, issue5614) 118/118; typecheck clean. Full verdict = CI on this head.

No kernel/ change, no config-surface change, no version bump.

ci-check added 2 commits November 9, 2026 16:32
…victions via a 1 s integrity watchdog

The guarded accessor (#1158) broke third-party observers that require a value-carrying descriptor — DSH's experimental-inspector aborted at load (#3528). The default guarded install now writes a plain writable data property and arms a watchdog that re-reads the descriptor every second, healing every eviction shape (third-party assignment #1158, delete/redefine #2791, hostile accessors) under the same adopt-as-downstream policy. Give-up counts consecutive unproductive repairs only (max 3), re-arms automatically when the slot becomes usable again, and logs durably through logHostEvent. BILI_RECLAIM_FETCH_PATCH=0 keeps the classic direct install with no watchdog.
… install + integrity watchdog

The env-var entries (en+zh) and table rows still described the retired accessor form and the stale 'reclaim on shutdown' wording. Now state the plain writable data property default, the 1 s watchdog and its heal/give-up/re-arm policy, and that the #3528 inspector coexistence conflict is resolved.
@ranxianglei ranxianglei added bug Something isn't working dsh p2 scope/wiring labels Nov 9, 2026
@ranxianglei ranxianglei changed the title fix(#5959): install globalThis.fetch as a plain data property; heal evictions via a 1 s integrity watchdog [PR] fix(#5959): install globalThis.fetch as a plain data property; heal evictions via a 1 s integrity watchdog Nov 9, 2026
@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-11-09_fetch-data-property-watchdog (242c974)

Latest build — install this exact version

npm install -g billion-context@0.0.10471-pr.6017.cc6f2aa

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
242c974 billion-context@0.0.10471-pr.6017.cc6f2aa build
073dd88 billion-context@0.0.10454-pr.6017.8744979 build
eed90eb billion-context@0.0.10416-pr.6017.e794e31 build
d0a9f65 billion-context@0.0.10404-pr.6017.1f68277 build
5762c7d billion-context@0.0.9489-pr.6017.11de82d build
56a6e80 billion-context@0.0.9260-pr.6017.6f4e7f4 build
b512c3b billion-context@0.0.8904-pr.6017.a2fd219 build
1e53ad3 billion-context@0.0.8897-pr.6017.648106e build
c8bb6ab billion-context@0.0.8786-pr.6017.310f1ca build
0b32253 billion-context@0.0.8781-pr.6017.3dec7bb build

Download artifact

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

Install instructions are refreshed on each push.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

Picked up this thread. This is an agent-completed PR (ework-agent-pr marker present) — I will NOT redo the work; I'm verifying it: pulling the head branch, reading the full diff against current master, checking CI status on the pushed head, and running the targeted test suites locally. Full structured review to follow in this thread.

查重: 不重复 — this PR IS the root fix for upstream #5959 (the DSH experimental-inspector conflict); no other in-flight PR targets the same mechanism.

ci-check added 5 commits November 9, 2026 17:03
…-config-docs seed

The param-ref table rows are generated artifacts (docs-sync lane runs
tools/gen-config-docs.mjs generate + git diff --exit-code). The wording
rewritten in the previous commit landed hand-edited inside the generated
block, so CI regenerated the stale seed text and flagged drift. Edit the
seed instead; regenerated output is now byte-identical to the committed
docs.
…e slot shapes (#5959)

Review finding: in the own-top branch, the defineProperty fallback ran OUTSIDE any try/catch. When the slot is a non-configurable accessor masking our own top, both the strict-mode assign and the redefine throw, and the TypeError escaped the setInterval callback -> uncaughtException -> host process death (reproduced: 'Cannot redefine property: fetch'). Wrap the repair like the sibling adopt branch does and count a thrown repair as an unproductive failure (give-up ladder applies). Adds a regression test in its own file because non-configurability is permanent for the process lifetime. Also corrects a factually wrong comment in the hostile-accessor give-up test (a tick whose slot still resolves to a function clears givenUp and retries; it is not a quiet no-op).
…env-only seed (#5959)

The PR's docs commit hand-edited the generated index row without updating website/config-reference/env-only.yaml, so the docs-sync drift guard (tools/gen-config-docs.mjs generate + git diff --exit-code) went red. The seed is the single source: with the new desc_en/desc_zh in place, regeneration reproduces the committed configuration.md/zh-CN rows byte-identically.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

Verification complete — two defects found, both fixed on the branch, pushed. New head 0b32253b40 (was 790860ada7; the author also landed an identical seed fix 7fd23aa8d4 mid-review, which I merged in).

What I verified

Finding 1 — watchdog could kill the host process (fixed, regression-tested)

In the own-top branch of the integrity check, the fallback Object.defineProperty(globalThis, "fetch", …) ran outside any try/catch. If the slot is a non-configurable accessor masking our own top, both the strict-mode assign and the redefine throw, and the TypeError escaped the setInterval callback → uncaughtException → host process death. Reproduced exactly (TypeError: Cannot redefine property: fetch out of the timer callback). The sibling adopt-branch had the same pattern inside its outer try/catch — only this branch had the hole. Fix: wrap the repair like the sibling branch and count a thrown repair as an unproductive failure, so the already-disclosed give-up ladder (3 consecutive → error log → re-arm on recovery) applies instead of a crash. Regression test added in its own file (tests/native-intercept-selfheal-nonconfig.test.ts) because non-configurability is permanent for the process lifetime. Also corrected a factually wrong comment in the hostile-accessor give-up test (a tick whose slot still resolves to a function clears givenUp and retries — it is not a "quiet no-op").

Finding 2 — docs-sync red was the PR's own doing (fixed; raced the author)

The docs commit hand-edited the generated index row in docs/configuration.md/.zh-CN.md without updating the single source website/config-reference/env-only.yaml, so the drift guard (tools/gen-config-docs.mjs generate + git diff --exit-code) went red. Fixed by moving the new wording into the seed and regenerating — regeneration then reproduces the committed files byte-identically. While I was at it, the author pushed 7fd23aa8d4 with a byte-identical seed change; merged, no conflict.

Flagged, not changed (behavior decision left to author/owner)

While a hostile accessor persists, each tick clears givenUp (a live fetch "reappeared") and retries the repair — per-tick warn log + one wasted wrapper allocation per second. Bounded O(1), self-heals when the evictor stands down, and staying offline would violate #1158's "routing authority never leaves" policy — but the "gives up after 3 consecutive unproductive repairs" wording overstates persistence for this shape. Left as-is deliberately; one-line note here instead of churning the branch further.

Branch state

Synced to current master (was 110 commits behind; disjoint hunks, clean auto-merge; master touched neither code file of this PR). Pushed: 7ba8cafc9c (crash guard + regression test + comment fix), 8f6d359906 (seed fix), 391a7e06a5 (master sync), 0b32253b40 (upstream seed-fix merge). Merging stays human-only — ready to merge when CI on 0b32253b40 is green.


结构化八问(review 结论)

  1. 是什么问题:bili-native overrides globalThis.fetch via an accessor, causing DSH experimental-inspector to report "cannot be observ | bili-native 用 accessor 接管 globalThis.fetch 导致 DSH experimental-inspector 报「cannot be observed safely」无法启动 #5959 —— DSH 桌面「NodeJS 诊断」插件要求 globalThis.fetch 是普通可写数据属性,而 bili native 模式把它装成受保护访问器(描述符无 value),插件加载即中止;且第三方一旦驱逐(重赋值/删除/重定义)路由权就永久丢失。本 PR 是根修。
  2. 什么原因导致的:安装形态与第三方观察者不兼容(访问器 vs 数据属性),加上驱逐后无任何自愈机制;根因在安装层,不在插件侧。
  3. 影响范围与严重程度:所有「native 模式 + 共存 fetch 观察者」的宿主(DSH 诊断插件用户)——修复前该功能加载即废(p2 级体验损坏,bili 本体仍可用);本 PR 变更触及全部 native 会话的安装形态与 ≤1s 自愈时延。
  4. 怎么修复的:装成普通可写数据属性(inspector 兼容)+ 1s 完整性看门狗按 adopt-as-downstream 策略修复一切驱逐形态;give-up 只计连续无效修复、恢复自动重新武装。审核中发现并修掉一条未防护的崩溃路径(不可配置访问器 → 异常逃逸定时器回调 → 宿主进程死亡,已复现+回归测试钉住);docs-sync 红是手改生成文档未更新 yaml seed 所致,已把描述移入 seed(与作者并行推送的修复字节级一致)。
  5. 是否有回归问题:逐项审过既有行为——双安装语义不变、pi-web-access 握手([Bug][Logging] pi-web-access 正常首次安装触发 #1158 warning,被描述为 evict attempt(0.1.191) #2685)保留、逃生阀 BILI_RECLAIM_FETCH_PATCH=0 保持经典直装且不跑看门狗(测试钉死)、reset 仅在槽位仍持我方 top 时还原原描述符(bili-native 安装/re-arm globalThis.fetch 不校验所有权,与网络 scope 类插件交错后全局 fetch 悬空 → 全进程 "baseFetch is not a function" #1410)、空闲 tick 不叠层、16000 层 wrap 逐 tick 排空。未发现无意回归;与 master 同步(落后 110 提交)干净合入后相关套件复跑全绿。我的修复未引入新行为面:崩溃形态从「进程死亡」变为「计入失败→3 次后 error 日志放弃」,正是 PR 自己披露的 give-up 契约在该形态上的落实。
  6. 是否破坏缓存:不涉及(无缓存/重试/增量游标/去重键)。
  7. 是否改了设计方向:安装形态由受保护访问器改为普通数据属性+看门狗监控——这是本 PR 声明的根修方向本身,非附带转向;边界不变(src/agent/fetch-chain 内,无 kernel/)。
  8. 是否引入新配置:不涉及——BILI_RECLAIM_FETCH_PATCH 为既有旋钮,语义不变(0=经典直装、无看门狗),仅配置文档描述文案更新并归位到 yaml seed。

收工判定:代码方向正确、实现质量高(测试双向钉死、披露诚实),两处缺陷已在分支上以标注 commit 修掉并推送;待新 head 0b32253b40 的全量 CI 绿即可合并(合并动作留给人工)。

… test

The data-property install (#5959) no longer launders a post-install
globalThis.fetch write into a fresh wrapper synchronously — the old
accessor's setter did that instantly, the new design re-adopts the
evictor as downstream within one watchdog tick (disclosed behavior
change: assignment-heal instant -> <=1 s). This test rearms a dying
fetch and immediately calls through globalThis.fetch, so under the new
timing the immediate read sees the raw third-party function and the
TypeError escapes instead of being converted to the 422 refusal whose
wording the test pins. Drive one deterministic tick after the re-arm so
the call enters through the intercept; the pinned mechanism (dead-proxy
refusal wording, empty sink) is unchanged.
@ranxianglei

Copy link
Copy Markdown
Owner Author

冲突 是不是重复

… with #5907

Master's #5907 (7b09b2f) names the two no-guard fetch postures in
bili.log inside the classic-install branch that this PR restructures,
and pins both postures with tests at the end of the selfheal suite.
Resolution keeps both intents: the #5907 warn block lands inside the
post-merge escape-hatch branch (the desc.configurable gate is unchanged
by this PR), and its two tests keep their required ordering — the
env-hatch test before, the slot-locking non-configurable test LAST in
the file.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

不是重复——这个冲突标记是「两个不同改动碰了同一段代码」的文本重叠,不是有人把同一件事又修了一遍。已解决并推送,冲突标记已消(live 验证:mergeable: true)。

冲突到底是什么

master 上只有 一个 commit 碰了这两个文件:7b09b2fefa(#5907)——它在 installFetchChain 的「经典直装、无守卫」分支里加了两条 warn 日志(点名 BILI_RECLAIM_FETCH_PATCH=0 与宿主 fetch 不可配置这两种静默脱路由姿态),并在 selfheal 测试文件尾部加了两个钉住这两条日志的测试。而本 PR(#5959)恰好重构了同一个分支区域(数据属性 + 看门狗)。两边意图互补、位置相撞 → 文本冲突。

注意区分:之前那次 seed 修复(你的 7fd23aa8d4 与我的 8f6d359906)那才是真重复——字节级相同,git 平凡自动合并,没有产生任何冲突标记。这次的红标与它无关。

怎么解决的(union of intent,两边都保留)

验证(合并后树)

当前状态(live)

head 1e53ad3005(含你刚推的 issue4516 时序修复 c8bb6abc55 + 本次 master 同步 1e53ad3005),mergeable_state: blocked = 分支保护在等新 head 的 CI 跑完,不是冲突。CI 绿后即可人工合并。

ci-check added 2 commits November 10, 2026 14:37
…review)

The integrity check read globalThis.fetch bare (typeof check invokes the
getter). A hostile third-party GETTER that throws escaped the setInterval
callback as an uncaughtException and killed the host process — exactly the
failure class the write side of the same check already guards against.
Swallow the read (current = undefined → re-anchor onto the module anchor,
or stay quiet while given up); a configurable throwing getter now self-heals
within one tick via the existing assign→defineProperty fallback. Pinned by a
new regression test that fails on the pre-fix code.
…al test

The old comment claimed the failure counter restarts after a given-up
repair retry; it does not — failures keeps counting (3→4→...) and the
give-up error re-fires every tick while the hostile getter persists.

@ranxianglei ranxianglei left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Verdict: APPROVE (posted as a comment review — GitHub refuses a formal APPROVE on the author's own pull request; human approval + merge remain with you) — root fix verified end-to-end; two small findings fixed on the spot below (verdict unchanged).

Direction (①): This is the long-missing root fix for #5959 — DSH's experimental inspector refuses to observe an accessor globalThis.fetch ("is an accessor and cannot be observed safely"), which bricks the native lane under DSH hosts; predecessors #3528/#2791 are closed, root-fix draft #2804 closed unmerged. Confirmed against master that setter-only healing can never see DELETE/REDEFINE evictions, so the watchdog is required, not optional. The documented deviations from the #2804 draft (1 s vs 30 s interval, consecutive-failure give-up vs lifetime counter, logHostEvent instead of the dropped onIntegrityEvent hook) are reasonable and disclosed.

Regression inventory (②) — pre-change behavior of every touched path, read from master, not just the diff:

  • #1158 assignment self-heal → preserved (watchdog heal uses the same adopt-as-downstream policy)
  • pi-web-access quiet adoption handshake (#2685/#2435) → preserved (__piWebAccessProxyFetch check kept, one-time info line)
  • BILI_RECLAIM_FETCH_PATCH=0 classic path incl. #5907 warn wording → byte-identical, no watchdog armed
  • resetFetchChainForTest slot protection (#1410: restore only while slot holds our top) → preserved, now stops the watchdog first
  • makeChain re-entry termination (#1662) → untouched
  • double-install semantics (src/agent/pi-inline.ts:33 before src/agent/native-intercept.ts:1333) → identical to master (second install wraps first's top; orphan-on-heal is pre-existing, not introduced here)
  • docs en/zh match tools/gen-config-docs.mjs generator output exactly (zero drift, ran locally); no kernel/, no version bump, no new config surface
    All behavior changes are exactly the six old→new disclosures in the PR body (accessor→data property = THE FIX; heal latency instant→≤1 s; third-party read-back window until next tick; own stale write-back resyncs instead of masking; new give-up concept; known ≥~10K-wraps-per-period burst limitation characterized as hostile shape). No undisclosed drift found.

Code (③): healthy/eviction split correct; every write failure counted as a failed repair rather than escaping the timer callback; unref'd timer can't hold the process; give-up re-arm conditions symmetric (healthy slot OR live fetch reappears); REARM_LIMIT caps logging only, routing authority always returns within one tick.

Tests (④): teeth present — verbatim inspector-guard repro, delete+redefine heal both directions with real routing asserts through the adopted downstream sink, hostile-swallowing-accessor give-up/re-arm with exact log-line asserts, idle-tick no-layer-accumulation, real-timer drive test, non-config crash regression isolated in its own file with the slot-locking test correctly LAST, gate discipline #3617 asserted both directions. Sinks compared (actual routing), not flags.

CI: all green at 1e53ad3 (30 checks, 0 failed, read from mirror cache). My two fix commits below push the head to b512c3b; they are mechanical (guarded read + its regression test + one comment) and locally verified: typecheck clean, targeted suites 44/44, and the new regression test provably FAILS on the pre-fix code. Full suite re-runs on the new head.

Small findings fixed on the spot:

  1. src/agent/fetch-chain/index.ts:284 — the eviction READ (typeof globalThis.fetch === "function") invokes a third-party getter; a getter that THROWS escaped the setInterval callback as uncaughtException → host process death. Same failure class the write side of the same check already guards ("an uncaughtException there kills the host process"), missed on this read. Now swallowed → current=undefined → re-anchor onto module anchor (a configurable throwing getter self-heals within one tick via the existing assign→defineProperty fallback) or stay quiet while given up. Pinned by a new regression test (fails pre-fix, passes post-fix).
    已顺手修:watchdog eviction 读侧对抛错 getter 的守卫(读侧此前会把 uncaughtException 漏出 setInterval 回调杀死宿主进程,写侧早已防、读侧漏了)+ 回归测试,commit 0b78bde
  2. tests/native-intercept-selfheal.test.ts:762 — comment claimed "(counter restarts)" after a given-up retry; factually wrong — failures keeps counting (3→4→…) and the give-up error re-fires every tick while the hostile getter persists. Comment corrected to match code facts.
    已顺手修:hostile-accessor 自愈测试里「(counter restarts)」注释与代码事实不符(failures 持续累加、give-up 错误每 tick 重发),改为准确表述,commit b512c3b

Residual accepted (not debt): a persistent hostile-swallowing accessor re-logs the give-up error once per second while it persists — pathological state only, durable log, below the fix-effort bar.


八问(中文)

  1. 是什么问题:DSH experimental-inspector 拒绝观察 accessor 形式的 globalThis.fetch(报 "is an accessor and cannot be observed safely"),DSH 宿主下 bili native 拦截装不上、模型流量绕过压缩直连上游(#5959,最初报告 #3528);且旧 setter 自愈看不见 delete/redefine 型驱逐(#2791)。
  2. 什么原因导致的:安装用了 getter/setter accessor——inspector 判定不安全直接抛错;setter 只在「赋值」时触发,DELETE/REDEFINE/恶意 getter 全部绕过,驱逐后拦截永久失效直到重启。根因在「安装形态 + 自愈覆盖面」,不是 inspector 的 bug。
  3. 影响范围与严重程度:开启 DSH 实验检查器的宿主(Electron 系,DSH 0.2.2-rc.1/Electron 44.7.0/Node 24.21.0)下 native 车道完全不可用;其他驱逐形态下静默失路由。特定条件不可用,非全量用户。
  4. 怎么修复的:默认安装改为普通 writable data property(inspector 守卫原样通过);另加 1 s 完整性看门狗重读描述符,对赋值/delete/redefine/恶意 accessor 一律按既有 adopt-as-downstream 策略修复;连续 3 次无效修复才放弃并大声报错,槽位恢复健康或活 fetch 再现自动重新武装。
  5. 是否有回归问题:无。逐项核过既有行为(清单见上 ②):#1158/#2685/#2435/#5907/#1410/#1662 全部保持;PR 正文已按旧值→新值披露 6 项有意变更(含已知局限:单周期内 ≥~1 万外部包裹可致下轮栈溢出,定性为对抗性形态,信任域=进程退出)。本轮审核又补上读侧抛错守卫(见发现 1),属同一失败域的补漏,非语义变更。
  6. 是否破坏缓存:不涉及——纯进程内全局属性安装/修复路径,不触碰消息缓存、重试游标、去重键。
  7. 是否改了设计方向:不涉及架构转向;是既定方向(#2804 草案)的落地,与草案的三处偏差均已在正文披露并给出理由(1 s 而非 30 s;连续失败计数而非终身计数;诊断走 logHostEvent 持久日志而非新增 hook)。
  8. 是否引入了新的配置:无新 env/config/knob;复用既有 BILI_RECLAIM_FETCH_PATCH 逃生门,其行为不变(经典安装 + 无看门狗)。

判定:可合(APPROVE) —— 根因修复成立、测试有牙、CI 全绿;两项小发现已就地修掉并各自留痕(commit 0b78bde / b512c3b),新 head b512c3b 待 CI 复跑。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

查重: 不重复 —— 本 PR 是 #5959 的根因修复;前序 #3528/#2791 均已关闭,根修草案 #2804 已关闭未合入,无其他在途 PR 触碰 fetch-chain 看门狗路径。

Review complete → verdict: APPROVE(完整审核已发在 PR #6017;GitHub 拒绝作者对自己 PR 的正式 APPROVE,故以 review-comment 形式发布并写明判定——人工批准与合并仍归 owner)。head 现为 b512c3b(含我就地修的两个 commit);CI 在 1e53ad3 全绿(30 checks / 0 failed,镜像缓存读取),新 head CI 复跑中;两个修复 commit 已本地验证(typecheck 干净、定向套件 44/44、新回归测试在修复前代码上可证失败)。

已顺手修:watchdog eviction 读侧对抛错 getter 的守卫 + 回归测试 —— 读侧 typeof globalThis.fetch === "function" 会调用第三方 getter,抛错时把 uncaughtException 漏出 setInterval 回调杀死宿主进程(写侧早已防、读侧漏了);修复后可配置的抛错 getter 一个 tick 内自愈 + commit 0b78bde
已顺手修:hostile-accessor 自愈测试里「(counter restarts)」注释与代码事实不符(failures 持续累加 3→4→…、give-up 错误每 tick 重发),改为准确表述 + commit b512c3b

八问(中文)

  1. 是什么问题:DSH experimental-inspector 拒绝观察 accessor 形式的 globalThis.fetch(报 "is an accessor and cannot be observed safely"),DSH 宿主下 bili native 拦截装不上、模型流量绕过压缩直连上游(bili-native overrides globalThis.fetch via an accessor, causing DSH experimental-inspector to report "cannot be observ | bili-native 用 accessor 接管 globalThis.fetch 导致 DSH experimental-inspector 报「cannot be observed safely」无法启动 #5959,最初报告 [plugin] Guarded globalThis.fetch accessor blocks coexisting fetch observers (dsh experimental-inspector fails to load) #3528);且旧 setter 自愈看不见 delete/redefine 型驱逐(dsh anthropic-messages lane bypasses native-intercept fetch patch: anonymous pfa-* session, fold ledger orphaned, silent ~182s re-fold on cross-protocol switch #2791)。
  2. 什么原因导致的:安装用了 getter/setter accessor——inspector 判定不安全直接抛错;setter 只在「赋值」时触发,DELETE/REDEFINE/恶意 getter 全部绕过,驱逐后拦截永久失效直到重启。根因在「安装形态 + 自愈覆盖面」,不是 inspector 的 bug。
  3. 影响范围与严重程度:开启 DSH 实验检查器的宿主(Electron 系,DSH 0.2.2-rc.1/Electron 44.7.0/Node 24.21.0)下 native 车道完全不可用;其他驱逐形态下静默失路由。特定条件不可用,非全量用户。
  4. 怎么修复的:默认安装改为普通 writable data property(inspector 守卫原样通过);另加 1 s 完整性看门狗重读描述符,对赋值/delete/redefine/恶意 accessor 一律按既有 adopt-as-downstream 策略修复;连续 3 次无效修复才放弃并大声报错,槽位恢复健康或活 fetch 再现自动重新武装。
  5. 是否有回归问题:无。逐项核过既有行为:方式一安装的dsh 原生插件:llm-pi-ai 传输(OpenAI SDK + options.fetch 注入)绕过 globalThis.fetch 拦截,模型请求不进代理、压缩完全不生效 #1158 赋值自愈 / [Bug][Logging] pi-web-access 正常首次安装触发 #1158 warning,被描述为 evict attempt(0.1.191) #2685+fix: preserve pi-web-access proxy fetch coexistence #2435 pi-web-access 静默共存 / BILI_RECLAIM_FETCH_PATCH=0 经典路径(含 The default modelContextLimit of 200000 underestimates the context window for custom provider routing, and over-window | modelContextLimit 缺省 200000 会把自定义 provider 路由的窗口算小,且超窗的「无归因」请求会被照发而不是本地拒绝 #5907 警告措辞)/ resetFetchChainForTest 槽位保护(bili-native 安装/re-arm globalThis.fetch 不校验所有权,与网络 scope 类插件交错后全局 fetch 悬空 → 全进程 "baseFetch is not a function" #1410)/ makeChain 重入终止(DSH0.1.7-rc.2中billion-context与dsh-codex-subscription的冲突? #1662)/ 双安装语义(pi-inline 先于 native-intercept)全部保持;PR 正文已按旧值→新值披露 6 项有意变更(含已知局限:单周期内 ≥~1 万外部包裹可致下轮栈溢出,定性为对抗性形态)。本轮审核又补上读侧抛错守卫(发现 1),属同一失败域的补漏,非语义变更。
  6. 是否破坏缓存:不涉及——纯进程内全局属性安装/修复路径,不触碰消息缓存、重试游标、去重键。
  7. 是否改了设计方向:不涉及架构转向;是既定方向([PR] fix(#2791): heal setter-invisible globalThis.fetch evictions in the native intercept chain #2804 草案)的落地,与草案的三处偏差均已在正文披露并给出理由(1 s 而非 30 s;连续失败计数而非终身计数;诊断走 logHostEvent 持久日志而非新增 hook)。
  8. 是否引入了新的配置:无新 env/config/knob;复用既有 BILI_RECLAIM_FETCH_PATCH 逃生门,其行为不变(经典安装 + 无看门狗)。

判定:可合(APPROVE) —— 根因修复成立、测试有牙、CI 全绿;两项小发现已就地修掉并各自留痕(commit 0b78bde / b512c3b),新 head b512c3b 待 CI 复跑后由 owner 批准合并。

注:未找到独立的 review-lane 协调 issue(GitHub 与镜像均按标题检索 review lane / 总控 / review-worker / 审查 / 协调,均无命中;#4599 为 CI 专用总控)——本回复即本线程的状态报告。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

Review lane done — PR #6017 verdict: APPROVE(完整审核 + 八问见上方本线程回复及 PR 上的 review)。

  • 方向/回归/代码/测试四关全过:根因修复成立(accessor→data property + 1 s 看门狗),既有行为逐项核过无未披露漂移,CI 在 1e53ad3 全绿(镜像缓存读取),本地 typecheck 干净、定向套件 44/44。
  • 两项小发现已就地修掉并推上 PR 分支(head 现为 b512c3b):① watchdog eviction 读侧对抛错 getter 的守卫 + 回归测试(修复前代码可证失败,commit 0b78bde);② hostile-accessor 测试注释「(counter restarts)」与代码事实不符,改为准确表述(commit b512c3b)。
  • GitHub 拒绝作者对自己 PR 的正式 APPROVE,判定以 review-comment 形式发布并写明——人工批准与合并归 owner;新 head CI 复跑中。
  • 查重:不重复([PR] fix(#2791): heal setter-invisible globalThis.fetch evictions in the native intercept chain #2804 草案已关闭未合入,无并行 PR 触碰该路径)。

ci-check added 2 commits November 12, 2026 12:45
Resolve the BILI_RECLAIM_FETCH_PATCH conflict in website/config-reference/
env-only.yaml: keep the PR's new en/zh short descriptions and add the matching
ja. Regenerate the generated config docs (docs/configuration.ja.md short row)
and update the hand-written ja long description to match the PR's new behavior
(plain writable data property + integrity watchdog) — master's #6072 had
translated the pre-#5959 wording, so the ja long desc was stale after the merge.

@ranxianglei ranxianglei left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Re-review after master sync — verdict: APPROVE (posted as a comment review; GitHub refuses self-approval on the author's own PR — human approval + merge remain the owner's).

What changed since my last review (head 1e53ad3 → 5762c7d): the author merged origin/master into the branch (2 merge commits). Verified:

  • PR core untouched by the merge: src/agent/fetch-chain/index.ts + all three test files are byte-identical to the previously reviewed head (b512c3b); both of my fix commits (0b78bde throwing-getter guard, b512c3b comment fix) are intact ancestors of the new head.
  • Only new PR-side content: docs/configuration.ja.md (4 lines) + website/config-reference/env-only.yaml desc_ja — master added the Japanese configuration doc (#6076) during the rebase, so the PR's BILI_RECLAIM_FETCH_PATCH wording change now correctly extends to ja. Wording consistent across en/zh/ja (plain writable data property + 1 s integrity watchdog + every eviction shape healed within one tick + give-up after 3 unproductive repairs + 0 = classic install, no watchdog).
  • Verified on the new head: typecheck clean; targeted selfheal suites 44/44 (30+1+13, run per-file); docs generator (tools/gen-config-docs.mjs generate) zero drift across en/zh/ja + yaml seed; CI green — 37 success / 13 skipped / 0 failure on 5762c7d.

八问(供人工审核):

  1. 是什么问题:上一轮的问题不变(native 模式 fetch 自愈守卫的驱逐路径,#5959);本轮是对作者「合入 master」合并提交的重审。
  2. 什么原因导致的:上一轮根因不变(accessor → data property + 1 s 看门狗);本轮无新代码变更——master 新增了 ja 文档(#6076),PR 的措辞变更需要延伸到 ja。
  3. 影响范围与严重程度:无新增影响;影响面同上一轮(native 模式 fetch 自愈守卫,BILI_RECLAIM_FETCH_PATCH)。
  4. 怎么修复的:无新修复;确认合并未触碰 PR 核心代码/测试(byte-identical),ja 文档措辞与 en/zh 及生成器输出一致。
  5. 是否有回归问题:无。合并带入 master 自身变更(如 native-intercept.ts 的 BILI_PLUGIN_BYPASS 工作),那些是 master 已审内容,不出现在 PR 净 diff 里。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:无。
  8. 是否引入了新的配置:无新配置;BILI_RECLAIM_FETCH_PATCH 为既有键,本轮仅补齐 ja 文档描述。

判定:可合(APPROVE)——无新发现,本轮无需就地修复。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

Re-review done (head 1e53ad3 → 5762c7d, author merged master) — verdict: APPROVE again.

ework-agent added 4 commits November 16, 2026 22:51
The probe anchor PROXY_TOOL_AT=6 was calibrated on 2026-10-31 for #4521
(schedule {4,6,8,9}). The nudge scheduling has shifted again — nudge now
lands at {3,5,11,14}. Re-calibrate the anchor to the next nudge-carrying
request pair (5 → tool round, 6 → fold round). The fold/proxy-tool-round
mechanics under test are unchanged.

Closes: master-red on test (windows-latest, 22, 3) and (ubuntu-latest, 22, 1).
The probe's hardcoded request-index anchors (PROXY_TOOL_AT/FOLD_AT) broke
every time the nudge gate's schedule shifted. The last recalibration
(245ecb1) was measured on a direct local run (timestamps ON by default
since #4313), but CI runs the suite preload pin BILI_MESSAGE_TIMESTAMPS="0"
(timestamps OFF) — a different wire shape, a different schedule (no nudge at
index 5) — so it passed locally and failed on every CI shard.

Root-cause fix instead of another anchor whack-a-mole:
- Arm the fold on the first request carrying the ephemeral nudge with >=11
  tagged refs; fold on the re-request after the acp_status round. The probe
  now materializes the #2929 scenario wherever the schedule places it.
- Pin compress.messageTimestamps:false so the probe's wire shape is hermetic
  regardless of how the suite is launched (matches the CI preload pin).

Supersedes the 245ecb1 recalibration. Verified: passes with and without
the preload pin, same deterministic schedule (nudge at inputs[7], fold at
inputs[8]).

@ranxianglei ranxianglei left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Re-review after ci-fixes sync — verdict: APPROVE (posted as a comment review; GitHub refuses self-approval on the author's own PR — human approval + merge remain the owner's).

What changed since my last review (head 5762c7d → 242c974): the branch merged origin/ci-fixes (the master-level CI-fix sentinel) — per the CI coordination policy, inherited CI fixes converge on ci-fixes and PRs merge it to go green.

  • PR core unchanged: src/agent/fetch-chain/index.ts + the other three PR test files are byte-identical to the previously reviewed head; both of my fix commits (0b78bde throwing-getter guard, b512c3b comment fix) are intact ancestors; the PR's 4-line doc wording change (en/zh/ja + yaml seed) is intact in the net diff.
  • Two new net-diff files (both ci-fixes content, reviewed line-by-line):
    • reference/architecture.md (+1): the missing module-map ledger line for src/responses-system-sections.ts (#6922) — correct section (top-level src/), description matches the file's own header, satisfies the architecture-docs lane.
    • tests/issue2929-codex-fold-double-miss.test.ts (66±): the #2929 probe made schedule-independent — hardcoded request-index anchors (PROXY_TOOL_AT=6 / FOLD_AT=7) replaced by a state machine that arms on the first nudge-carrying request with ≥11 refs and folds on the following re-request, plus a hermetic compress.messageTimestamps:false pin. The old anchors broke on every nudge-gate schedule shift (#4521, #6928, #4313). Strictly more robust; all downstream assertions updated consistently.
  • Verified on the new head: typecheck clean; targeted suites 46/46 (selfheal 31/31 stable across 3 runs, nonconfig 1/1, issue4516 13/13, issue2929 1/1); docs generator zero drift (en/zh/ja + yaml + reference/); CI green — 37 success / 13 skipped / 0 failure on 242c974.

八问(供人工审核):

  1. 是什么问题:PR 本体问题不变(native fetch 自愈守卫驱逐路径,#5959);本轮是对「合入 ci-fixes」的合并提交的重审。
  2. 什么原因导致的:无新代码变更——按 CI 协调政策,master 级 CI 修复收敛在 ci-fixes 哨兵分支,PR 合入它以获得绿 CI;本 PR 净 diff 因此新增两个 ci-fixes 文件。
  3. 影响范围与严重程度:无新增影响;影响面同前两轮(native 模式 fetch 自愈守卫,BILI_RECLAIM_FETCH_PATCH)。
  4. 怎么修复的:无新修复;确认 PR 核心 byte-identical,两个新增净 diff 文件(架构台账行 + #2929 探针改造)逐行审过且正确。
  5. 是否有回归问题:无。#2929 探针从硬编码索引锚点改为按 nudge 出现布防的状态机,只影响该测试自身的场景物化方式,不改被测行为;断言全部一致更新。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:无。
  8. 是否引入了新的配置:无新配置;BILI_RECLAIM_FETCH_PATCH 为既有键,文档措辞同前两轮。

判定:可合(APPROVE)——无新发现,本轮无需就地修复。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

Re-review done (head 5762c7d → 242c974, branch merged ci-fixes) — verdict: APPROVE again.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] Re-verified the live state in this run — everything is already green, so no further work was needed.

What this wake reported vs. what's live now

  • The 3 shards flagged as failing (test ubuntu-latest 24/3, windows-latest 22/3, ubuntu-latest 22/3) are now success. An earlier wake already fixed the #2929 fold-probe test (7247410976 make probe schedule-independent + hermetic wire shape, 245ecb1a9e recalibrate probe anchor to nudge positions {3,5,11,14}) and merged ci-fixes, advancing the head from eed90ebf8d to 242c97482d.

Live check (mirror cache, head 242c97482d)

  • 30/30 checks green: all 11 test shards success, both static-gates success, mysql-contract success, all gate success; 0 failed, 0 pending.

Merge state (GitHub API, head 242c97482d)

  • mergeable: true — the conflict is resolved (my earlier merge 5762c7db45 that synced master and resolved the BILI_RECLAIM_FETCH_PATCH env-only.yaml conflict is in this head's history).
  • mergeable_state: blocked — this is branch-protection (required reviews), a human action, not a CI red.

Nothing to fix this run. Stopping.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] Re-verified the live state in this run — everything is already green, no further work needed.

Reported vs. live

  • This wake flagged head 073dd88b39 (run 43908630178) with 3 failing shards (windows 22/3, ubuntu 22/3, ubuntu 24/3). That head is stale — it's an ancestor of the current head. The live remote head is 242c97482d, which advanced past it (the #2929 fold-probe fix 7247410976 + 245ecb1a9e and the ci-fixes merge are already in).

Live check (mirror cache, head 242c97482d)

  • 30/30 green: all 11 test shards success (incl. the 3 flagged), both static-gates success, mysql-contract success, all gate success; 0 failed, 0 pending.

Merge state (GitHub API, head 242c97482d)

  • mergeable: true — conflict resolved (my merge 5762c7db45 is in this head's history).
  • mergeable_state: blocked — branch-protection (required reviews), a human action, not a CI red.

Nothing to fix this run. Stopping.

This branch has not been deployed

No deployments
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/wiring

Projects

None yet

1 participant