Repository navigation
Description
Summary
On a DSH (desktop) session, the conversation ended up recorded under <sessionId>|sub:<fp16> while the bare id kept a stale record. The Context tab then froze: it keeps showing the bare id's numbers (43 requests / 218,029 ctx) while the proxy keeps folding the live lane (503 requests / 111,451 ctx, cache 99%).
Nothing is broken in the proxy — this is the same |sub: fork family as #3149 / #3150, but the read side cannot follow the forked lane, so the tab silently shows a dead record instead of the conversation.
Environment
- billion-context 0.1.207 (
7e69b49f), dsh desktop@deepseek-ai/dsh0.2.1-rc.3, Windows 11, Node 24 - Installed files are byte-identical to the npm package (sha256 verified:
package.json4473627652b08209…,dist/agent/dsh-native-client.jseb486fa60816932b…,dist/agent/dsh-native.js5614c3b6f50f0744…) → not a local patch, this is shipped behaviour. - No
BILI_*environment overrides;~/.config/billion-context/billion-context.jsonis stock (providers:{},compress{nudgeGrowthTokens:150000, modelContextLimit:850000},dsh.contextTabLabel).
What happens
GET /__bili/stats lists two rows for one conversation:
| id | requests | contextTokens | lastSeen |
|---|---|---|---|
session-2a12c87d-…-d20d94d063e8 |
43 | 218,029 | 10:51:03Z (frozen) |
session-2a12c87d-…-d20d94d063e8|sub:4c73101d32b4dd4c |
503 | 111,451 | 11:05:42Z (live) |
The tab's data source resolves only the bare id:
GET /__bili/plugin/status?conversationId=<bare>&fallback=latest
→ sessionId=<bare>, requests=43, contextTokens=218029 # frozen
GET /__bili/plugin/status?conversationId=<bare>|sub:4c73101d32b4dd4c
→ sessionId=<bare>|sub:…, requests=503, contextTokens=111451 # live
and the client builds the embedded frame from exactly that value:
// dist/agent/dsh-native-client.js:403
src: `${origin}/__bili/?embed=1&lang=${lang}…#/session/${encodeURIComponent(sessionId)}`so the embedded session page is pinned to the dead bare row and never moves again.
Why fallback=latest does not save it
-
dist/agent/dsh-native-client.js:61always passes the bare conversation id:var ctxStatusPathFor = (hostSessionId) => hostSessionId === void 0 ? CTX_STATUS_PATH : `/__bili/plugin/status?conversationId=${encodeURIComponent(hostSessionId)}&fallback=latest`;
-
fallback=latestonly applies when the requested id has no record; here the bare id does have one (the stale fork shell), so it wins forever. -
There is no aggregate route either:
GET /__bili/plugin/statuswith no query returns
HTTP 400 {"ok":false,"error":"conversationId query parameter is required"}.
Expected
The Context tab should follow the conversation that is actually receiving traffic. Options:
- resolve
conversationIdto the freshestbaseorbase|sub:*(bylastSeen, or aggregate requests/tokens across the family), and return thatsessionIdso the embedded frame lands on the live lane; - or make the embed URL use the lane the traffic is on (e.g. return
liveSessionIdnext tosessionId); - or, at minimum, surface the fork in the tab ("this conversation forked to …") instead of showing a silently frozen card.
Reproduction sketch
- DSH desktop + bili-native, a long session that gets folded by bili at least once (this one forked right after the first fold following a host restart).
curl localhost:18787/__bili/stats→ observe the|sub:row carrying the traffic.- Open the Context tab (or just
curl '/__bili/plugin/status?conversationId=<bare>') → numbers stop at the pre-fork values while/__bili/statskeeps increasing.
Workaround attempted (does not work)
"subagentSplit": false in ~/.config/billion-context/billion-context.json, then restart the helper (a host restart alone does not restart it — see below) via POST /__bili/shutdown; the plugin respawns it (pid changed, startedAt new) and /__bili/config confirms the flag is read ("subagentSplit": false in raw). The fork still reappears: the id comes back from the persisted ledger (hasLedger: true), not from a fresh per-request derivation, so the switch cannot undo an existing lane.
Side finding
Host/dsh_restart restarts do not restart the bili helper: same pid/startedAt after relaunch (it re-attaches via "attaching to running proxy"). Config changes therefore need POST /__bili/shutdown + respawn. Worth documenting, since a "restart the host to apply config" instruction silently does nothing.
Related
- [bug] dsh 原生(anthropic)的标题请求未被 isDshTitleRequest 识别,同一会话在 Web UI 拆成两行 #3149 / fix: recognize the dsh title sidecar on the anthropic wire — no more |sub: ghost rows (#3149) #3150 — the DSH title sidecar ghost rows (
|sub:fork); this looks like the remaining "shallow blob claims the bare key / tag changed and history does not continue" branch called out in that PR body. compressis bound to a ref-less|sub:lane, so every fold is refused (gate:none-resolved) #3442 —compressbound to a ref-less|sub:lane (same fork family, different symptom).- [PR] #3862: Context tab embeds the web UI's own session page #4086 — Context tab embeds the web UI's own session page (When an acp_delegate sub-agent is active, the "Context" tab in dsh is repeatedly hijacked to display as the sub-agent's | dsh「上下文」页签在 acp_delegate 子 agent 活跃时被反复劫持显示成子 agent 的会话 #4117).
Activity
ranxianglei commentedon Oct 25, 2026
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b)
查重: 不重复——同家族、不同机制。#3149/#3153(已修,你的 0.1.207 已含)是「fork 怎么来的」那半边(标题 sidecar 抢占裸键);#3442(open)是工具调用侧(compress 被 #2601 启发式误拽到 ref-less ghost)。本 issue 是读侧:
/__bili/plugin/status这条路由从不跟随|sub:谱系,三者机制互不覆盖。版本锚定已核实(v0.1.207,非 master 推断):
handlePluginStatus在 :1564 只做精确 id 解析(resolveForkConversation(conversationId)),:1568 的fallback=latest分支只在「请求 id 完全没有记录」时才触发;dsh 客户端(dsh-native-client.ts:141-145)永远带裸 hostSessionId +fallback=latest。你贴的两行数据与代码路径完全吻合——陈旧裸行有记录,所以 fallback 永远不会接管。机制在你的构建里成立。层次判断:fork 本身的产生(host 重启后历史接续断裂 → persona-anchor fork)是 #3149 家族已知残支,与你说的「代理没坏」一致,不在本修复范围。真正缺的是:管理调用早就跟随活车道了,唯独状态读取没跟。你自己的数据就是铁证——活车道 503 请求、还在折叠,说明 dsh 的 compress/acp_status 转发已经按 #2601 路由落到了
|sub:车道;而 Context tab 轮询的 status 路由把卡片钉死在冻结父行上。这个不对称就是缺陷本体。修法(你给的选项 1,服务端实现,判据与工具调用侧完全一致):
handlePluginStatus在精确命中后,若该会话存在「活的后代」则改服务后代——判据直接复用 #2601/#2948/#3397 既有的livePersonaDescendant(新鲜 ≤10min、持有 refs、流量严格新于父、多个取最新):compressis bound to a ref-less|sub:lane, so every fold is refused (gate:none-resolved) #3442 形状安全);livePersonaDescendantredirects host-stamped management calls to auto-review's aux lane (ref registry always empty) → manual compress of the entire session fails | 【Bug】livePersonaDescendant把宿主盖章的管理调用重定向到 auto-review 的 aux lane(ref 注册表恒空)→ 手动 compress 整会话失效 #2948 判据);响应新增加性字段
personaFork: true标记发生了跟随;conversationId保持请求值(客户端所有权门槛对精确命中无条件信任,无需改动),panel/统计/webUrl 全部来自活车道。客户端零改动:tab 每 10s 重拉一次,下一跳就把嵌入帧移到返回的 sessionId 上。行为变更披露(旧→新):
/__bili/plugin/status?conversationId=<裸id>过去只要裸 id 有记录就永远服务裸会话;现在当裸行相对一个新鲜的持-ref fork 变陈旧时,服务该 fork。其余消费方已逐一核对:zcode/kimi/opencode-acp/MCP shell 里用字面量探测 id("zcode"/"kimi"/"dsh")的路径不可能存在|sub:子代,不受影响;真实 id 的消费方得到的是同意的对齐(它们的管理调用本来就走同一谱系路由)。旁注(不同机制,稍后单独立项,带来源标记):host/
dsh_restart不重启 bili helper(重新 attach 到驻留进程),配置生效需POST /__bti/shutdown+重生——那是车道 attach 生命周期问题,与本缺陷无共享机制。workaround 无效的说明:subagentSplit:false只挡未来派生,不改写已持久化的账本 id,属预期行为;本修复落地后 tab 会直接显示活车道,与该配置无关。标签: bug / dsh / scope/wiring / p2(代理 API 边界的读路径缺陷;功能可用且有绕行——直开 Web UI 或走 /acp——故 p2 而非 p1)。
开工中:回归测试先写(未修代码上红、修后绿),定向套件 + typecheck 过后开 PR(Closes #4686),随后回八问。
ranxianglei commentedon Oct 25, 2026
(ai: vllm-qwen/qwen3.8-27b)
**完成 — PR: https://github.com/ranxianglei/billion-context/pull/4703**(Closes #4686)
版本核实:已逐行核对你构建(v0.1.207)的代码路径——
handlePluginStatus只做精确 id 解析,fallback=latest仅在该 id 完全无记录时触发。机制在你的构建里存在,不是版本滞后。层次判断:fork 本身(host 重启后漂移 → persona 锚点分裂到
|sub:)是 #3149 家族的已知残留,你已明确定位「proxy 没坏」;真正坏的是读写不对称——管理类工具调用(compress/acp_status)早就按 #2601 路由跟随 live lane(所以你那条 503 请求的 lane 一直在折叠),而 Context tab 的数据源/__bili/plugin/status从没拿到这个 follow,tab 就永远钉在冻结的裸行上。修法(对应你的选项 1,服务端,客户端零改动):
plugin/status命中陈旧裸 id 时跟随 live fork——复用与工具调用路径完全同一套判据(livePersonaDescendant):fork 诞生于父会话最后一次流量之后(出生序,compressis bound to a ref-less|sub:lane, so every fold is refused (gate:none-resolved) #3442/fix: persona-lineage follow must not redirect host calls into a fork while the parent is still active #3647 精化)、持有 refs(【Bug】livePersonaDescendantredirects host-stamped management calls to auto-review's aux lane (ref registry always empty) → manual compress of the entire session fails | 【Bug】livePersonaDescendant把宿主盖章的管理调用重定向到 auto-review 的 aux lane(ref 注册表恒空)→ 手动 compress 整会话失效 #2948 断路器)、空闲 ≤ 10 分钟、多个合格时取最新(Compression fails in long sessions while new sessions work fine | 压缩失败.新会话反而没事 #3397);personaFork: true标记「服务的是 live lane」;conversationId仍返回请求的 id(dsh 客户端的 ownership gate 信任精确命中),所以 dsh 侧一行不用改——tab 的 10 秒轮询下一轮就会把内嵌 frame 挪到 live lane。八问:
|sub:lane 的 dsh desktop 用户看到过期/冻结的 Context tab;压缩本体与全部实际功能不受影响(都走 live lane)——可观测性冻结,非数据丢失;绕行 = 直接开 Web UI。p2。handlePluginStatus既有行为——活父精确命中不变 /fallback=latest路径不变 / zcode·kimi 字面 id 探针(不可能有|sub:子代)不变 / 直接命中 fork id 不链式跟随——6 个回归测试双向钉住(Test Blind Spot Retrospective: Reinforcing Negative Assertion Discipline, Tightening Fake Upstream Strictness, Thin Inst | 测试盲区复盘:补反向断言纪律、假上游严格化、薄安装冒烟、形态矩阵与生命周期覆盖 #3617 gate 纪律),修复前验证红、修复后绿;工具调用路径零改动无语义漂移。personaFork(PR 内有说明)。说明:分支已 rebase 到最新 master(ac844facd,含 v0.1.207 release 与 #3442 出生序精化)——fix 自动继承精化后的判据。本地 typecheck + 定向套件(13 文件 132 用例)绿,全量回归以 CI 为准。
顺带发现已单独立项:host restart 不会重启 bili helper(re-attach 同 pid),配置修改需手动 shutdown+respawn 才生效——不同机制,https://github.com/ranxianglei/billion-context/issues/4705(带来源标记)。
标签判定:bug / dsh / scope/wiring / p2(协议接线边界读侧缺陷;可用且有绕行)。镜像 API 无法持久化标签写入(首帖已说明),判定留在此线程。
待 CI 绿 + 你合并。
ranxianglei commentedon Oct 25, 2026
(ai: vllm-qwen/qwen3.8-27b)
CI 状态补充(接上条「待 CI 绿」):PR #4703 的 6 个红分片已逐片日志核对——全部落在 master 自身在册的 born-red 集群(storage golden/engine-proofs、plugin-fork、orphan-recovery、web-blogfeed)+ 1 条 Windows 平台 flake(attach-mode 用例,本分支本地定向跑绿);六片日志对本 PR 文件零命中,本 PR 定向域在绿分片。属继承性红,已按协调流程记入 #4599;等 master 侧 born-red 集群收敛后重触发即绿,分支侧无需改动。合并判定不受影响。