Skip to content

[PR] Badge slow sessions in the web panel + document the compression/host-history boundary (#5796) - #5799

Merged
ranxianglei merged 4 commits into
masterfrom
2026-11-06_dsh-long-session-badge-docs
Nov 6, 2026
Merged

ranxianglei merged 4 commits into
masterfrom
2026-11-06_dsh-long-session-badge-docs

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Refs #5796 — the no-decision slice (option E) of that thread's decision request; options A–D still await the owner's ruling.

What

Two small pieces, one commit each:

  1. feat: the web session list now flags long-running sessions. When a session reaches 5,000 model requests (SLOW_SESSION_REQUESTS_WARN, src/web/sessions-data.ts) its summary row carries an additive slowSession field and renders a 长会话/slow badge (the full list and the overview recent table share the title cell). The tooltip says why: the host-side history only grows — compression shrinks what is sent to the model, not the client's own file — so each step gets slower over time, and the actionable exit is starting a new session.
  2. docs: new FAQ pair in README.md + README.zh-CN.md ("Does compression shrink my client's own conversation file?" / "压缩会缩小客户端自己的对话文件吗?") stating the design boundary explicitly: what compression does and does not touch, why dsh disables host auto-compaction while bili is active (dsh.bundle.patch.yml 禁用自动压缩在 web profile 下静默失效 #1772/fix(dsh): profile 层 patch 其实可以关掉 web profile 的原生自动压缩(#1772 结论修正)+ 一个会静默清空整个 preset 的写法坑 #2474/See how to integrate the plugin that automatically disables dsh compression. | 自动关闭 dsh 压缩的插件看如何集成 #3354), the measured cost shape (~tens of seconds per turn at ~30K messages, [feat][dsh] Long sessions have no convergence path: compaction gated off on both sides, incremental lane full-resends on OpenAI wire | 长会话没有收敛通道:compaction 双向封锁 + 增量车道全量重发 #5796), and the practical convergence path.

Behavior change disclosure

  • New visible element: badge on sessions with requests ≥ 5000. Was: nothing visible — only a log warning at 1,000 messages (SLOW_SESSION_MSG_WARN, src/server.ts). The panel threshold is deliberately higher: the badge means "worth starting a new session", not "log-worthy".
  • Additive API field slowSession?: { requests } on /__bili/sessions rows; absent below threshold. No existing field renamed, removed, or re-semantics'd.
  • No config surface added (the threshold follows an internal constant, not a knob); no wire, kernel, or persistence changes.

Tests

  • tests/web-sessions.test.ts: gate asserted both directions plus the exact boundary — 6000 → flagged with its count, 5000 → flagged (>= semantics), 100 → undefined.
  • tests/web-i18n.test.ts guards (catalog parity, dead keys, no Han in en values) pass.
  • Local: targeted suites green (39/39 across the two files) + typecheck clean; full-suite verdict is CI's.

ci-check added 2 commits November 6, 2026 18:37
Sessions reaching SLOW_SESSION_REQUESTS_WARN (5000) model requests now carry an additive slowSession field on their summary row and render a 长会话/slow badge in the web list and overview table. Host-side history grows every turn while compression only shrinks the outbound wire, so past this point each step measurably slows down; the badge makes the 'start a new session' exit visible instead of buried in log warnings.
… not host history (#5796)

New FAQ pair (en/zh): what compression does and does not do to the client's own conversation file, why dsh disables host auto-compaction under bili (#1772/#2474/#3354), the measured cost shape, and the practical convergence path (new session) plus the new web badge.
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-11-06_dsh-long-session-badge-docs (35f7bc8)

Latest build — install this exact version

npm install -g billion-context@0.0.8356-pr.5799.d46165d

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
35f7bc8 billion-context@0.0.8356-pr.5799.d46165d build
8bdf8cc billion-context@0.0.8353-pr.5799.4b2da45 build
7a3b596 billion-context@0.0.8346-pr.5799.3ddd800 build

Download artifact

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

Install instructions are refreshed on each push.

@ranxianglei ranxianglei changed the title Badge slow sessions in the web panel + document the compression/host-history boundary (#5796) [PR] Badge slow sessions in the web panel + document the compression/host-history boundary (#5796) Nov 6, 2026
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

查重:不重复 —— 本线程已有且仅有一个修复 PR(GitHub #5799,分支 2026-11-06_dsh-long-session-badge-docs,head 7a3b596);无并行第二 PR,也未新立 issue。本条是对该 PR 的核对报告。

这是 #5796 决策请求的无决策切片(option E)——徽标 + 文档边界,不依赖 A–D 的裁决。按「识别自己的 PR」处理:没有重做,只拉分支逐行核代码 + 查 CI。

核对结果(6 个文件全读,+63/−0 纯增量,diff 与描述完全一致):

CI(镜像缓存暂无数据,单次直读 GitHub):已完成项全绿 —— 8×gate、version-guard、unused-exports、kernel-guard、lane-guard、config-surface-guard、docs-sync/coverage、lock-sync、mysql-contract、build-artifact 均 success,real-client e2e 车道按惯例 skipped;test 回归分片(ubuntu/windows × 22/24)仍在跑,目前零失败。mergeable_state=behind(需 rebase,非阻塞)。

八问:

  1. 是什么:给超长会话(web 面板)加一个「长会话/slow」徽标 + 文档讲清「压缩 ≠ 缩小客户端文件」的边界。特性 + 文档,不是缺陷。
  2. 原因:宿主侧历史只增不减(压缩只缩线上量),步耗时随长度爬升([feat][dsh] Long sessions have no convergence path: compaction gated off on both sides, incremental lane full-resends on OpenAI wire | 长会话没有收敛通道:compaction 双向封锁 + 增量车道全量重发 #5796 实测),用户需要可见信号知道「该开新会话了」。
  3. 影响面/严重度:纯展示层新增元素,≥5000 请求才出现;p3,无用户被破坏,只是多一个提醒。
  4. 怎么修:服务端 summary 行按内部常量阈值增量挂可选字段,前端有则渲染徽标;文档补一条 FAQ。
  5. 回归:无 —— 纯增量字段(低于阈值不存在),没改名/删/改语义任何既有字段;未触碰 wire/kernel/持久化/配置面。
  6. 缓存:不涉及。
  7. 设计方向:不涉及(展示层小改,无架构转向)。
  8. 新配置:不引入(阈值走内部常量,非旋钮)。

判定:代码与测试干净、行为变更已如实披露、CI 快门全绿、回归分片收尾中且零失败 —— 无需我再改动。待 test 分片转绿后即可合并:#5799

分类:[PR](特性+文档,非缺陷,不打 bug);范围 scope/ui(web 面板)+ 文档;严重度 p3。

ci-check added 2 commits November 6, 2026 19:57
The zh tooltip said 已运行 {n} 轮 but the badge gate fires on the session's
model-request count (one host turn spans multiple requests, incl. retries);
word it as 已处理 {n} 次模型请求 to match the en value and the field.

@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)

注:GitHub 禁止 PR 作者账号对自己的 PR 提交正式 APPROVE(本环境唯一 GitHub 身份即作者 ranxianglei),故此评论承载完整审核结论——结论:APPROVE(可合,请人工 merge)。

APPROVE —— 独立审完方向、回归、代码、测试、diff 五关,无阻塞项。

方向关(原 issue)

#5796 的核心是「dsh 长会话宿主面无收敛通道」,该线程的决策请求把修复切成 A–E:A–D(重开宿主 compaction 触发侧 / 增量车道扩 OpenAI wire / 逃生阀 / 迁移工具)等 owner 拍板。本 PR 只交付 E(面板可见性 + 文档边界)。我逐文件核对了 diff:零触碰 dsh-native / dsh-compaction-* / server guard 的三层封锁逻辑——无决策依赖的部分先修、需要决策的部分没碰,方向成立。

回归审查(逐项既有行为)

  • /__bili/sessions 行形状:纯增量可选字段 slowSession,阈值以下不存在 → 既有消费方(列表/详情/脚本)不受影响;
  • 标题格渲染:sessionTitleCell(src/web/client.ts:631)被完整列表(:721)与概览 recent 表(:710)共用,新增 span 插在 keepalive 徽标之后、row-id 之前,其余徽标逻辑未动——与 PR 声明一致;
  • i18n:两个新键中英齐备(parity)、均被 client.ts 引用(无死键)、en 值无汉字;
  • README en/zh 插入点结构完好、双语同步;
  • wire / kernel / 持久化 / 配置面:零改动;缓存、重试、增量游标不涉及。
  • 行为变更(有意,已披露):面板旧行为 = 无任何显示(仅 1000 消息处一条日志 warn,我核对了 src/server.ts:4629 SLOW_SESSION_MSG_WARN = 1000)→ 新行为 = ≥5000 请求出徽标。两个阈值语义不同(日志 = 值得记录,徽标 = 值得开新会话),常量注释解释了为何刻意更高。披露充分。

代码 & 测试

  • 门是命名常量 SLOW_SESSION_REQUESTS_WARN = 5000(>= 语义),doc 注释给出推导(~2 host msgs/request → 5k req ≈ 10k msgs),无魔法数字;
  • summaryOf 的条件展开写法与相邻字段(contextBest / autoModeForge)同风格;requests 取自 max(stats, ledger agg)(sessions-data.ts:813),来源正确;
  • 徽标走 t(key, { n: fmtW(...) }):t() 的 {name} 插值(client.ts:202)与 fmtW(client.ts:494)都在作用域内,escapeHtml 齐备;
  • 新测试走真 SessionStore.writeNow + buildSessionList(非 mock),钉住双方向 + 精确边界(6000→带计数 / 5000→>= 命中 / 100→undefined)——阈值改错、语义改成 >、字段形状漂移都会被它抓住,是真测试。

已顺手修

zh 文案「已运行 {n} 轮」把计量单位说错了——徽标按模型请求数触发(一个宿主回合包含多次请求,还含重试),en 值是 "requests";已改为「已处理 {n} 次模型请求」。commit 35f7bc8,已推 PR 分支;新 head 全量 CI 绿(9 个 workflow runs 全部 success,含主 CI 的 27 个 job)。注:镜像缓存当时仍残留 2 条 in_progress 陈旧条目,按规则单次直查 Actions API 核对,确认已全部完成。

八问

  1. 是什么问题:dsh 长会话每步越来越慢,但用户收不到任何面板提示,也不知道「开新会话」这个可用出口存在(#5796 的 E 切片:可见性 + 文档)。
  2. 什么原因导致的:压缩只缩「发给模型的量」、不缩宿主侧对话文件(用户数据不可改写)+ bili 活跃期 dsh 宿主自动 compaction 按设计禁用(#1772/#2474/#3354)→ 宿主面单调增长、步耗时线性上涨;既有信号只有 1000 消息一条日志 warn,面板不可见、文档未写。(根因「谁来收敛宿主面」= A–D 决策项,不在本 PR。)
  3. 影响范围与严重程度:所有 dsh 车道长会话用户的体验级问题(实测 ~3 万消息时单步数十秒);能用、有绕行,不影响正确性与缓存。本 PR 本身是纯增量展示层,风险 ≈ 0。
  4. 怎么修复的:≥5000 模型请求的会话在列表/概览共享标题格出「长会话/slow」徽标(悬浮说明原因并指向开新会话)+ README 中英文 FAQ 各一对,写明压缩做/不做什么、dsh 自动 compaction 为何被禁、实测代价形态、实际出口。
  5. 是否有回归问题:无(上面逐项清单)。唯一行为变化 = 面板新增徽标,有意且已披露旧值→新值。
  6. 是否破坏缓存:不涉及(未触碰上下文/压缩/缓存路径)。
  7. 是否改了设计方向:没有;三层封锁原样保留,A–D 仍待 owner 在 #5796 拍板(needs-decision 标签已在)。
  8. 是否引入新配置:没有;阈值是内部常量(5000 请求),不是新 knob;无 env/config/CLI 新增。

合并判定:可合(human merge)。A–D 逻辑未动,继续等 owner 裁决。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

PR #5799 review done: APPROVE(可合) —— 方向/回归/代码/测试/diff 五关独立审过无阻塞项;已顺手修:zh tooltip「已运行 {n} 轮」计量单位说错 → 「已处理 {n} 次模型请求」+ commit 35f7bc8d3(新 head CI 全绿,9/9 runs success);GitHub 禁止作者账号正式自批,结论以 COMMENT 承载(PR 内可见);A–D 仍待 owner 在 #5796 拍板(needs-decision 已在)。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

CI 修复进度汇报(自动修复车道 attempt 1/3):

问题:红掉的 test 是 tests/msgid-lane-flow.test.ts:139(期望 4 行实际 3 行)。本 PR 的改动只碰 web 面板徽章 + README,完全不涉及该测试的代码路径——排查确认是基线过期:PR 基于的 master(0aace2f20)当时正处于全量测试 14 条 lane 全红的风暴中,后来 master 上已修好并转绿。本地复现 4 次全过(6/6),也印证它不是本 PR 引入的确定性失败。

已做:

  1. 把当前绿色 master(be611a856)merge 进 PR 分支,零冲突,推送为 8bdf8cc71;typecheck 干净,定向测试全绿(msgid-lane-flow 6/6、web-sessions 29/29、issue5719-msgid-lane-identity 8/8)。
  2. 之后队友 ci-check 在同一分支追加了一行 zh tooltip 措辞修正(35f7bc8d3,独立标注),现 head = 35f7bc8d3。

当前状态:CI 在 35f7bc8d3 上 **30 项检查已完成 28 项:17 success + 11 skipped,0 failure;剩 test (ubuntu-latest, 22, 3) 和 test (windows-latest, 22, 3) 两条 node-22 分片还在跑(单条 test lane 最长约 1 小时)。我稍后确认这两条转绿后即发完整七问结论。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

CI 已转绿。35f7bc8d3 上全部 30 项检查完成:18 success + 12 skipped,0 failure,包括最初红掉的 test (ubuntu-latest, 24, 1)。本轮修复收工,结构化结论如下:

  1. 是什么问题:PR [PR] Badge slow sessions in the web panel + document the compression/host-history boundary (#5796) #5799(web 面板长会话徽章 + 文档)的 CI 中一条 test lane 失败——tests/msgid-lane-flow.test.ts:139 断言 4 行实际只有 3 行。该测试与 PR 改动(web 面板 + README)完全无关。
  2. 什么原因导致的:继承性失败。PR 基于的 master(0aace2f20)当时正处于全量测试 14 条 lane 全红的风暴期,之后 master 上陆续修好转绿;PR 分支停在了坏基线上。另该测试的 settle() 等待路径本身有已知的时序抖动窗口(本地连跑 4 次均 6/6 通过),不是本 PR 引入的确定性缺陷。
  3. 影响范围与严重程度:仅影响本 PR 的 CI 状态,无用户侧/运行时影响。
  4. 怎么修复的:把当前绿色 master(be611a856)merge 进 PR 分支,零冲突,推送为 8bdf8cc71;推送前本地 typecheck 干净、定向测试全绿(msgid-lane-flow 6/6×3、web-sessions 29/29、issue5719-msgid-lane-identity 8/8)。我未改任何功能代码。随后队友 ci-check 在同分支追加了一个独立标注的一行修正(zh tooltip 措辞:「已运行 N 轮」→「已处理 N 次模型请求」,与徽章判定字段对齐),现 head = 35f7bc8d3,CI 在其上全绿。
  5. 是否有回归问题:审过——merge 带入的全部是 master 已合入且自身 CI 绿的变更([PR] fix(session): keep a conversation on its main lane when full-compaction destroys the byte evidence — sessionid+host-msgid last-resort identity (#5719) #5759 msgid-lane identity、[PR] kernel: fold tool-call/result pairs by exact id at any distance (fixes the split-pair upstream-400 / folding-stuck family) #5758 kernel tool-pair-id、[PR] Index content's FK child columns — releaseContent DELETE stops full-scanning children #5540 等),PR 原有 diff 未被触碰;新 head 上 30/30 检查无失败即回归证据。
  6. 是否破坏缓存:不涉及(未触碰任何压缩/缓存代码)。
  7. 是否改了设计方向:不涉及。
  8. 是否引入了新的配置:不涉及。

备注:分支相对最新 master 显示 behind(master 在我们 merge 后又前进了),BEHIND 不构成合并阻塞,GitHub 合并时自动收敛即可,不再追移动目标空跑 CI。可人工合并:#5799

@ranxianglei
ranxianglei merged commit e1a87a9 into master Nov 6, 2026
47 checks passed
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

📦 Merged Build Published

This merge to master was published as 0.0.1051-master.e1a87a9 (rolling master tag).

npm install -g billion-context@0.0.1051-master.e1a87a9  # 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant