Repository navigation
Description
Description *
环境:billion-context 0.1.184,dsh desktop profile(native 插件,lane=dsh),deepseek-flash(窗口 1,000,000),Windows。
现象:本会话的 compress 调用永久失败,重试无用:
compress FAILED → 0 blocks. every ref is unknown to this session.
[diagnostics: session highest ref=none, unknown ranges in request=1/1, session history=0 compression(s), 0 block(s)]
本次没有任何一次 fold 成功(这正是问题),所以没有 fold 前/后的对比可给
原因(日志 + kernel 代码可证):该会话 id 下的第一个请求是一条 side request,它先占住了 persona 锚点,14ms 后第一轮主会话就已经带上 |sub: 后缀;而宿主盖章给 compress 工具的是裸 id。
05:46:30.555 side request (max_tokens<=200) → passthrough + tag strip only, kernel state untouched
sess=session-052c1eaf-… ← 裸 id
05:46:30.569 processTurn: 3 msgs
sess=session-052c1eaf-…|sub:d1bdbce38bf93a46 ← 第一轮已被改名
side request 的短路分支在 src/server.ts:2804,而 persona 身份解析在 src/server.ts:2194-2245,短路晚于锚定,所以它照样走了 subagentNamespace(...) 并占住了裸 key(kernel/src/wire/responses.ts 的 createSubagentNamespaces:首个 system 占住 raw key)。
与 AGENTS.md 冲突:§2 Key Design Decisions 09 的结论是
The FIRST system seen under the id keeps the raw key … so main turns never fork。
PR #1956 评审里承认过的「最坏 = 一次角色互换」是限定在代理重启竞态的,本次没有重启,是 side request 先到。
旁证:同一代理、同一时段,其它会话与两个子 agent 的压缩均正常(state 里 6 个 / 1 个活跃 block,另有历史会话 2 个 / 1 个),只有这一条落在 |sub: 一侧。
期望:修复该会话(以及同类时序)永久无法压缩的问题。我不打算提 PR,只报告;如需补充日志请告知。
bili version *
0.1.184
Usage mode *
Plugin native (bili plugin install …, runs inside the host process)
Client and version *
dsh 0.2.0-rc.2 (desktop profile, bili native plugin bundle)
Operating system *
Windows 11 25H2 (build 26200.9457), native Windows, not WSL2
Upstream and model *
api.deepseek.com (anthropic wire: /anthropic/v1/messages) · deepseek-flash · 1,000,000
Compression-related config (optional)
无 —— ~/.config/billion-context/billion-context.json 只有 {"providers":{}}Log excerpt (strongly recommended)
2026-10-05T05:46:30.548Z [info] [v=0.1.184] [window] model=deepseek-flash source=plugin native=1000000 effective=1000000 launcher=none configured=none peek=none fallback=false
2026-10-05T05:46:30.555Z [info] [sess=session-052c1eaf-0416-4aae-a002-4fbefcfa1d5c] [v=0.1.184] [session-052c1eaf-0416-4aae-a002-4fbefcfa1d5c] side request (max_tokens<=200) → passthrough + tag strip only, kernel state untouched
2026-10-05T05:46:30.555Z [info] [sess=session-052c1eaf-0416-4aae-a002-4fbefcfa1d5c] [v=0.1.184] [session-052c1eaf-0416-4aae-a002-4fbefcfa1d5c] request: 1 msgs, inbound=119.0KiB, outbound=119.0KiB, local=26ms
2026-10-05T05:46:30.569Z [info] [sess=session-052c1eaf-0416-4aae-a002-4fbefcfa1d5c_sub:d1bdbce38bf93a46] [v=0.1.184] [session-052c1eaf-0416-4aae-a002-4fbefcfa1d5c|sub:d1bdbce38bf93a46] processTurn: 3 msgs, renderTags=text-only, 3 text tagged, 0 tool tagged
2026-10-05T05:47:51.703Z [warn] [v=0.1.184] [plugin] tool "compress": host-stamped native caller "session-052c1eaf-0416-4aae-a002-4fbefcfa1d5c" conflicts with outbound witness — honoring the native caller, refusing the witness (#2024)
2026-10-05T05:47:51.707Z [info] [v=0.1.184] [session-052c1eaf-0416-4aae-a002-4fbefcfa1d5c] [plugin] [acp-proxy: compress FAILED m00004–m00066 → 0 blocks. None of the 1 requested range(s) resolved — every ref is unknown to this session. [diagnostics: session highest ref=none, unknown ranges in request=1/1, session history=0 compression(s), 0 block(s)]
/acp or acp_status output (optional)
本会话的 acp_status 拿不到块列表(这本身就是症状之一)。等价的持久化状态
(~/.local/share/billion-context/sessions/anthropic/*.json):
session-052c1eaf-…|sub:d1bdbce38bf93a46 : blocks=0, messageRefs.byRaw=233, stats.requests=54, lastInputTokens=263991
session-052c1eaf-… : blocks=0, byRaw=0, requests=0, lastInputTokens=0 ← compress 工具调用带的裸 id
da768738-… (子 agent A) : blocks=6 (6 active), requests=56
026b76fd-… (子 agent B) : blocks=1 (1 active), requests=11
Activity
ranxianglei commentedon Oct 5, 2026
[bot] 🏷
查重:按 persona anchor / side request / sub fork / subagentNamespace 等关键词检索了 open+closed issues 与 PRs,无重复。相关条目是本 bug 打碎的机制本身(#1916/#1307/#1314 指纹机制、#388 side passthrough 契约、#1897 leaked-tools demotion),不是重复报告。
审核(动手前三步):代码+你的日志双重确认——kernel 的
subagentNamespace把「首个非空 system」锚定为 raw key(可变进程内状态,无删除 API),而 bili 在src/server.ts里 persona 身份解析跑在 #388 side-passthrough 短路(~line 2807)之前,于是无状态的 side request 也参与锚点写入。你的日志时间线(05:46:30.555 side request … sess=<bare-id>→05:46:30.569 processTurn sess=<bare-id>|sub:d1bdbce…)与代码路径完全吻合。这是根因层而非表面现象:修法是让 side request 根本不参与锚点解析(producer 处),而不是在下游加恢复逻辑。结构化七问:
|sub:<fp>会话,主会话上的原生 compress 永久失败("every ref is unknown to this session")。subagentNamespace以「首见 system = raw key」为锚(可变进程内存,无删除 API);bili 的身份解析先于 side-passthrough 短路执行,使从不触碰 kernel 状态的 side request 也写锚点。第一个到达的请求决定一切,之后不可恢复。同一机制的第二个切面:即便主 turn 先锚定,side request 之后也会骑到垃圾|sub:<fp(side)>会话上,违背 标题生成等侧请求污染主会话状态:prepareAnthropic 缺 isTitleGen 守卫、快照无条件覆盖、survivedCount 每请求空转 #388「side requests share the main session key」契约。sideRequestLike预判——完整镜像 标题生成等侧请求污染主会话状态:prepareAnthropic 缺 isTitleGen 守卫、快照无条件覆盖、survivedCount 每请求空转 #388 lane 条件(budget≤200/无工具形态,或全-bili-tools demotion 形态,含 [bug] bili dsh 长会话中 max_output_tokens 被压到 ≤200,主请求被误判为 side request 并绕过压缩 #546 starved-budget 否决与 ACP-artifact 检查;detectAcpArtifacts排最后,proxy 流量不付全历史重编码的代价)。side request 一律解析为 verbatim 原 key:既不读也不写锚点,与其「永不触碰 kernel 状态」的地位一致。顺带抽出hasLeakedBiliToolsOnly(stripLeakedBiliTools 的只读孪生,行为不变)。行为变更披露(old → new):
|sub:<fp(side)>会话;新值 = 恒为 verbatim conversation key,永不触碰锚点。残留(超范围):proxy 重启后若 classifyRisk/review 先到,仍会看到冷锚点表(src/session-id.ts:151-153 已记录的 worst case,#1956 接受);彻底解决需要持久化锚定,是独立的设计决定,不在本 PR。
你那个坏掉的会话不可恢复:状态孤立在带后缀的 key 下,host 继续戳 bare id——开新会话即可恢复正常,此修复保证不再复发。
PR: #2157 (Closes #2156,待人工合并)
docs: KDD#9 — side requests never claim the persona anchor (#2156/#2160)
Merge pull request #2157 from ranxianglei/2026-10-05_side-request-per…
fix: side requests must not claim the persona namespace anchor (ranxi…
test: pin the #2503 dsh title sidecar at the handle level (hermetic)
test(#2730): pin google-lane side-request exclusion (verbatim, no fork)
fix: #2815 review follow-ups — persisted-chain tiebreaker, schema v2,…
fix: recognize the claude code title sidecar so it never claims the r…
fix: follow the ref-holding lane when host-stamped calls land on a si…
fix: follow the ref-holding lane when host-stamped calls land on a si…