Repository navigation
[PR] fix: honest session titles and status diagnostics for identity-less clients (#4776) - #4780
ranxianglei wants to merge 10 commits into
Conversation
…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)
368851d to
e3dee58
Compare
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复。 检索了 open+closed 的 issue 与 PR(关键词: 标签: 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 结果为准。结论稍后按八问体例回复。 |
(ai: vllm-qwen/qwen3.8-27b) 冲突核查结论:当前分支与 master 无冲突,无需 rebase,未做任何推送。 系统转发的是 20:41Z 的 dirty 告警,但核查时(晚于告警)实际状态已经干净:
八问:
收工判定:本单无需任何操作,等该 head 上的 CI 结果即可。 |
[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 包裹文本( ② 什么原因导致的:四个独立缺口——(a) deriveTitle 只跳过上下文片段和自动注入通知,用户文本里标签形状的开头被直接当标题,且 set-once 后永不变更;(b) web UI 的 title 优先于 label/firstBlockHint,坏标题一旦落库就永久遮蔽好回退;(c) /__bili/status 的 splitSessions 是 #2165 stolen-anchor 金丝雀(共享 id base + ③ 影响范围与严重程度:无 id 宿主(WorkBuddy/CodeBuddy)的用户:会话列表 N 倍膨胀、标题不可读、status 诊断误导。能用但体验明显受损 → p2。不影响压缩正确性、缓存与数据完整性。 ④ 怎么修复的(机制层面):
⑤ 是否有回归问题(diff 触碰路径的既有行为逐项审过):
⑥ 是否破坏缓存:不涉及——未触碰前缀缓存键、去重键、重试/增量游标;标题/诊断面不参与缓存。 ⑦ 是否改了设计方向:不涉及——在既有架构内加诚实表达面,身份解析机制(pfa mint/fork 规则)未动。#4776 剩余两项(匿名车道默认 fork adoption、live flag 语义)属语义/默认值变更,正确地留在本 PR 之外等 owner 拍板。 ⑧ 是否引入新配置:不涉及——无 env/config/CLI 新增。 测试有效性:title-derive 负例钉住规则边界( 小发现(非阻塞):UI 侧 markup 判定 本地证据:typecheck clean、build clean、8 个定向套件 96 pass / 0 fail。全量 CI 运行中(rebase 后全量重跑),结论以 CI 为准。 判定:可合(待 CI 绿)。方向正确、修在正确的层(源头派生 + 存量自愈 + 诚实诊断面),金丝雀语义未污染,未发现回归。 |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) CI 状态更新:原 head |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) 进度汇报(会话曾因长时间等 CI 被系统重启,现恢复): 已完成:① PR #4780 完整审核已发(八问体例,结论「可合」);② 发现原 head 当前状态: |
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.9366-pr.4780.6fcdac9This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr4780.tgz
npm install -g packageInstall 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.
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) CI 结果与修复(新 head
修复(一行,独立 commit):去掉接口上的 其余 41 个 check(含全量 test lane)在该 head 上已全部通过或按条件跳过,审核结论维持:可合,待新 head 的 CI 确认。 |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) CI 收口(最终 head 唯一红 =
本 PR 自身引入的 最终判定:可合。 剩余唯一红是 #4599 哨兵跟踪的舰队级共享问题(收敛到 ci-fixes),不构成本 PR 的合并阻塞。 |
(ai: vllm-qwen/qwen3.8-27b) 状态核对:无新问题 —— 本次告警指向的正是 #4599 floor 230(00:58Z)已收口的同一处红(head 八问结论:
判定:可合,待 owner 操作。 唯一剩余红随 master born-red 集群收敛后自然转绿;按 CI 协调政策不为 CI 红开新 issue,状态与后续跟踪见 #4599(floor 230 及 born-red 清单)。 |
(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。 八问:
|
…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.
(ai: vllm-qwen/qwen3.8-27b) Conflict resolved and pushed — new head 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 ( The 5 conflicts were all in import blocks — the PR added CI on the new head is pending (the mirror cache has not yet picked up 八问:
收工判定:冲突已全部解决并推送(新 head |
[bot] (ai: vllm-qwen/qwen3.8-27b) 查重: 不重复。 本 PR 是 #4776 bili 侧修复的唯一在途实现,无其他在途 PR 触碰标题派生或 status 诊断面。本轮是冲突车道 re-merge 后(head 标签: 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。不影响压缩正确性、缓存与数据完整性。 ④ 怎么修复的:
⑤ 是否有回归问题(diff 触碰路径的既有行为逐项审过):
⑥ 是否破坏缓存:不涉及——标题/诊断不参与前缀缓存键、去重键、增量游标。 ⑦ 是否改了设计方向:不涉及。#4776 剩余两项(匿名车道默认 fork adoption、live flag 语义)属默认值/语义变更,正确留在本 PR 之外等 owner 拍板。 ⑧ 是否引入新配置:不涉及——无 env/config/CLI 新增。 测试有效性:title-derive 负例钉住规则边界( 本地证据: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 判定 判定:可合。 方向正确、修在正确的层(源头派生 + 存量自愈 + 诚实诊断面),金丝雀语义未污染,未发现回归。本 PR 触碰身份相邻的 metadata 语义(lineage sticky)与热文件 src/server.ts,按 §7.4 不属 auto-merge 范围,待 owner 合并。 |
(ai: vllm-qwen/qwen3.8-27b) Re-synced with master and pushed — new head Master advanced again after my previous push ( 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 八问:
收工判定:分支已与当前 master( |
ranxianglei
left a comment
There was a problem hiding this comment.
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 合并。
[bot] (ai: vllm-qwen/qwen3.8-27b) PR #4780 复审结论(head 本轮触发时 head 已从
八问(与上轮一致,本轮独立复核后维持):
小问题处置:本轮无需要顺手修的非阻塞发现(上轮提到的 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 合并。 |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Review complete on new head What I did this round:
No small findings to fix on the spot; nothing routed to 需要决策. 八问(与上轮一致,本轮独立复核后维持):
判定:可合,待 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
liveflag expiry/rename — are default/semantics changes pending owner decision (posted in the issue thread); they are deliberately NOT in this PR.What changed
Titles.
deriveTitlenow 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/statusgains an additiveanonymousIdentity: {total, forkBorn, truncatedBorn}counted frommetadata.anonymousPrefixAffinitystamps.splitSessionsis 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.lineageis 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)
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 exposesanonymousIdentitywhilesplitSessionsstays[])