Skip to content

[PR] fix: honest session titles and status diagnostics for identity-less clients (#4776) - #4780

Open
ranxianglei wants to merge 10 commits into
masterfrom
2026-10-25_anonymous-identity-surface
Open

ranxianglei wants to merge 10 commits into
masterfrom
2026-10-25_anonymous-identity-surface

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Addresses the bili-side portion of #4776: titles, /__bili/status honesty, and the mint-log identity note. The issue's two remaining asks — default fork adoption for anonymous lanes and live flag expiry/rename — are default/semantics changes pending owner decision (posted in the issue thread); they are deliberately NOT in this PR.

What changed

Titles. deriveTitle now skips tag-shaped user-text openers (<system-reminder …>, <user_query>, any <tag…> opener — a structural rule, not a per-host keyword list). Stored markup titles re-derive on the session's next request in all four prepare lanes (same self-heal pattern as #2286). Web UI: a markup-shaped title is treated as absent so label/firstBlockHint show instead of being shadowed forever (list cell + detail head); the raw stored value stays visible in the detail KV row.

Diagnostics. /__bili/status gains an additive anonymousIdentity: {total, forkBorn, truncatedBorn} counted from metadata.anonymousPrefixAffinity stamps. splitSessions is deliberately unchanged: it is the #2165 stolen-anchor canary (shared id base + |sub: child) and structurally blind to pfa-* forks — every anonymous fork owns a unique id, so it reads [] while one conversation splits dozens of times. The new field reports what bili actually knows.

Logs. The prefix-affinity mint lines now state that the id is content-affinity-derived and unstable across forks.

Metadata. anonymousPrefixAffinity.lineage is sticky across continuation turns (latest-wins erased the birth attribution after the second request; the new status count depends on it surviving).

Behavior changes (old → new)

Surface Old New Why
deriveTitle skip set contextual fragments, auto-injected notifications + tag-shaped user-text openers host XML wrappers became locked-in set-once titles (#4776: 139/166)
title re-derive condition empty OR auto-injected notification + tag-shaped stored title pre-existing garbage titles self-heal on next request
web session-name precedence title || label || firstBlockHint markup-shaped title treated as absent → label/firstBlockHint stop shadowing good fallbacks forever
/__bili/status splitSessions only + anonymousIdentity {total,forkBorn,truncatedBorn} honest count of identity-less sessions; canary semantics untouched
mint log lines no identity note + "; no client-provided conversation id - content-affinity identity, unstable across forks" name the gap at the one observable moment
metadata.anonymousPrefixAffinity.lineage latest-wins (erased after turn 2) sticky from mint birth attribution must survive for the status count

No new config/env/CLI surface. No kernel change. No wire/message-shape change (titles + diagnostics only).

Tests

  • tests/title-derive.test.ts: No stable conversation identity: 34 real conversations become 166 sessions with 43 distinct titles, 139 of which are raw XML injection text #4776 rows — observed WorkBuddy wrapper shapes skipped; negatives pin the rule's edge (<3 warm up, mid-sentence <div> mentions, digit/second-bracket after <)
  • tests/issue4776-anonymous-identity.test.ts: unit rows for the counter + live wire test (anonymous request mints a pfa-* session; /__bili/status exposes anonymousIdentity while splitSessions stays [])
  • Local green: typecheck + targeted suites (title-derive, issue4776-anonymous-identity, side-lane-invariants, fork-adoption, fork-adoption-wires, web-sessions, web-i18n, web-routing). Full-suite verdict: CI.

@ranxianglei ranxianglei changed the title fix: honest session titles and status diagnostics for identity-less clients (#4776) [PR] fix: honest session titles and status diagnostics for identity-less clients (#4776) Oct 25, 2026
…ation ids (#4776)

Closed-source harnesses like WorkBuddy/CodeBuddy send none of the
conversation-id headers, so bili mints pfa-* sessions by content affinity —
and every fork/resume mints another one. Three surfaces then lied or
degraded: derived titles captured host XML wrappers verbatim (139 of 166
session titles were raw injection text), /__bili/status reported zero splits
while 144 anonymous splits existed, and the mint log never named the
identity gap.

- deriveTitle: skip tag-shaped user-text openers (structural rule, not a
  keyword list); stored markup titles re-derive on the session's next
  request in all four prepare lanes (#2286 self-heal pattern)
- web UI: a markup-shaped title falls through to label/firstBlockHint
  instead of shadowing them forever (list cell + detail head); the raw
  stored value stays visible in the detail KV row
- /__bili/status: additive anonymousIdentity {total,forkBorn,truncatedBorn}
  counted from session metadata; splitSessions keeps its #2165 shared-base
  canary meaning untouched
- prefix-affinity mint log lines now state the id is content-affinity
  derived and unstable across forks
- anonymousPrefixAffinity.lineage is sticky across continuation turns
  (latest-wins erased the birth attribution after the second request)
@ranxianglei
ranxianglei force-pushed the 2026-10-25_anonymous-identity-surface branch from 368851d to e3dee58 Compare October 25, 2026 21:01
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

查重: 不重复。 检索了 open+closed 的 issue 与 PR(关键词:4776、pfa prefix affinity、deriveTitle、WorkBuddy、anonymousIdentity/splitSessions)——唯一相关条目就是本 PR 对应的源 issue #4776;没有第二个在途 PR 触碰标题派生或 status 诊断面。本 PR 是 #4776 bili 侧修复的唯一在途实现。

标签: bug / workbuddy / scope/wiring / p2 —— 缺陷类(匿名车道会话列表 5× 膨胀 + 84% 标题噪音 + status 假阴性);客户端为 WorkBuddy/CodeBuddy 宿主;改动面在协议接线层(标题派生 + 状态诊断),UI 回退为辅;p2(不可用但有绕行,核心压缩不受影响)。

开始独立 review:拉取 PR diff 逐段读代码、核对行为变更披露、审回归面(splitSessions 金丝雀 / title set-once / status 增量性)、本地跑定向测试。floor 2 提到的上游冲突 GitHub 侧当前显示 mergeable=true / state=blocked(等 CI),以 CI 结果为准。结论稍后按八问体例回复。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

冲突核查结论:当前分支与 master 无冲突,无需 rebase,未做任何推送。

系统转发的是 20:41Z 的 dirty 告警,但核查时(晚于告警)实际状态已经干净:

八问:

  1. 是什么问题:上游 PR 冲突自动修复通道被唤醒,要求 rebase 解冲突。
  2. 什么原因导致的:告警基于旧快照——分支在告警发出后已被重新推到当前 master 之上,冲突不复存在。
  3. 影响范围与严重程度:无影响。PR 保持 open 且可合并,仅剩 CI 排队中。
  4. 怎么修复的:无需修复;按「API base sha ↔ master HEAD sha 比对 + 本地试合并」双重验证后确认干净,不动分支。
  5. 是否有回归问题:不涉及——零代码改动。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:不涉及。
  8. 是否引入了新的配置:不涉及。

收工判定:本单无需任何操作,等该 head 上的 CI 结果即可。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

PR #4780 review 结论:可合(待 CI 绿)。 独立审核完成:11 个文件 diff 逐段通读、逐机制独立验证、回归面逐项清点,本地 typecheck+build+定向测试全绿;全量 CI 套件在该 head 上运行中,最终判定以本审核 + CI 结果为准。

① 是什么问题:WorkBuddy 一类宿主发请求不带任何会话 id(#4776 线程已用客户端 bundle 检查确认),bili 只能给它派生一个基于内容亲和的会话 id(pfa-*)。结果:34 个真实会话裂成 166 个,其中 139 个的「标题」其实是宿主注入的 XML 包裹文本(<system-reminder …> 等),status 页又显示 splitSessions=[] 像没有分裂——三个假信号,同一根因:对无身份客户端,bili 没有诚实的表达面。

② 什么原因导致的:四个独立缺口——(a) deriveTitle 只跳过上下文片段和自动注入通知,用户文本里标签形状的开头被直接当标题,且 set-once 后永不变更;(b) web UI 的 title 优先于 label/firstBlockHint,坏标题一旦落库就永久遮蔽好回退;(c) /__bili/status 的 splitSessions 是 #2165 stolen-anchor 金丝雀(共享 id base + |sub: 子会话),对每个 fork 都拥有唯一 id 的 pfa-* 分裂结构性失明——不是 bug,但页面把这个失明的指标呈现为「无分裂」;(d) metadata.anonymousPrefixAffinity.lineage 是 latest-wins,turn 2 之后出生归属就被抹掉(新计数器依赖它存活)。

③ 影响范围与严重程度:无 id 宿主(WorkBuddy/CodeBuddy)的用户:会话列表 N 倍膨胀、标题不可读、status 诊断误导。能用但体验明显受损 → p2。不影响压缩正确性、缓存与数据完整性。

④ 怎么修复的(机制层面):

  • 标题层:deriveTitle 增加结构规则 isTagShapedText(trim 后以 <字母/_ 或 </字母/_ 开头)——形状规则而非按宿主列关键词,任何宿主的 XML 包裹都命中;已存储的 markup 形标题在四个 prepare lane 的下次请求时重新派生(会话标题被自动注入的系统通知占用,无法反映真实会话内容 #2286 同款自愈模式),正常标题 set-once 不变。代码注释写明了代价不对称:字面输入恰好以标签开头只是推迟一次请求定题,采纳则永久锁死垃圾。
  • UI 层:markup 形标题视为缺失 → 回落 label/firstBlockHint;原始值在详情页 KV 行仍可见,信息不丢。
  • 诊断层:/__bili/status 增量加 anonymousIdentity {total, forkBorn, truncatedBorn},从既有 pfa stamp 计数;splitSessions 金丝雀语义刻意不动。
  • Metadata 层:lineage 自 mint 起 sticky(出生归属不再被续轮抹掉);producer 逻辑不变。
  • 日志层:mint 日志补一句「content-affinity 派生、跨 fork 不稳定」,在唯一可观测时刻命名这个缺口。

⑤ 是否有回归问题(diff 触碰路径的既有行为逐项审过):

  • splitSessions/[bug] DSH 插件模式下 compress 被记到另一条会话:活跃会话的折叠永不生效(#2024 host-stamped caller vs wire witness) #2165 金丝雀:代码未动,side-lane-invariants 测试钉住 [] 行为 → 保持;
  • title set-once:正常标题(不以 < 开头)永不重派生,重派生只在空/自动注入通知/markup 形三种条件触发 → 有意变更,old→new 已在 PR 正文披露;
  • /__bili/status 消费方:纯增量字段;核过所有引用该端点的测试文件,全部按字段断言、无一深比整个对象 → 安全;
  • anonymousPrefixAffinity sticky:全仓 grep 仅 3 处读取(token 估算存在性检查、新计数器、stamp 写入本身),fork-adoption hook 在 mint 时读 fresh affinity、不受 sticky metadata 影响 → 无副作用;
  • 持久化:metadata 整体落盘(persist.ts v2 格式,无 key 过滤),lazyMetadata 访问时重实体化,计数能跨进程重启存活(范围限 pool 驻留会话,与 splitSessions 同范围,限制已在代码注释写明);
  • 高危模式排查:无语义漂移、无 fail-fast 变吞错、无阈值/时序/输出格式漂移(admin JSON 仅增量,wire/message 形状不变,无 kernel 改动,无配置面新增)。

⑥ 是否破坏缓存:不涉及——未触碰前缀缓存键、去重键、重试/增量游标;标题/诊断面不参与缓存。

⑦ 是否改了设计方向:不涉及——在既有架构内加诚实表达面,身份解析机制(pfa mint/fork 规则)未动。#4776 剩余两项(匿名车道默认 fork adoption、live flag 语义)属语义/默认值变更,正确地留在本 PR 之外等 owner 拍板。

⑧ 是否引入新配置:不涉及——无 env/config/CLI 新增。

测试有效性:title-derive 负例钉住规则边界(<3、<<、< 、句中提及均不命中;观察到的 6 种 WorkBuddy 包裹形状命中;字面粘贴推迟定题而非锁死垃圾);issue4776 测试含真 wire case(真 server + mock upstream,验匿名请求 mint pfa-*、status 暴露 anonymousIdentity 而 splitSessions 仍 [])。gate 双向(该触发/不该触发)都覆盖。

小发现(非阻塞):UI 侧 markup 判定 /^\s*</ 比服务端规则略宽——升级前存下的 <3 开头标题(UI 也会隐藏它改显 label)。仅展示差异,方向合理,不必改。

本地证据:typecheck clean、build clean、8 个定向套件 96 pass / 0 fail。全量 CI 运行中(rebase 后全量重跑),结论以 CI 为准。

判定:可合(待 CI 绿)。方向正确、修在正确的层(源头派生 + 存量自愈 + 诚实诊断面),金丝雀语义未污染,未发现回归。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

CI 状态更新:原 head e3dee5830 的 check suite 排队超一小时未开跑(舰队拥塞),且对照 #4599 发现该 head 缺 ci-fixes tip 1fa93735d(storage-render golden / plugin-fork / persist re-pin 等在册红簇的修复)——等它跑完会直接撞继承红。按 CI 协调政策已把 origin/ci-fixes merge 进 PR 分支(零冲突,13 个文件全在 ci-fixes 侧、与本 PR diff 无交集),本地 build + typecheck + 8 个定向套件全绿(96/96)后推送,新 head bbaeb14a0。审核结论不变(见我上条八问):可合,待新 head 的 CI 绿。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

进度汇报(会话曾因长时间等 CI 被系统重启,现恢复):

已完成:① PR #4780 完整审核已发(八问体例,结论「可合」);② 发现原 head e3dee5830 缺 ci-fixes tip 1fa93735d(在册红簇修复)且 check suite 排队超 1h 未启动,已按 #4599 协调政策 merge origin/ci-fixes 进分支(零冲突,13 文件全在 ci-fixes 侧、与本 PR diff 无交集),本地 build + typecheck + 8 个定向套件 96/96 绿后推送,新 head bbaeb14a0(远端已验证)。

当前状态:bbaeb14a0 的 25 个 check 全部还在 queued——非失败,是舰队 runner 拥塞(#4599 当前多 PR 同状态)。审核结论不变:可合,待 CI 绿。我改用短间隔轮询继续盯,出结果后在本帖补最终一行。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

CI 状态补充:bbaeb14a0 的 check suite 推送后约 40 分钟仍全部 queued(25/25,无失败)——与 #4599 记录的当前舰队 runner 拥塞一致(多个 PR head 同状态),非本 PR 问题。审核与本地门禁结论不变:可合,待 CI 绿。出结果后我会在本帖补最终一行;在此之前无需任何操作。

@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-25_anonymous-identity-surface (1f93293)

Latest build — install this exact version

npm install -g billion-context@0.0.9366-pr.4780.6fcdac9

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
1f93293 billion-context@0.0.9366-pr.4780.6fcdac9 build
d91ae12 billion-context@0.0.9333-pr.4780.9078218 build
696bd03 billion-context@0.0.6285-pr.4780.f2c0212 build
7bae42f billion-context@0.0.6142-pr.4780.36b0db5 build
2a4c291 billion-context@0.0.6057-pr.4780.afd8764 build
c9668f2 billion-context@0.0.5941-pr.4780.b442243 build
8c9b4ab billion-context@0.0.5920-pr.4780.b30b539 build
bbaeb14 billion-context@0.0.5916-pr.4780.a3e0a89 build

Download artifact

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

Install instructions are refreshed on each push.

CI unused-exports job flags the interface as INTERNAL_ONLY: it is only
referenced within src/session.ts (return type of anonymousIdentitySummary).
Drop the leading export; the function stays exported for admin.ts.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

CI 结果与修复(新 head 8c9b4ab42,远端已验证):

bbaeb14a0 首跑结果:全部 42 个 check 完成——24 success / 18 skipped / 1 failure。失败的是 unused-exports 门禁,与本 PR diff 直接相关(非继承红):PR 把 AnonymousIdentitySummary 接口从 src/session.ts 导出,但该类型只被同文件的 anonymousIdentitySummary() 返回型引用(admin.ts 只 import 函数),门禁判为 INTERNAL_ONLY。

修复(一行,独立 commit):去掉接口上的 export,函数保持导出。本地验证:node scripts/check-unused-exports.mjs clean、typecheck clean、8 个定向套件 96/96 绿。无行为变更(纯导出可见性)。

其余 41 个 check(含全量 test lane)在该 head 上已全部通过或按条件跳过,审核结论维持:可合,待新 head 的 CI 确认。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

CI 收口(最终 head 8c9b4ab42):55 个 check = 38 success / 16 skipped / 1 failure。

唯一红 = test (windows-latest, 22, 3)(not ok 773 - runLaunch opencode-inline:Windows 下 spawn .cmd 被报成 cmd.exe)。判定为继承性 master 级红,与本 PR diff 无关,证据三条:

  1. 本 PR 对 master 的 24 文件 diff 不含任何 launcher/opencode 相关文件(git diff --name-only 验证);
  2. master 自身(bb7c249)在同一分片 test (windows-latest, 22, 3) 上两次跑红(00:18Z、00:47Z,后者与本 PR 的 run 并发),另有 9 个 test 分片红——与 CI Control Center: Centralized CI Failure Handling & Status Sync (Comment all CI issues here; do not open new issues) | CI 总控: CI 失败集中处理与状态同步(所有 CI 问题在此评论, 勿开新 issue) #4599 记录的已知 born-red 集群一致;
  3. 失败形态(Windows .cmd 路径解析)与本 PR 的标题/诊断/metadata 改动无任何代码路径关联。

本 PR 自身引入的 unused-exports 红已在上轮修复(去掉接口前导 export,见上帖)。其余全部 lane(ubuntu 全量 test 分片、typecheck、build、e2e 各道)绿。

最终判定:可合。 剩余唯一红是 #4599 哨兵跟踪的舰队级共享问题(收敛到 ci-fixes),不构成本 PR 的合并阻塞。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

状态核对:无新问题 —— 本次告警指向的正是 #4599 floor 230(00:58Z)已收口的同一处红(head 8c9b4ab42,test (windows-latest, 22, 3);该 run ~00:51Z 已结束,属延迟重复触发)。本轮独立复核全部证据链,结论不变:继承性 born-red,本 PR 分支无需任何新改动。

八问结论:

  1. 是什么问题:本 PR 唯一红 = Windows 测试分片 test (windows-latest, 22, 3)(job)。分片内 1601 个测试仅挂 1 个:tests/launcher-opencode-inline.test.ts:38(runLaunch opencode-inline,no proxy spawned / BILI_OPENCODE_INLINE=1),断言失败——启动入口应解析到 fake fake-opencode.cmd shim,实际解析到了 cmd.exe;runner 按设计不做自动重试。
  2. 什么原因导致的:该测试文件及其对应的 inline 启动逻辑是 master 今天刚合入的特性(bb7c24972 = Merge [PR] pi/opencode inline changed to manual opt-in: revert the default flip; default behavior is identical to the previous vers | pi/opencode inline 改为手动开启:收回默认翻转,默认行为与旧版完全一致 #4687 2026-10-25_opencode-inline,文件由 2a7d6a97f 引入)在 Windows 上的 born-red——master 自己同分片反复跑红(00:24Z、00:53Z 两次,且 00:07–01:02Z 间各 Windows 分片共 12 红),属 CI Control Center: Centralized CI Failure Handling & Status Sync (Comment all CI issues here; do not open new issues) | CI 总控: CI 失败集中处理与状态同步(所有 CI 问题在此评论, 勿开新 issue) #4599 在册 born-red 集群(opencode-inline runLaunch 一项)。因果分层:表面现象 = 本 PR CI 红;真实来源 = master 新特性在 Windows runner 上的启动解析缺陷,与本 PR 无关。
  3. 影响范围与严重程度:仅限 CI 门禁(Windows 22 s3 分片),无用户面影响。本 PR 的 24 文件 diff(src/persist、src/server*、prepare-、src/session、src/web/ 及对应测试)完全不触碰 launcher 代码与该测试文件,不可能引入此失败。
  4. 怎么修复的:本分支无需修——修复归属 born-red 集群车道(哨兵/ci-fixes 收敛)。已验证 head 8c9b4ab42 已包含 ci-fixes 全部最新提交(tip 1fa93735d,merge-base 确认),且 ci-fixes 此后无新提交,无可再 merge 的内容。
  5. 是否有回归问题:无。逐项过:①唯一红为继承(master 同分片同签名跑红,见第 2 问);②本 PR 此前自引入的 unused-exports 红已在分支内修复并转绿(8c9b4ab42);③其余 54 项 check 全绿/skip。无阈值/时序/输出格式/语义漂移。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:不涉及。
  8. 是否引入了新的配置:不涉及。

判定:可合,待 owner 操作。 唯一剩余红随 master born-red 集群收敛后自然转绿;按 CI 协调政策不为 CI 红开新 issue,状态与后续跟踪见 #4599(floor 230 及 born-red 清单)。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

冲突已处理:master 已合入 PR 分支并推送(7bae42f → 696bd03),零手工冲突解决。

这次与上一轮不同——master 在告警前确实前进了(#4815 compress-breaker-enforcement、#4832 zstd-fork-gate 于 22:05 +0800 合入),而分支尖端停在 16:02 +0800,分支落后于基底,镜像检测据此报 dirty。

八问:

  1. 是什么问题:PR 分支落后于当前 master,合并态被检测器标记为 dirty,需要把 master 带进分支。
  2. 什么原因导致的:master 在分支最后一次推送之后又前进两个合并;两侧改动文件不相交(PR 动 title/status/diagnostics 面,master 新增动 kernel breaker/zstd gate + lockfile 同步),本地 git merge 实测 "Automatic merge went well",无文本冲突。
  3. 影响范围与严重程度:无功能影响;风险仅在「旧基底在合并时产生假冲突 / CI 结果过期」,现已消除。
  4. 怎么修复的:merge master 进 PR 分支(不用 rebase——分支已含 CI Control Center: Centralized CI Failure Handling & Status Sync (Comment all CI issues here; do not open new issues) | CI 总控: CI 失败集中处理与状态同步(所有 CI 问题在此评论, 勿开新 issue) #4599 sweep 的合并提交,rebase 会重写他人历史),自动合并干净后直接 push。零代码编辑、零冲突裁决,因此无需决策申请 issue。
  5. 是否有回归问题:无我方引入的回归——合入内容全部是 master 自身的提交(kernel 0.0.165→0.0.166 来自 [PR] fix: armed compress circuit breaker now enforces itself on parse-failure receipts (#4812) #4815/[PR] fix(agent/dsh): decode content-encoded request bodies in fork-adoption and recall body gates #4832、lockfile 同步、新测试文件);根 package.json 版本未动;PR 原有改动逐字节不变。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:不涉及。
  8. 是否引入了新的配置:不涉及。

收工判定:分支已与 master(05c379e)完全对齐,等新 head 696bd03 上的 CI 结果即可。

ci-check added 2 commits November 12, 2026 22:07
…conflict lane)

Resolve 5 import-block conflicts (union of intent):
- prepare-anthropic/google/openai/responses: keep PR's isTagShapedText
  in the ../server.js import AND master's new imports (recordNudgeObservation,
  yieldToEventLoop, dedupeAdjacentOutputConfig, responses-ordering).
- admin.ts: keep PR's anonymousIdentitySummary import + anonymousIdentity
  status field AND master's resolverWedge field; reuse statusSessions for
  summarizeConflicts (PR's refactor).

typecheck clean, build clean, PR targeted suites 33/33 green.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

Conflict resolved and pushed — new head d91ae1280d (fast-forward, no force-push).

The PR branch was 2747 commits behind master. I merged master into the branch (merge, not rebase — the branch already carries prior merge commits, so rebase would rewrite history) and resolved 5 import-block conflicts by union of intent. I then merged the latest master tip (873715d40a, which advanced while I was working) to leave the branch fully aligned. Local gates: typecheck clean, build clean, PR targeted suites (title-derive + issue4776-anonymous-identity) 33/33 green.

The 5 conflicts were all in import blocks — the PR added isTagShapedText/anonymousIdentitySummary while master added its own new imports/fields to the same lines. Each was resolved by keeping BOTH sides' symbols (all verified used in the merged body). admin.ts also kept master's new resolverWedge status field alongside the PR's anonymousIdentity field. No logic or behavior was touched — import union only.

CI on the new head is pending (the mirror cache has not yet picked up d91ae1280d's check runs; I won't assert green/red until it is verifiable live).

八问:

  1. 是什么问题:PR [PR] fix: honest session titles and status diagnostics for identity-less clients (#4776) #4780 分支落后 master 2747+ 提交,合并态被检测为 dirty(冲突),需把 master 带进分支并解冲突。
  2. 什么原因导致的:master 在分支最后一次推送(10-26)后大幅前进;PR 改动的 9 个源文件在 master 侧也全部被改过,其中 5 个文件的 import 块两侧各自新增了符号,产生文本冲突。
  3. 影响范围与严重程度:仅合并态/CI 门禁,无用户面影响;5 处冲突全是 import 块(机械性),不涉及任何逻辑或行为变更。
  4. 怎么修复的:用 merge(非 rebase)把 master 合进 PR 分支;5 处冲突按「意图并集」解——同时保留 PR 侧的 isTagShapedText/anonymousIdentitySummary/anonymousIdentity 与 master 侧新增的 import(recordNudgeObservation/yieldToEventLoop/dedupeAdjacentOutputConfig/responses-ordering)及 resolverWedge 字段;随后再 merge 最新 master tip(873715d40a,其改动不触碰 PR 文件,零新冲突)使分支完全对齐。
  5. 是否有回归问题:无我方引入回归。逐文件核对:PR 与 master 两侧符号均保留且都在合并后 body 中被引用;admin.ts 的 summarizeConflicts 沿用 PR 的 statusSessions 复用(语义等价于 master 的 listSessions(),无行为变化);prepare-responses.ts 的 repairResponsesAssistantOrdering 按 master 的重构改从 responses-ordering.js 导入(不再从 server.js)。本地 typecheck clean + build clean + PR 定向套件 33/33 绿佐证。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:不涉及。
  8. 是否引入了新的配置:不涉及。

收工判定:冲突已全部解决并推送(新 head d91ae1280d,fast-forward),分支已与当前 master 完全对齐;待该 head 的 CI 结果,无需进一步人工决策。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

查重: 不重复。 本 PR 是 #4776 bili 侧修复的唯一在途实现,无其他在途 PR 触碰标题派生或 status 诊断面。本轮是冲突车道 re-merge 后(head d91ae1280d)的独立复审:11 文件 diff 逐段通读、各机制消费者独立验证、本地 typecheck + build + 8 个定向套件、CI 56 check 全绿。

标签: bug / workbuddy / scope/wiring / p2(前轮已打,本轮无变化)。

① 是什么问题:WorkBuddy 一类宿主请求不带任何会话 id,bili 只能给它派生内容亲和的 pfa-* id。后果:一个会话裂成十几个,84% 的「标题」是宿主注入的 XML 包裹文本,status 页 splitSessions=[] 像没有分裂。本 PR 加诚实表达面:标题源头跳过 tag 形开头、存量坏标题自愈、status 增补 anonymousIdentity 计数。

② 什么原因导致的:四个独立缺口——(a) deriveTitle 只跳过两类已知片段,tag 形开头直接落题且被 set-once 锁死;(b) UI 的 title 优先级永久遮蔽 label/firstBlockHint;(c) splitSessions 是共享 id base 金丝雀(#2165),对每个 fork 都拥有唯一 id 的 pfa-* 分裂结构性失明;(d) lineage 是 latest-wins,turn 2 后出生归属被抹。

③ 影响范围与严重程度:无 id 宿主(WorkBuddy/CodeBuddy)用户:会话列表 N 倍膨胀、标题不可读、诊断误导。能用但体验明显受损 → p2。不影响压缩正确性、缓存与数据完整性。

④ 怎么修复的:

  • 标题层:结构规则 isTagShapedText(trim 后以 <字母/_ 或 </字母/_ 开头)——形状规则而非按宿主列关键词;四个 prepare lane 对已存储的 markup 形标题在下次请求重新派生(会话标题被自动注入的系统通知占用,无法反映真实会话内容 #2286 同款自愈);
  • UI 层:markup 形标题视为缺失 → 回落 label/firstBlockHint;原始值在详情 KV 行仍可见(已核实 client.ts:2998 渲染原始 d.title);
  • 诊断层:/__bili/status 增量加 anonymousIdentity {total,forkBorn,truncatedBorn};splitSessions 金丝雀语义不动;
  • Metadata 层:lineage 自 mint 起 sticky(出生归属不再被续轮抹掉)。

⑤ 是否有回归问题(diff 触碰路径的既有行为逐项审过):

  • title set-once:正常标题(不以 < 开头)永不重派生——重派生条件三谓词(空/自动注入/markup 形)之一;deriveTitle 返回 undefined(全部消息 tag 形)时 if (t) 守卫保留旧标题,不覆盖 → 保持;
  • splitSessions/[bug] DSH 插件模式下 compress 被记到另一条会话:活跃会话的折叠永不生效(#2024 host-stamped caller vs wire witness) #2165 金丝雀:代码未动,side-lane-invariants 钉住 [] → 保持(本地过 + CI 绿);
  • /__bili/status:既有字段逐项未变(diff 仅插入 anonymousIdentity 一个字段);listSessions() 由两次调用改为一次复用——它是只读快照(session.ts:1578),语义等价且更一致;全部测试消费方按字段断言,无整对象深比 → 安全;
  • anonymousPrefixAffinity 消费者:全仓 grep 仅 3 处读取(server.ts:2975 存在性检查、session.ts:1640 新计数器、handle.ts:1779 写入本身);fork-adoption hook(handle.ts:1819)读的是当前请求的 anonAffinity 而非 metadata——sticky 变更不影响它 → 无副作用;
  • 持久化:metadata 形状未变(lineage 本就是可能的 key,只是现在保留),无格式/版本变更;
  • 高危模式:无语义漂移(所有变更在 PR 正文 old→new 表披露)、无 fail-fast 变吞错、无阈值/时序/输出格式漂移(admin JSON 纯增量)、无 wire/message 形状变化、无 kernel 改动、无配置面新增。

⑥ 是否破坏缓存:不涉及——标题/诊断不参与前缀缓存键、去重键、增量游标。

⑦ 是否改了设计方向:不涉及。#4776 剩余两项(匿名车道默认 fork adoption、live flag 语义)属默认值/语义变更,正确留在本 PR 之外等 owner 拍板。

⑧ 是否引入新配置:不涉及——无 env/config/CLI 新增。

测试有效性:title-derive 负例钉住规则边界(<3、<<、< 、1 < 2、句中 <div> 均不命中;观察到的 6 种 WorkBuddy 包裹形状全部命中;60 字符截断标题命中);issue4776 测试含真 wire case(真 server + mock upstream,端口 listen(0),匿名请求 mint pfa-*、status 暴露 anonymousIdentity 而 splitSessions 仍 [])。gate 双向(该触发/不该触发)都覆盖。

本地证据:typecheck clean、build clean、8 个定向套件 100/102。2 个失败(fork-adoption-wires responses wire 两例)在本环境 master(origin/master 259cd87)上同样复现——环境特定,非本 PR 引入;对应 CI test lane 在该 head 上绿。

CI(head d91ae12):56 check = 40 success / 16 skipped / 0 failure。

小发现(非阻塞):UI 侧 markup 判定 /^\s*</ 比服务端规则略宽——升级前存下的 <3 开头标题 UI 也会隐藏改显 label。仅展示层差异,方向合理,不必改。

判定:可合。 方向正确、修在正确的层(源头派生 + 存量自愈 + 诚实诊断面),金丝雀语义未污染,未发现回归。本 PR 触碰身份相邻的 metadata 语义(lineage sticky)与热文件 src/server.ts,按 §7.4 不属 auto-merge 范围,待 owner 合并。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

Re-synced with master and pushed — new head 1f9329355c (fast-forward, no force-push).

Master advanced again after my previous push (873715d40a → 259cd87674). I verified live in this run: the new master commits (kernel 0.0.196, storage/stream/advisory/dsh-ledger fixes, docs) touch none of the PR's 9 source files, so the merge was a clean auto-merge with zero conflicts. I merged the latest master tip into the branch, re-ran the local gates (typecheck clean), and pushed as a fast-forward. The branch is now fully aligned with the current master tip.

Note: this is the same "master moved ahead of the branch" situation as the prior lanes — not a real code conflict, just the branch falling behind a fast-moving master. Since the new commits don't touch the PR's files, there is no conflict risk from them; the branch will stay mergeable as long as future master commits also avoid the PR's files.

CI on the new head is pending (I won't assert green/red until the mirror cache reflects 1f9329355c's runs).

八问:

  1. 是什么问题:PR 分支再次落后 master(上一轮推送后 master 又前进了),合并态被检测为 dirty,需再次把 master 带进分支。
  2. 什么原因导致的:master 高速前进;本轮新增提交(873715d..259cd87)不触碰 PR 的 9 个源文件,但分支仍落后于基底,检测器据此报 dirty。
  3. 影响范围与严重程度:仅合并态/CI 门禁,无用户面影响;本轮 master 新增提交与 PR 改动文件零交集,无文本冲突(纯自动合并)。
  4. 怎么修复的:merge(非 rebase)最新 master tip(259cd87674)进 PR 分支,零冲突自动合并;本地 typecheck clean;fast-forward 推送(无 force-push),新 head 1f9329355c。
  5. 是否有回归问题:无我方引入回归——本轮零手工冲突裁决,合入内容全部是 master 自身提交;PR 原有改动逐字节不变;typecheck clean 佐证合并树类型一致。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:不涉及。
  8. 是否引入了新的配置:不涉及。

收工判定:分支已与当前 master(259cd87674)完全对齐并推送(新 head 1f9329355c,fast-forward);待该 head 的 CI 结果,无需进一步人工决策。

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

Review verdict: APPROVE (可合) — 注:GitHub 不允许作者账号自审自批,故以评论形式给出正式审核结论(合并权在 owner)。

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

APPROVE — 独立复审完成(head 1f9329355,较上轮 d91ae1280d 仅多一个 master merge,PR 自身 11 文件逐字节未变)。

  • 11 文件 diff 逐段通读;各机制消费者独立验证(anonymousPrefixAffinity 全仓仅 3 处读取,fork-adoption hook 读当前请求 affinity 而非 metadata,sticky lineage 无副作用;listSessions 只读快照单次复用等价;status 消费方全部按字段断言)。
  • 回归面逐项清点:title set-once 对正常标题保持、splitSessions 金丝雀未动(side-lane-invariants 钉住)、admin JSON 纯增量、metadata 形状未变、无 wire/message 形状变化、无 kernel 改动、无配置面新增;所有行为变更在 PR 正文 old→new 表披露。
  • 测试双向钉住(gate 该触发/不该触发),含真 wire case(listen(0) 端口)。
  • 本地:typecheck clean、build clean、8 个定向套件 100/102——2 个失败(fork-adoption-wires responses wire)在本环境 master 上同样复现,属环境特定,非本 PR 引入。
  • CI(1f93293):56 check = 40 success / 16 skipped / 0 failure。

判定:可合。触碰身份相邻 metadata 语义与热文件 src/server.ts,按 §7.4 不属 auto-merge,待 owner 合并。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

PR #4780 复审结论(head 1f9329355):可合,正式审核结论已发到 GitHub PR(review comment)。

本轮触发时 head 已从 d91ae1280d 前移到 1f9329355——核查确认新 head 只是把 master(259cd87)merge 进分支,PR 自身的 11 个文件与上轮审核的 head 逐字节一致(diff 为空),因此上轮的全量审核结论继续成立;本轮在新 head 上重新跑了本地门禁 + CI 核对:

  • 本地:typecheck clean、build clean、8 个定向套件 100/102——2 个失败(fork-adoption-wires responses wire 两例)在本环境 master(259cd87)上同样复现,属环境特定,非本 PR 引入;
  • CI(1f93293):56 check = 40 success / 16 skipped / 0 failure,全绿。

八问(与上轮一致,本轮独立复核后维持):

  1. 是什么问题:无会话 id 的宿主(WorkBuddy 一类)派生出 pfa-* 内容亲和 id,一个会话裂成十几个,84% 标题是宿主 XML 包裹文本,status 页 splitSessions=[] 造成「无分裂」假象。
  2. 什么原因导致的:deriveTitle 无 tag 形开头跳过规则 + 标题 set-once 锁死 + UI title 优先级永久遮蔽回退 + splitSessions 金丝雀对唯一 id 的 pfa-* 分裂结构性失明 + lineage latest-wins 抹掉出生归属。
  3. 影响范围与严重程度:无 id 宿主用户:列表膨胀、标题不可读、诊断误导;p2,不影响压缩正确性/缓存/数据完整性。
  4. 怎么修复的:结构规则 isTagShapedText 源头跳过 + 四个 prepare lane 存量 markup 标题自愈 + UI markup 标题视为缺失回落 label/firstBlockHint(原始值详情 KV 行仍可见)+ status 增量 anonymousIdentity 计数 + lineage sticky。
  5. 是否有回归问题:无——title set-once 对正常标题保持、splitSessions 金丝雀未动、admin JSON 纯增量、metadata 形状未变、无 wire/message 形状变化、无 kernel 改动;所有行为变更在 PR 正文 old→new 表披露。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:不涉及;No stable conversation identity: 34 real conversations become 166 sessions with 43 distinct titles, 139 of which are raw XML injection text #4776 剩余两项语义变更正确留在 PR 外等 owner 拍板。
  8. 是否引入新配置:不涉及。

小问题处置:本轮无需要顺手修的非阻塞发现(上轮提到的 UI 侧 markup 判定略宽属展示层边缘,低于修复门槛,不再挂账)。

说明:GitHub 不允许作者账号对自己的 PR 提交 APPROVE 状态(422: "Can not approve your own pull request"),正式审核结论已以 review comment 形式发到 PR 上(https://github.com/ranxianglei/billion-context/pull/4780#pullrequestreview-5888127881)。本 PR 触碰身份相邻 metadata 语义(lineage sticky)与热文件 src/server.ts,按 §7.4 不属 auto-merge 范围。

判定:可合,待 owner 合并。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

Review complete on new head 1f9329355 — verdict: 可合 (mergeable), awaiting human merge.

What I did this round:

No small findings to fix on the spot; nothing routed to 需要决策.

八问(与上轮一致,本轮独立复核后维持):

  1. 是什么问题:无会话 id 的宿主派生 pfa-* 内容亲和 id,一个会话裂成十几个,84% 标题是宿主 XML 包裹文本,status 页 splitSessions=[] 造成「无分裂」假象。
  2. 什么原因导致的:deriveTitle 无 tag 形开头跳过规则 + 标题 set-once 锁死 + UI title 优先级永久遮蔽回退 + splitSessions 金丝雀对唯一 id 的 pfa-* 分裂结构性失明 + lineage latest-wins 抹掉出生归属。
  3. 影响范围与严重程度:无 id 宿主用户:列表膨胀、标题不可读、诊断误导;p2,不影响压缩正确性/缓存/数据完整性。
  4. 怎么修复的:结构规则 isTagShapedText 源头跳过 + 四个 prepare lane 存量 markup 标题自愈 + UI markup 标题视为缺失回落 label/firstBlockHint(原始值详情 KV 行仍可见)+ status 增量 anonymousIdentity 计数 + lineage sticky。
  5. 是否有回归问题:无——title set-once 对正常标题保持、splitSessions 金丝雀未动、admin JSON 纯增量、metadata 形状未变、无 wire/message 形状变化、无 kernel 改动;所有行为变更在 PR 正文 old→new 表披露。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:不涉及;No stable conversation identity: 34 real conversations become 166 sessions with 43 distinct titles, 139 of which are raw XML injection text #4776 剩余两项语义变更正确留在 PR 外等 owner 拍板。
  8. 是否引入新配置:不涉及。

判定:可合,待 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