Repository navigation
[PR] fix: Context tab — plugin/status follows the live |sub: fork when the bare row went stale (#4686) - #4703
ranxianglei wants to merge 7 commits into
Conversation
…ent stale (#4686) The dsh Context tab polls GET /__bili/plugin/status with the RAW conversation id; after a persona-anchor drift forks the conversation onto base|sub:<fp>, an exact hit on the frozen bare row beat fallback=latest forever, pinning the embedded frame on the dead row while the live lane kept folding. Management tool calls already followed the fork (#2601 routing); the read path never got it. Follow the live fork under the exact criteria livePersonaDescendant already enforces for tool calls (birth order #3442/#3647, ref-holding #2948, freshness <= 10 min, recency pick #3397). Additive personaFork:true response field marks the follow; absent otherwise. Regression suite tests/issue4686-status-follows-live-fork.test.ts pins both directions of the gate (#3617).
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.6154-pr.4703.63815aaThis exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr4703.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复——检索了 open/closed 全部 PR:唯一触碰 标签: bug / dsh / scope/wiring / p2(协议接线边界的读侧缺陷,dsh 车道受益方;已同步补到 #4686——此前镜像写入没持久化,这次直接落 GitHub)。 审核结论(独立重审,非复读 issue)① 方向关 — 通过。 自己核过 v0.1.207 代码路径与 master 现状:写侧(工具调用)自 #2601 起就按 ② 回归审查 — 逐项清点 diff 触碰路径的既有行为:
高危模式逐项过:无 fail-fast 变吞错、无阈值/时序漂移(常量全复用)、输出格式纯加性。未发现无意回归。 ③ 代码审查 — 通过。 判据函数原样复用而非复制一份新逻辑(单一事实源,后续 #2944 v2 resolver 切流时读侧自动跟上);放置位置正确(fallback 之前、no-session 分支之前); ④ 测试有效性 — 真测试。 本地验证 RED/GREEN 牙齿:把 src/plugin.ts 换回 master 版本后恰好 2 个正例失败、4 个负例仍绿,换回修复后 6/6 绿——断言有牙,bug 回归时抓得住。负例覆盖每个判据维度(#3617 双向 gate 纪律);多 fork 取最新也钉住。定向套件本地全绿:issue4686 + plugin-protocol + plugin-fork + plugin-status-provenance + side-lane-invariants + dsh-persona-fingerprint = 103 用例,再加 issue404/2029/3862/side-lane-truth-table/issue3397 = 27 用例,typecheck 干净。行为变更类功能有 e2e 兜底:CI 的 e2e-dsh-plugin-lane(真实 dsh 客户端过代理)在本 head 上绿。 ⑤/⑤b diff 整洁度与代码质量 — 通过。 2 文件 +149 行,每一行都服务于本 PR 目的;命名达意(followedLiveFork/live)、注释讲为什么且带 issue 锚点(仓库既有风格)、无死代码、无魔法数字、无新依赖。 CI 状态(关键判断:红不是本 PR 的)
判定:可合。 本 PR 无任何自身引入的回归,核心 lane 全绿,红 shard 为继承性 born-red(已在 #4599 留痕)。合并权在你:若想合入时看板全绿,需先等存储家族在 ci-fixes/#4599 收敛——但那不该阻塞这个修复本身(其正确性已由 RED/GREEN + 130 定向用例 + e2e-dsh-plugin-lane 三重钉住)。 |
master window commits 293ae65/de5e03659 bumped kernel/package.json to 0.0.165 without regenerating the lockfiles; lock-sync re-resolution then rewrites the stale recorded versions (root 0.0.163, kernel 0.0.164) and fails. Pure recorded-version sync via npm install --package-lock-only; no dependency or semantic change.
Closes #4686
What changed
GET /__bili/plugin/statusnow serves the requested conversation's live|sub:fork when the bare parent id has gone stale — under exactly the criteria the #2601 tool-call routing already uses (livePersonaDescendant): fork born after the parent's last traffic (birth order, #3442/#3647), ref-holding (#2948 aux-lane breaker), fresh ≤ 10 min, freshest wins among several qualifying forks (#3397). The response keeps the requestedconversationId(client ownership gates trust exact hits) and adds an additivepersonaFork: truefield marking the follow — absent on every pre-existing resolution shape.Why
After a persona-anchor drift forks a dsh conversation onto
base|sub:<fp>, the host keeps stamping the RAW id on every Context-tab poll. An exact hit on the frozen bare row beatfallback=latest(that only fires when the id has NO record), so the tab pinned its embedded frame on the dead row forever while the live lane kept folding. Management TOOL calls already followed the fork (#2601 routing) — the reporter's own data shows the asymmetry: the 503-request live lane still folding while the 43-request bare row sat frozen. The read path simply never got the follow.Behavior change disclosure (old → new)
/__bili/plugin/status?conversationId=<bare>always served the bare row whenever it had any record, even fully frozen with all traffic moved to a|sub:fork.personaFork: true. While the parent is still the live session nothing changes; when traffic returns to the raw id the binding returns home automatically (same self-heal as [Bug] dsh 会话反复 model/provider 切换时主对话迁移到 |sub:<fp> persona fork,宿主盖章的 compress/decompress/acp_status 仍解析在陈旧父 id —— ref 跨空间不可解析直至熔断 #2601).sessionIdand moves the embed frame); zcode/kimi/opencode-acp/MCP probes use literal ids ("zcode", "kimi") that can never have|sub:children → unaffected.Config surface: none — additive read-only JSON field on an existing endpoint; no config key, env var, or CLI flag added. Kernel: untouched (no change under kernel/).
Tests
New
tests/issue4686-status-follows-live-fork.test.ts— 6 cases covering both directions of the gate (#3617): positive follow; negatives = parent still live after fork birth (#3442 shape), ref-less aux fork (#2948 shape), idle > 10 min fork, direct fork-id hit (no chained follow); plus multi-fork recency pick. Verified RED without the fix (the two positive cases fail) and GREEN with it. Targeted adjacent suites green locally (plugin-protocol, plugin-fork, plugin-status-provenance, native-caller stamping/host, side-lane-invariants, dsh-persona-fingerprint, advisory-panel, update-notes, issue404/2029/3862); full-suite verdict = remote CI.