Skip to content

[PR] fix: judge no-visible-context permanence against active peers (#5111) - #5118

Open
ranxianglei wants to merge 12 commits into
masterfrom
2026-10-29_resident-pressure-idle-peers
Open

ranxianglei wants to merge 12 commits into
masterfrom
2026-10-29_resident-pressure-idle-peers

Conversation

@ranxianglei

@ranxianglei ranxianglei commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner

Part of #5111 — the verdict-honesty portion plus the live-repro diagnostics follow-up. The graceful-recovery direction for sustained over-budget pools (grace pinning vs thinned resident view) is still pending owner decision in #5111; this PR ships the parts with no decision dependency.

What was wrong

The no-visible-context refusal's "NOT TRANSIENT" verdict (#3918) counted ALL other resident sessions' weights against the pool budget. But admission (makeResidentRoom) seats any session whose own weight fits the budget by evicting the OLDEST idle residents first. So when the budget is occupied by leftover IDLE sessions, the next model request heals the view automatically — and the receipt was steering users toward closing sessions / raising sessions.residentMaxBytes / restarting unnecessarily. That false "not transient" framing is exactly what the #5111 reporter followed.

Fix (commit 1)

  • residentPressure (src/session.ts): permanence is now judged against ACTIVE peers only (traffic within 5 min, internal constant PEER_ACTIVE_WINDOW_MS) plus the self-exceeds-whole-budget case:
    • permanent = weight > budget || weight + activeOtherBytes > budget
    • interface gains activeOtherBytes; otherBytes (total others) kept for diagnostics
  • Refusal receipt/log (src/stream.ts): two distinct permanent wordings —
    • self alone exceeds the whole budget → "closing other sessions will NOT free room for it"; raise-limit exit only
    • active peers hold the budget → existing exit set, now quoting active-peer bytes
  • New suite tests/issue5111-resident-pressure-idle-peers.test.ts pins both directions (idle peer → transient self-heal wording; active peer → permanent; self>budget alone → permanent with its own exits) plus unknown-session behavior.

Fix (commit 2, live-repro follow-up)

A live repro (DSH on Windows, bili 0.1.209) showed the refusal asserting over-budget eviction as THE cause while the persisted-view fallback (#3982) silently failed for its own unexplained reason, and the quoted footprint carried no timestamp although the pool drains between requests (the reporter's /__bili/memory minutes later read ~6.7 MiB against the quoted ~735 MiB). Additive-only changes:

  • storedTailViewStatus (src/persist.ts): the compress-from-store: evicted sessions compress against the unified-store view instead of refusing forever (#3918 P4 root fix) #3982 tail read with stable failure reason codes — store-inactive / unified-store-off / sidecar-degraded / read-error / no-persisted-rows / unparsable-row; peekStoredTailView delegates to it, signature unchanged.
  • The refusal receipt AND operator log now name the reason: "Persisted-view recovery was attempted and found nothing readable (<reason>)."
  • The quoted footprint carries its measurement age (", measured Ns ago") so a later /__bili/memory reading is not misread as contradicting the refusal.
  • Two new regression tests pin the exact reason code for the fixture shape and the measured-age wording.

Behavior change disclosure (old → new)

Branch state (2026-10-31)

Rebased onto master f9cec9f and re-merged origin/ci-fixes per the #4599 coordination protocol (the sentinel had earlier merged ci-fixes into the stale base). Merge conflicts in src/codex-models.ts / src/pack-install.ts resolved by taking master's versions, which carry the same gate fixes in improved form (surrogate-safe text-safe slice, #5340 windows npm shim).

Verification

  • Targeted local (per local-testing discipline), post-merge head: issue5111 (6 tests) + issue3918 + issue3126 + issue3859 + compress-from-store = 23/23 green; memory-diagnostics + session-gc + session-transient-memory + issue404 + bounded-storage = 46/46 green; typecheck clean. Full-suite verdict on CI.

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-29_resident-pressure-idle-peers (29520b3)

Latest build — install this exact version

npm install -g billion-context@0.0.9578-pr.5118.38dec8d

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
29520b3 billion-context@0.0.9578-pr.5118.38dec8d build
3e60ae1 billion-context@0.0.9478-pr.5118.f95a977 build
32eb5fd billion-context@0.0.9409-pr.5118.40673d2 build
78b6aaa billion-context@0.0.9235-pr.5118.43e6f83 build
09e1a14 billion-context@0.0.9208-pr.5118.448004f build
975ce16 billion-context@0.0.7533-pr.5118.f105d46 build
af17c91 billion-context@0.0.7524-pr.5118.3d4ec0b build
c72f836 billion-context@0.0.7199-pr.5118.507b7ed build
22984fe billion-context@0.0.7132-pr.5118.f17b380 build
192ca2d billion-context@0.0.6944-pr.5118.d1e9e97 build

Download artifact

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

Install instructions are refreshed on each push.

@ranxianglei ranxianglei changed the title fix: judge no-visible-context permanence against active peers (#5111) [PR] fix: judge no-visible-context permanence against active peers (#5111) Oct 29, 2026
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

查重:不重复。 本条是 #5111「判定诚实化」子部分的实现 PR(Part of #5111);同家族谱系 #3126(空视图拒绝门)/ #3918(原非瞬态判定)/ #3982(存储尾部兜底)机制各不相同,无重复立项。

标签:pr(已有)+ bug、scope/wiring、p1 —— 机制位于 compress 工具请求路径(驻留池判定 + 拒绝回执),与 #5111 家族分类一致;宿主客户端未知,不打客户端标签。

核对结论(对 master 源码独立复审,未复用 issue 侧结论)

八问

  1. 是什么问题:resident 池超预算且预算被空闲遗留会话占着时,拒绝回执谎称「无法自愈,需关会话/调限额/重启」,把用户引向不必要的人工操作;实际下一次模型请求就会自动恢复。
  2. 什么原因导致的:判定侧把全部驻留对端计入永久公式,准入侧却按 lastSeen 最旧优先驱逐(空闲者必然让位)——两侧假设不一致,产出虚假的永久判定。
  3. 影响范围与严重程度:并发跑多个大会话、池超预算的用户(即 Resident-pool eviction prevents context recovery after compression fails #5111 场景);拒绝本身是对的(视图确实为空),错的是指引→用户做不必要的人工操作;压缩停摆本身属 p1 家族,结构性缺口(宽限钉住 vs 瘦驻留)在 Resident-pool eviction prevents context recovery after compression fails #5111 待 A/B 拍板,本 PR 不碰它。
  4. 怎么修复的:让判定与准入语义对齐——永久判定只计活跃对端(5 分钟内有流量)+ 自身单独超整个预算的情形;拒绝文案按成因分叉:自超明说「关别人没用」、只给调限额出口;活跃对端争抢用原出口集、数字改引活跃对端字节数;空闲对端降级为仅诊断字段。
  5. 是否有回归问题:逐项审过既有行为——唯一消费方收敛(见上);非永久分支逐字节不变;[dsh] A healthy 93%-compressed image session becomes permanently uncompressed by ordinary usage: quota → model switch → attribution loss → 413 → rewind → 3,455 dead refs → compress REFUSED forever (0.1.202) | 一个健康压缩率 93% 的图片会话被普通操作永久废掉:额度→换模型→丢归因→413→撤回→… #3918 场景判定不变;自超预算判定不变(仅措辞细化);未知会话行为不变;日志标记形状不变;wire/配置面/kernel/持久化格式均无变更(config-surface-guard、kernel-guard 绿)。一处有意行为变更(PR 正文已披露):「自身放得下+对端空闲」情形回执从假 NOT TRANSIENT 改为如实的瞬态自愈措辞(旧值→新值:虚假永久断言→真实瞬态断言),这就是修复本身。
  6. 是否破坏缓存:不涉及——不碰线上任何字节,前缀缓存/重试/增量游标不受影响。
  7. 是否改了设计方向:否。只让判定对齐既有准入语义,不引入新机制;5 分钟窗口是内部常量。
  8. 是否引入新配置:无。PEER_ACTIVE_WINDOW_MS=5min 为内部常量,遵循 hardcoded-by-design 纪律。

CI 状态(head 14a5043)

静态守卫全绿(kernel-guard / config-surface-guard / lane-guard / version-guard / docs-sync …);测试套件运行中:最新快照 0 失败、12 项进行中(测试分片)、14 项按设计跳过(e2e 门禁)。全套件以 CI 为准。

收工判定:代码核对与回归审查通过,base 与 master 同步、无需动作;等剩余测试分片转绿即可由 owner 合并(我不合并)。CI 全绿后我会补一条确认。另:优雅恢复方向(A 宽限钉住 / B 瘦驻留)仍在 #5111 等你拍板,本 PR 可先独立合入。

@ranxianglei ranxianglei added bug Something isn't working p1 scope/wiring labels Oct 29, 2026
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

CI 已跑完,全绿。 上一条回复承诺的确认:

  • 完整套件通过(head 14a5043,按 workflow run 逐 job 核对):11 个测试分片(ubuntu/windows × node 22/24)全部 success;static-gates ×2、mysql-contract、全部守卫 job(kernel-guard / config-surface-guard / lane-guard / version-guard / lock-sync / docs-sync / docs-coverage / pi-subagents-guard / lifecycle-ledger-guard / test-import-graph / unused-exports / plan)、build-artifact 全部 success;e2e/real-client 各车道按设计跳过(门禁未开)。该 commit 名下 137 条 check 记录:0 失败、0 进行中。
  • 一个插曲:约 08:15 出现第二次 CI 运行,在跑完任何 job 前被整体取消(队列中的 job 全部 cancelled,未产生新结果),对结论无影响。若那是你手动触发的重跑且想要一份新鲜结果,再点一次 re-run,我继续盯。
  • 小提醒:GitHub 当前给这个 PR 的合并状态标签仍显示「behind」,但已用 compare API 直接验证 master sha == PR base(均为 885b948,identical)——是状态标签滞后,不需要 rebase;标签会在下次重算时自行消失。如果合并时它还挡着,说一声我立刻处理。

收工判定:CI 全绿 + 代码核对与回归审查通过,PR #5118 可以合并了(合并动作归你)。#5111 那边的优雅恢复方向(A 宽限钉住 / B 瘦驻留)仍在等你拍板,与本 PR 独立。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

结论先行:run 41068286472 的 4 个失败 shard 全部是继承性 master 红,与本 PR 的 diff 零交集(4 份 job 日志对本 PR 领域 resident-pressure|issue5111|issue3918|residentPressure|makeResidentRoom|no-visible-context grep 全空)。已按 CI 协调规则把哨兵维护的 ci-fixes@67f8e8940 merge 进 PR 分支并推送(22984fe4b → c72f83612)。该 tip 含 #5140 的 BILI_STORAGE_UNIFIED="full" 存储模式钉,预期清掉 3 处 plugin-fork #5140 冷恢复失败、让 ubu24s3 转绿。残留红是尚未收敛进 ci-fixes 的 master 级家族,在 #4599 由哨兵跟踪,不属于本 PR 范畴、不在本分支重复修。本 PR 逻辑无需任何设计决策,故不开 decision request。

结构化八问:

  1. 是什么问题:PR 分支有 4 个 test shard 红;查证后确认这不是本 PR 引入的缺陷,而是 round-2 sync 把自带 6 个红 shard 的 master@44067a5bc 合进来后继承的红。
  2. 什么原因导致的:master@44067a5([Performance] v0.1.208 long sessions exceed 2 GiB memory and spend 14–22 seconds in local processing #4788 D2 每会话硬上限,与本 PR 同属 resident-memory 域)本身在这些测试家族上是红的——CI Control Center: Centralized CI Failure Handling & Status Sync (Comment all CI issues here; do not open new issues) | CI 总控: CI 失败集中处理与状态同步(所有 CI 问题在此评论, 勿开新 issue) #4599 floor 607–621 已逐条记录:issue4788-resident-minimal born-red cancelledByParent(event-loop hang,非断言)、[Bug][fork] Cold restore cannot use an intact unified raw tail for a non-retained parent (#4266 item 4) #5140 cold-tail 409、promptCache.routing is ignored by relay-affinity stamping; no way to persist per-endpoint prompt_cache_key abatement (0.1.209) #5103 win32 db-path、issue4739 Windows EBUSY。因果链:master 红 → 被 PR 继承 → PR CI 红,不是本 PR 的逻辑 bug。
  3. 影响范围与严重程度:仅 CI 门禁层面阻塞合并;不影响本 PR 交付的功能本身(resident-pressure「对 idle peer 判 transient / 对 active peer 判 permanent」的逻辑与其定向测试均通过)。严重度 = 体验瑕疵(合并被环境噪声挡住),非功能缺陷。
  4. 怎么修复的:按 CI 协调规则第 2 条(继承红 → merge ci-fixes → push → 在 CI Control Center: Centralized CI Failure Handling & Status Sync (Comment all CI issues here; do not open new issues) | CI 总控: CI 失败集中处理与状态同步(所有 CI 问题在此评论, 勿开新 issue) #4599 留一行)执行。merge 干净,只动 tests/plugin-fork.test.ts(+9/-1,即 [Bug][fork] Cold restore cannot use an intact unified raw tail for a non-retained parent (#4266 item 4) #5140 存储模式钉),本 PR 三个文件(session.ts / stream.ts / issue5111 新测试)未被触碰。
  5. 是否有回归问题:merge 未触碰本 PR 的 src 改动,无回归面。既有行为逐项过:resident-pressure 判定公式不变、refusal 双永久措辞不变、接口新增字段为 additive(activeOtherBytes,保留 otherBytes)——均保持。
  6. 是否破坏缓存:不涉及(纯内存压力判定 + 日志文案,不触碰缓存/重试/游标/去重键)。
  7. 是否改了设计方向:不涉及(方向未变;残留红的根治由 CI Control Center: Centralized CI Failure Handling & Status Sync (Comment all CI issues here; do not open new issues) | CI 总控: CI 失败集中处理与状态同步(所有 CI 问题在此评论, 勿开新 issue) #4599 哨兵统一收敛)。
  8. 是否引入了新的配置:不涉及(无新 env/config/默认值;PEER_ACTIVE_WINDOW_MS=5min 为本 PR 内部常量,原 PR 已说明)。

收工判定:本 PR 侧能做的已全部完成(ci-fixes 已合、已推 c72f836),等 CI 在新 head 重跑。若重跑后仅剩 issue4788 / #5103 / issue4739 这些 master 级家族红,那是哨兵收敛进 ci-fixes 的事,本 PR 可随其转绿,无需再动。状态已留一行至 #4599。

@ranxianglei
ranxianglei force-pushed the 2026-10-29_resident-pressure-idle-peers branch from c72f836 to af17c91 Compare October 31, 2026 12:12
ci-check added 3 commits October 31, 2026 20:34
…ard (#5111)

Gate repair accompanying the ci-fixes merge: commit 2 switched the sole
caller to storedTailViewStatus, leaving the thin wrapper unused. Deleted
per the guard's DEAD prescription; the docblock now matches the surviving
function's {view, reason} shape.
… the ci-fixes merge (#5319)

Gate repair accompanying the ci-fixes merge: the sentinel's seed fix
(#4599, 701688d) re-added the 'chat' builtin pack to compress.yaml while
master's md had been regenerated without it (a4bbf47) — a semantic
conflict the text merge could not see, red on docs-sync. Regenerating
restores #5319's lost doc line in en+zh and makes seed/md/html agree.
Conflict resolution for #5118 (merge state dirty):
- src/session.ts residentPressure(): union of #5111 active-peer permanence
  judgment (PEER_ACTIVE_WINDOW_MS, activeOtherBytes) and master's #5782
  cold-load grace exemption (!graced && ...); doc comments merged likewise.
- CONFIGURATION.md / CONFIGURATION.zh-CN.md: take master's redirect stubs
  (docs moved to docs/ per #5920); port this PR's compress.promptPack
  chat-pack line into docs/configuration.md + .zh-CN.md by restoring the
  seed entry and regenerating with tools/gen-config-docs.mjs (zero drift).
- website/config-reference/compress.yaml + website/docs/index.html: restore
  the PR-side promptPack chat entries that hunk alignment silently dropped.

Verified locally: typecheck clean; tests/issue{3126,3859,3918,4788,5111,5782}
all pass (28/28); gen-config-docs coverage OK; config-surface-guard OK.
Full-suite verdict deferred to CI on the pushed head.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

查重: 不重复 — 这是同一 PR 冲突自动修复车道的重触发,非新工作项;本轮完成了上轮未推的合并提交。

What was done this run

PR #5118's head branch (2026-10-29_resident-pressure-idle-peers) conflicted with master (merge state dirty). I merged origin/master into the branch, resolved every conflict, and pushed as a plain fast-forward merge commit (no rebase, no force-push): 975ce16ac2 → 09e1a14eab. A git fetch immediately before the push confirmed the remote head had not moved (no concurrent agents on the branch).

Conflicts resolved (3 files):

  1. src/session.ts — two independent concurrent changes to residentPressure(): this PR's Resident-pool eviction prevents context recovery after compression fails #5111 change (permanence judged against ACTIVE peers only: PEER_ACTIVE_WINDOW_MS, activeOtherBytes) vs master's [Bug][dsh] Proxy OOMs by self-hitting the 8 GiB heap in ~30-90 min: resident pool budget (512 MiB) is smaller than a single session, so every round thrashes cold-load/evict and allocates giant temporaries #5782 change (cold-load grace exemption: isColdLoadGraced). Resolved as the union of both mechanisms:
    permanent: !graced && weightBytes !== undefined &&
        (weightBytes > MAX_RESIDENT_BYTES || weightBytes + activeOtherBytes > MAX_RESIDENT_BYTES),
    A graced resident is transient regardless of peers; otherwise the Resident-pool eviction prevents context recovery after compression fails #5111 active-peer judgment applies. Doc comments merged likewise (both the Resident-pool eviction prevents context recovery after compression fails #5111 and [Bug][dsh] Proxy OOMs by self-hitting the 8 GiB heap in ~30-90 min: resident pool budget (512 MiB) is smaller than a single session, so every round thrashes cold-load/evict and allocates giant temporaries #5782 sentences are present).
  2. CONFIGURATION.md / CONFIGURATION.zh-CN.md — whole-file conflict: master moved the config docs to docs/ ([PR] docs: batch-migrate 14 root-level documents into docs/ (consolidation + master index + redirect placeholders) | docs: 14 个根级文档一次性迁入 docs/(集中 + 总目录 + 重定向占位) #5920) leaving one-line redirect stubs at root, while this PR edited the old root files. Took master's stubs for both root files and ported the PR's compress.promptPack chat-pack line into docs/configuration.md + docs/configuration.zh-CN.md.
  3. Not a git conflict, but the merge silently dropped it anyway: hunk alignment reverted the PR-side chat-pack entries in website/config-reference/compress.yaml (the single-source seed) and website/docs/index.html. Restored those three seed lines and re-ran node tools/gen-config-docs.mjs generate, which produced zero drift beyond the promptPack line in each generated file — i.e., the docs-sync gate passes by construction.

Local verification (targeted only; full-suite verdict belongs to CI on the pushed head): typecheck clean; six targeted suites green — tests/issue3126-no-visible-context, issue3859-no-visible-context-overlap, issue3918-resident-eviction-refusal, issue4788-resident-minimal, issue5111-resident-pressure-idle-peers, issue5782-cold-load-grace → 28/28 pass; gen-config-docs check-coverage OK; config-surface-guard OK.

Live status after push (verified this run via the mirror check cache, not from memory): mergeable_state = "behind" — the conflict is cleared (no longer dirty; "behind" is not a merge blocker); CI is running on 09e1a14eab: 30 checks, 0 failed, 12 pending as of the last read. Final green/red will be reported by CI; I am not asserting it yet.

No design decision was needed, no authorization gate was hit, the PR body was not touched, and no new issues were opened.


结构化结论(八问,覆盖七问)

  1. 是什么问题:PR [PR] fix: judge no-visible-context permanence against active peers (#5111) #5118 分支与 master 存在合并冲突(merge state dirty),PR 无法合并。
  2. 什么原因导致的:三方并发改动同一区域——本 PR 的 Resident-pool eviction prevents context recovery after compression fails #5111(按活跃 peer 判定拒绝永久性)与 master 的 [Bug][dsh] Proxy OOMs by self-hitting the 8 GiB heap in ~30-90 min: resident pool budget (512 MiB) is smaller than a single session, so every round thrashes cold-load/evict and allocates giant temporaries #5782(冷加载宽限豁免)同时修改 src/session.ts 的 residentPressure();master 另把根目录 CONFIGURATION.md 迁移到 docs/([PR] docs: batch-migrate 14 root-level documents into docs/ (consolidation + master index + redirect placeholders) | docs: 14 个根级文档一次性迁入 docs/(集中 + 总目录 + 重定向占位) #5920)只留重定向 stub,而 PR 还在改旧根文件;此外 git 分块对齐在自动合并时静默丢掉了 PR 侧 yaml seed 与 index.html 里的 chat-pack 文档行。
  3. 影响范围与严重程度:仅阻塞本 PR 合并;解决前无任何已发布行为变化。两个机制语义独立叠加(graced ⇒ transient;否则按活跃 peer 判定),对用户面是两机制并集,无单一机制被削弱。
  4. 怎么修复的:把 master merge 进 PR 分支(非 rebase、非 force-push);session.ts 取两机制并集表达式;根文档取 master stub 并把 promptPack chat 行移植到 docs/configuration.md(+zh);恢复 seed 后用官方生成器重新生成全部配置文档产物(零漂移)。
  5. 是否有回归问题:对照三个钉死套件逐一核对语义均成立——[dsh] A healthy 93%-compressed image session becomes permanently uncompressed by ordinary usage: quota → model switch → attribution loss → 413 → rewind → 3,455 dead refs → compress REFUSED forever (0.1.202) | 一个健康压缩率 93% 的图片会话被普通操作永久废掉:额度→换模型→丢归因→413→撤回→… #3918(驱逐后超预算 ⇒ permanent)、Resident-pool eviction prevents context recovery after compression fails #5111(idle peer 不计入 ⇒ 不再误判 permanent)、[Bug][dsh] Proxy OOMs by self-hitting the 8 GiB heap in ~30-90 min: resident pool budget (512 MiB) is smaller than a single session, so every round thrashes cold-load/evict and allocates giant temporaries #5782(evicted 超预算 ⇒ permanent;graced-resident ⇒ transient)。stream.ts 拒绝文案保留 PR 侧 Resident-pool eviction prevents context recovery after compression fails #5111 措辞(grace 场景走 transient 分支,文案诚实);pack-install.ts 保留 master 的新文档路径引用。typecheck 干净 + 6 个定向套件 28/28 通过。高危模式逐项过:无语义漂移、无 fail-fast 变吞错、无阈值/时序/输出格式变化。
  6. 是否破坏缓存:不涉及——未触碰缓存、重试、增量游标或去重键逻辑。
  7. 是否改了设计方向:不涉及——纯冲突解决,Resident-pool eviction prevents context recovery after compression fails #5111 与 [Bug][dsh] Proxy OOMs by self-hitting the 8 GiB heap in ~30-90 min: resident pool budget (512 MiB) is smaller than a single session, so every round thrashes cold-load/evict and allocates giant temporaries #5782 两个机制原样保留。
  8. 是否引入了新的配置:不涉及——promptPack 仅是文档措辞更新(builtin 列表补 "chat"、解析链补 shipped pack),键名与默认值未变。

判定:冲突已清除(live 验证 mergeable_state 由 dirty 转为 behind),CI 正在新 head 09e1a14 上运行(截至最近读取 0 failed / 12 pending);待 CI 收尾后即可由 owner 合并。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[ework] auto-fix stalled: test (windows-latest, 22, 4), test (ubuntu-latest, 24, 1), test (ubuntu-latest, 22, 1) — stopping for human review

1 similar comment
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[ework] auto-fix stalled: test (windows-latest, 22, 4), test (ubuntu-latest, 24, 1), test (ubuntu-latest, 22, 1) — stopping for human review

… is deterministic (#5118)

The "exact reason code" test asserts the persisted-view fallback receipt
names (no-persisted-rows) — a code that only exists when the unified
sidecar is OPEN (a closed sidecar yields unified-store-off). The ambient
storage mode is environment-dependent: a developer's config may set
storage.unified, but CI's hermetic preload (tests/preload-test-env.mjs)
points XDG_CONFIG_HOME at a fresh temp dir with none, so the sidecar is
closed there and the receipt reads (unified-store-off) — red on the
ubuntu-22/24 shard-1 and windows-22 shard-4 test jobs.

Pin BILI_STORAGE_UNIFIED=shadow at the top of the file (same ambient-env
note as tests/issue4241-judge-render-baseline.test.ts) so the sidecar is
guaranteed open and the receipt is deterministic in every environment.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

CI-engineer run — PR #5118 (attempt 1/3)

Conflict (verified live this run): no longer in conflict. mergeable=True; the behind label is stale — the base (master @ 33104b1f95) is fully contained in the head (09e1a14eab, which already merged master in a prior ci-engineer run). No rebase/sync was needed.

Red CI (the real blocker): 3 test shards were red, all failing the same single test:

  • test (ubuntu-latest, 22, 1)
  • test (ubuntu-latest, 24, 1)
  • test (windows-latest, 22, 4)

All on #5111: the refusal names why the persisted-view fallback came up empty (exact reason code) at tests/issue5111-resident-pressure-idle-peers.test.ts:152. (The shard numbers differ because ubuntu partitions into 3 shards and windows into 5 — the same file lands in ubuntu shard 1 and windows shard 4.)

Root cause: the test is environment-dependent. It asserts the receipt names the persisted-view fallback failure as (no-persisted-rows) — a code that only exists when the unified storage sidecar is open (a closed sidecar yields unified-store-off). On a developer's machine the ambient config sets storage.unified (sidecar open → no-persisted-rows → pass); on CI the hermetic preload (tests/preload-test-env.mjs) points XDG_CONFIG_HOME at a fresh temp dir with no storage.unified (sidecar closed → unified-store-off → fail). Reproduced locally with the exact CI preload chain, then confirmed the fix passes under both the CI and developer-style envs.

Fix: pin BILI_STORAGE_UNIFIED=shadow at the top of the test file (same ambient-env pattern as tests/issue4241-judge-render-baseline.test.ts:32) so the sidecar is guaranteed open and the receipt is deterministic everywhere. Test-only change — no src/ touched. Typecheck clean. Pushed as 78b6aaa4f8 (no force-push; remote head was already an ancestor). This is PR-specific (the PR's own test file), so no ci-fixes merge was warranted.

Waiting on the CI re-run to confirm the 3 shards turn green.


八问(中文):

  1. 是什么问题:PR 的 3 个 CI 测试分片全红,但根因是同一个测试 #5111 exact-reason-code 断言了持久化视图回退的 receipt 文案 (no-persisted-rows),而该文案只在统一存储 sidecar 打开时才存在。
  2. 什么原因导致的:测试依赖环境——开发者机器的 ambient 配置设了 storage.unified(sidecar 开 → no-persisted-rows),但 CI 的 hermetic preload 把 XDG_CONFIG_HOME 指到全新临时目录(无 storage.unified → sidecar 关 → unified-store-off)。测试自身没固定存储模式,导致跨环境不确定。
  3. 影响范围与严重程度:仅影响本 PR 的 3 个测试分片(ubuntu-22/24 shard-1、windows-22 shard-4),不触碰生产行为、不影响其他测试;属 CI 红(测试自身的环境依赖缺陷),不是功能回归,无用户面影响。
  4. 怎么修复的:在测试文件顶部固定 BILI_STORAGE_UNIFIED=shadow,保证 sidecar 打开,使 receipt 文案在所有环境都确定为 no-persisted-rows。沿用仓库既有模式(issue4241 同款 ambient-env 注释)。
  5. 是否有回归问题:无。改动只在测试文件加了一行 env 固定 + 注释,不触碰任何 src/ 生产代码;本地用 CI preload 链复现失败、验证修复通过;typecheck 干净。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:不涉及。
  8. 是否引入了新的配置:不涉及(固定的 BILI_STORAGE_UNIFIED=shadow 是测试进程内的 env,不是新增的用户配置面)。

判定:冲突已不存在(前一轮已解),3 个红分片已修复并推送(78b6aaa4f8),等待 CI 重跑确认转绿。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[ework] CI fix verified green ✓

1 similar comment
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[ework] CI fix verified green ✓

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

CI-engineer run — PR #5118 (second trigger)

Live state verified this run:

  • CI is GREEN (mirror cache, head 78b6aaa4f8): 30 checks — 15 success, 15 skipped (e2e lanes by design), 0 failed, 0 pending. My previous fix (pinning BILI_STORAGE_UNIFIED=shadow in the test file) held — the 3 shards that were red are now green.
  • The blocker is a stale base, not a conflict. master advanced 103 commits past the PR's merge-base; the PR is mergeable_state=behind with mergeable=True (no textual conflict). The system's "dirty" label tracks this behind-state.

What I did: merged origin/master into the PR branch (matching the prior run's merge pattern — no force-push). The merge was clean (no conflicts; master's changes to the shared files src/persist.ts / src/stream.ts landed in different regions than the PR's).

Verified before pushing:

  • PR's key changes survived the merge (storedTailViewStatus/unifiedTailViewDiagnostic in src/persist.ts, residentPressure in src/session.ts, applyRanges in src/stream.ts, the BILI_STORAGE_UNIFIED pin in the test file).
  • The PR's own test (tests/issue5111-resident-pressure-idle-peers.test.ts) passes under the CI preload chain (6/6) after the merge.
  • Typecheck clean (exit 0).

Pushed as 32eb5fd759 (no force-push; remote head was an ancestor). master is now fully contained in the head — the PR is no longer behind. CI will re-run on the new head.


八问(中文):

  1. 是什么问题:PR 落后于 master 103 个提交(mergeable_state=behind),系统报 "merge state: dirty"。不是文本冲突(GitHub 报 mergeable=True),而是基线过期需要同步。
  2. 什么原因导致的:PR 分支停在旧 merge-base(dc041dd1ab),期间 master 合入了 103 个提交(含对 src/persist.ts、src/stream.ts 的修复),导致 PR 落后。CI 本身已绿(上一轮修复生效)。
  3. 影响范围与严重程度:仅 PR 基线过期,不影响生产行为;属 CI 协调(同步基线),非功能缺陷,无用户面影响。
  4. 怎么修复的:把 origin/master 合并进 PR 分支(沿用上一轮的 merge 模式,非 rebase,无需 force-push)。合并干净无冲突。
  5. 是否有回归问题:无。合并干净;PR 的关键改动(storedTailViewStatus/residentPressure/applyRanges/BILI_STORAGE_UNIFIED 固定)全部保留;PR 自身测试合并后 6/6 通过;typecheck 干净。master 对 src/persist.ts、src/stream.ts 的改动与 PR 改动落在文件不同区域,无语义交互。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:不涉及。
  8. 是否引入了新的配置:不涉及。

判定:基线已同步(merge 干净、无 force-push),PR 不再落后,CI 已绿(上一轮修复),推送 32eb5fd759 后等待 CI 在新 head 上重跑确认。

The #5111 change added a second module-level map (evictedWeightAt) beside
evictedWeights, but the test reset only cleared the original. Clearing both
keeps the reset complete so a future test that stamps a new session id cannot
read a stale weight age left over from a prior test.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

Review — APPROVE

Independence: I reviewed the diff against live master source independently — I did not reuse the issue-side or prior-thread conclusions. I read the full 9-file diff (merge-base 259cd87..head 32eb5fd), traced every caller of the changed functions, and ran the targeted suites locally (19/19 green) plus a clean tsc --noEmit.

Correctness (does it do what it claims):

  • residentPressure (src/session.ts:1373) now judges permanence against ACTIVE peers only (PEER_ACTIVE_WINDOW_MS = 5 min) plus the self-exceeds-whole-budget case: permanent = !graced && weightBytes !== undefined && (weightBytes > budget || weightBytes + activeOtherBytes > budget). This aligns the verdict with admission (makeResidentRoom/evictOldest evict the OLDEST idle residents first), so a leftover idle peer no longer makes the refusal falsely permanent. Walked all four shapes: self>budget → permanent (own exits); self fits + active peers block → permanent; self fits + peers idle → transient (the fix); unknown session → not permanent. The [dsh] A healthy 93%-compressed image session becomes permanently uncompressed by ordinary usage: quota → model switch → attribution loss → 413 → rewind → 3,455 dead refs → compress REFUSED forever (0.1.202) | 一个健康压缩率 93% 的图片会话被普通操作永久废掉:额度→换模型→丢归因→413→撤回→… #3918 active-peer shape and the self-exceeds shape are unchanged in verdict, only refined in wording.
  • Non-permanent branch text is byte-identical to before; the PERMANENT log marker keeps its shape (now appends the cause); the new activeOtherBytes/weightAgeMs interface fields are purely additive (otherBytes kept for diagnostics).
  • The persisted-view fallback reason now flows through storedTailViewStatus/unifiedTailViewDiagnostic (src/persist.ts) into the receipt, so "no readable fallback copy" names its cause (store-inactive/unified-store-off/sidecar-degraded/read-error/no-persisted-rows/unparsable-row) instead of asserting over-budget eviction.
  • All callers consistent: recoverEvictedView (now returns the reason) is captured and passed to noVisibleContextRefusal in both lanes (src/stream.ts:1256, src/external-summary-compress.ts:48). No stale refs to the old peekStoredTailView name; the dead export was dropped.

Tests (would they catch a regression): the new suite (tests/issue5111-resident-pressure-idle-peers.test.ts) pins BOTH directions of the gate per #3617 — idle peer → transient self-heal wording (asserts permanent === false, activeOtherBytes === 0, no "NOT TRANSIENT"), active peer → permanent (asserts permanent, "ACTIVE resident sessions"), self>budget → permanent with closing-others advice withdrawn, plus unknown-session and reason-code/age-timestamp rows. Real assertions with teeth; reverting the fix (counting all peers) flips test 1 red. 6/6 pass locally.

Risks / behavior drift (disclosed): the one intentional change is the "self fits + peers idle" receipt: old "NOT TRANSIENT … close sessions / raise limit / restart" → new transient self-heal wording. That IS the fix (the old claim was factually wrong — admission evicts idle peers). No wire change, no config-surface change, no kernel/ change, no persistence-format change.

已顺手修:_resetSessionsForTest (src/session.ts:2203) 漏清 PR 新增的 evictedWeightAt 映射(测试重置不完整,跨测试可能读到陈旧 weightAgeMs)——已加一行 evictedWeightAt.clear(),typecheck 干净、PR 套件 6/6 复跑通过 + commit ac3a9e6

Scope note (non-blocking): the PR also carries a small, correct docs-sync (the compress.promptPack builtin list gains "chat" — the pack exists at src/web/api.ts:180) that came in via the ci-fixes merge / conflict resolution. It is correct and not a config-surface change (schema untouched); noting only for transparency, not a blocker.

Base state: the head is behind current master only by Japanese-docs work (#6072/#6076) — zero overlap with the PR's files, so it merges cleanly; the merge-guard lane owns the behind-state. CI is green on 32eb5fd; my one-line fix commit (ac3a9e6) triggers a re-run.

八问

  1. 是什么问题:resident 池超预算且预算被空闲遗留会话占着时,no-visible-context 拒绝回执谎报「无法自愈,需关会话/调限额/重启」,把用户引向不必要的人工操作;实际下一次模型请求就会驱逐空闲对端、自动恢复视图。
  2. 什么原因导致的:判定侧把全部驻留对端计入永久公式,准入侧(makeResidentRoom/evictOldest)却按 lastSeen 最旧优先驱逐(空闲者必然让位)——两侧假设不一致,产出虚假的永久判定。
  3. 影响范围与严重程度:并发跑多个大会话、或残留空闲会话致总量超预算的用户(即 Resident-pool eviction prevents context recovery after compression fails #5111 场景);拒绝本身是对的(视图确实为空),错的是指引→用户做不必要的人工操作;压缩停摆本身属 p1 家族,结构性缺口(宽限钉住 vs 瘦驻留)在 Resident-pool eviction prevents context recovery after compression fails #5111 待 owner 拍板,本 PR 不碰它。
  4. 怎么修复的:让判定与准入语义对齐——永久判定只计活跃对端(5 分钟内流量)+ 自身单独超整个预算的情形;拒绝文案按成因分叉(自超明说「关别人没用」只给调限额出口;活跃对端争抢用原出口集、数字改引活跃对端字节);持久化视图回退失败原因码写进回执与日志;引用足迹带测量时刻。
  5. 是否有回归问题:逐项审过既有行为——两车道调用方一致(stream.ts + external-summary-compress.ts);非永久分支逐字节不变;[dsh] A healthy 93%-compressed image session becomes permanently uncompressed by ordinary usage: quota → model switch → attribution loss → 413 → rewind → 3,455 dead refs → compress REFUSED forever (0.1.202) | 一个健康压缩率 93% 的图片会话被普通操作永久废掉:额度→换模型→丢归因→413→撤回→… #3918 场景判定不变;自超预算判定不变(仅措辞细化);未知会话行为不变;日志标记形状不变;wire/配置面/kernel/持久化格式均无变更。高危模式逐项过:无语义漂移、无 fail-fast 变吞错、无阈值/时序/输出格式变化(PERMANENT 行形状保留、仅追加成因后缀)。一处有意变更(已披露):「自身放得下+对端空闲」回执从假 NOT TRANSIENT 改为如实瞬态自愈措辞——即修复本身。
  6. 是否破坏缓存:不涉及——不碰线上任何字节,前缀缓存/重试/增量游标/去重键均不受影响。
  7. 是否改了设计方向:否。只让判定对齐既有准入语义,不引入新机制;5 分钟窗口是内部常量(PEER_ACTIVE_WINDOW_MS)。
  8. 是否引入新配置:无。PEER_ACTIVE_WINDOW_MS=5min 为内部常量;chat-pack 文档行仅描述既有 builtin(src/web/api.ts:180),配置 schema 不变。

判定:APPROVE。 代码核对、回归审查、定向测试(19/19)与 typecheck 均通过;一处小缺陷已顺手修(ac3a9e6)。可合入(合并按例由你执行)。#5111 的优雅恢复方向(A 宽限钉住 / B 瘦驻留)仍待你拍板,与本 PR 独立。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 Review complete — APPROVE (full review + 8问 posted above).

# Conflicts:
#	website/config-reference/compress.yaml
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

Base sync + merge-conflict resolution — done and pushed.

This run I synced the PR branch with the current master and resolved the one merge conflict. Summary of what happened:

Note: the 3 red shards from earlier (the #5111 exact-reason-code test) were already fixed in a prior run by pinning BILI_STORAGE_UNIFIED=shadow in the test file (commit 78b6aaa4f8); that fix is intact in this head.


结构化八问

  1. 是什么问题:PR 分支落后 master 35 个提交,且与 master 在 website/config-reference/compress.yaml(compress.promptPack 键)上产生合并冲突;此前一次运行因进程挂起留下一个未完成的合并。
  2. 什么原因导致的:master 给该配置键新增了日文 desc_ja(3 步解析顺序:项目包→用户包→内置),而 PR 侧已把 desc_en/desc_zh 改成 4 步(项目包→用户包→随包附带→内置,对应 New built-in chat prompt pack: default compression rules for long-term companionship / multi-session memory scenarios (e | 新增内置 chat 提示压缩包:长期陪伴 / 多会话记忆场景的默认压缩规则(compress.promptPack="chat" 启用) #5319 的随包附带 pack)。两侧改了同一行且措辞不同 → 冲突。
  3. 影响范围与严重程度:仅配置参考文档(website/config-reference/compress.yaml),不涉及代码/线协议/行为。严重程度:纯文档,无用户可见影响。
  4. 怎么修复的:取并集——保留 PR 的 4 步 desc_en/desc_zh(与代码实际解析顺序一致),保留 master 的 desc_ja 并更新为 4 步(补 同梱(chat));随后把 master 合入分支(仅 compress.yaml 冲突,其余自动合并干净),快进推送(未 force)。
  5. 是否有回归问题:无。代码变更全部来自 master 的 35 个提交(自动合并,master 上已测过);唯一手工改动是 compress.yaml 文档。本地已验证:typecheck 干净,issue5111 测试在 CI 预加载链下 6/6 通过。
  6. 是否破坏缓存:不涉及(无缓存相关改动)。
  7. 是否改了设计方向:不涉及(纯文档)。
  8. 是否引入了新的配置:不涉及(无新配置键)。

判定:冲突已解决、基线已同步、本地验证通过、已推送;CI 在新 head 上重跑中。

ci-check added 2 commits November 13, 2026 21:47
…ine (#5118)

The ja config doc (added to the generated set by the Japanese-docs work)
was missing the compress.promptPack line update from this PR's seed change,
so docs-sync's regenerate-and-diff failed on the merged head. Regenerated
with tools/gen-config-docs.mjs — only the promptPack line changes.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

CI 工程师本轮(重启后继续)—— 红项已修并推送 29520b3985

前两轮(被强制重启前)已把 master 合进 PR 分支并推送 3e60ae127d,冲突已清。本轮重启后核对了该 head 的 CI 终态:29 绿 + 1 红——docs-sync 失败,其余(全部测试分片、mysql-contract、各守卫、build-artifact)全绿,0 pending。

红项根因(PR 自身问题,非继承红): master 的日文文档工作(#6072/#6076)把 docs/configuration.ja.md 加进了 docs-sync 的「重新生成 + diff」检查集。本 PR 改了 compress.promptPack 的 seed(builtin 列表加 "chat")并重新生成了 en/zh 两份文档,但日文那份是在 seed 改动之后才进入生成集的,PR 侧从未对它重新生成——于是合并 master 后 docs-sync 在 docs/configuration.ja.md 的 promptPack 行上产生漂移(CI 日志 diff 与本地复现完全一致,仅这一行)。

本轮动作:

  1. 把当前 master tip(a007974683,含 [PR] storage: pure-SQLite default — JSON envelopes stop being written unless dual-write is requested (#6479) #6480 纯 SQLite 默认、[PR] docs(governance): Announcement policy — no broadcast to all, owner confirmation required, specify scope of impact, plugi | docs(governance): 公告政策——禁止全员广播、owner 确认、写明影响范围、插件公告必须触发式 (#6508) #6514/[PR] fix(notices): gate announcement records on the live conflict scan via requiresScan (#6508) #6509/[notice] The dsh-live-compact plugin is not installed, yet a "dsh-live-compact conflicts with bili compression" notice s | [notice] 没装 dsh-live-compact 插件,却出现「dsh-live-compact 与 bili 压缩冲突」公告 #6508 公告策略、[PR] feat: BILI_PLUGIN_BYPASS operator override for the x-bili-plugin-bypass passthrough (#6220) #6360 plugin-bypass)merge 进 PR 分支——零冲突,merge commit c7c1085048。
  2. 跑 node tools/gen-config-docs.mjs generate 重新生成,恰好只改 docs/configuration.ja.md 的 promptPack 一行(与 CI 失败 diff 逐字对应),独立 commit 29520b3985。
  3. 推送(fast-forward,推送前已 fetch 确认远端 head 未动,无并发写入)。

本地验证(定向,全套件以 CI 为准):

  • typecheck 干净;
  • resident-memory 家族 6 个定向套件(issue5111 本 PR 自身 + issue3126 / issue3859 / issue3918 / issue4788 / issue5782)28/28 通过——合并 [PR] storage: pure-SQLite default — JSON envelopes stop being written unless dual-write is requested (#6479) #6480 纯 SQLite 默认后语义无交互(本 PR 测试钉了 BILI_STORAGE_UNIFIED=shadow,不受存储默认值变化影响);
  • PR 关键改动合并后逐项在位:PEER_ACTIVE_WINDOW_MS/activeOtherBytes/永久判定公式(src/session.ts:1337-1394)、storedTailViewStatus/unifiedTailViewDiagnostic(src/persist.ts)、双车道 noVisibleContextRefusal 调用(src/stream.ts:1257、src/external-summary-compress.ts:49)、测试 env 钉(tests/issue5111-resident-pressure-idle-peers.test.ts:21)。

八问

  1. 是什么问题:PR head 3e60ae127d 的 CI 只剩 docs-sync 一个红——日文配置文档缺本 PR 的 promptPack 行更新,重新生成比对漂移。
  2. 什么原因导致的:日文文档是 master 后期(All repository documentation is available in Japanese. | 仓库所有文档都提供日文版本 #6072/[PR] docs: add Japanese versions of repository documentation (#6072) #6076)才加入生成集的,晚于本 PR 的 seed 改动与 en/zh 重新生成;PR 分支合并 master 后生成集扩大,旧 ja 文本与新 seed 不一致。属 PR 侧文档再生成遗漏,不是 master 继承红。
  3. 影响范围与严重程度:仅 CI 门禁(docs-sync 车道),阻塞合并;无任何生产行为/用户面影响。
  4. 怎么修复的:merge 最新 master(零冲突)+ 官方生成器重新生成 ja 文档(仅一行变化)+ 独立标注 commit 推送。
  5. 是否有回归问题:merge 零冲突且未触碰本 PR 的 src 改动区域;[PR] storage: pure-SQLite default — JSON envelopes stop being written unless dual-write is requested (#6479) #6480(纯 SQLite 默认)与本 PR 的驻留压力判定/回退诊断语义独立,6 个定向套件 28/28 复验通过;高危模式逐项过——无语义漂移、无 fail-fast 变吞错、无阈值/时序/输出格式变化。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:不涉及。
  8. 是否引入了新的配置:不涉及(ja 文档行只是既有 promptPack 键的再生成,键名与默认值未变)。

判定:红项已修、基线已同步到当前 master tip,新 head 29520b3985 的 CI 正在跑(30 checks,刚入队)。上一 head 除 docs-sync 外全绿,本轮只动了 ja 文档一行 + 干净 merge,预期全绿;CI 收尾后我会补确认。合并动作归 owner。

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant