Repository navigation
session self-heal: zombie plugin lanes degrade to proxy tools, idle nudges suppress, 524 summaries learn streaming (#2155) - #2246
Conversation
…udges suppress, 524 summaries learn streaming (#2155) - src/session-self-heal.ts: per-request detector (SELF_HEAL_WINDOW=5). D2 zombie plugin lane (plugin removed, session still bound: headerless + no bili tools on the wire + no reduction across 5 nudged rounds) degrades to proxy mode — one pluginMode flip re-injects the ACP tools wire-side, keeps the nudge; falls back to suppress-nudge when injectTool is off. pluginLaneRestore() runs BEFORE the pluginMode flip so the first header-bearing request is already plugin mode (the sticky pluginAgent must not be the restore signal). D1 nudge-idle (5 nudged rounds, zero reduction) suppresses the nudge at all four willInjectNudge gates until a reduction/tool-use resumes. - preflight: a non-streaming summary killed by HTTP 524/504 stops burning in-place retries — first hit learns metadata.preflightStreamSummary and re-requests as SSE (#2133 lane, auto-armed). - observability: metadata.selfHeal {detected, action, since} in /__bili/sessions + web UI heal badge + one [self-heal] log line per transition; bili plugin remove best-effort warns about live sessions of that client seen in the last 10 minutes (2.5s timeout, silent on failure). - tests/issue2155-self-heal.test.ts: 12 tests (state machine unit + zombie degrade/recover e2e + nudge-idle e2e + 524 learn e2e + CLI warn). - docs: CLIENTS.md en/zh (zcode open sessions after removal), TECHNICAL-NOTES.md en/zh (detector constants + remedies).
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.2328-pr.2246.31a0813This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr2246.tgz
npm install -g packageInstall instructions are refreshed on each push. |
…#2155 D3 × #2133) The first-hit 524/504 SSE learn flipped the UNSET default, but #2133's explicit cascade FALSE must stay the operator's 'never stream summaries' opt-out: streamSummaryOff (PreflightDeps) blocks the 400 'stream required' learn, the new 524/504 first-hit learn, and ignores an already-armed flag. The two #2133 e2e tests now pin the explicit-OFF contract (unset routes auto-learn — covered by issue2155-self-heal tests).
|
CI 修复披露(#2133 × #2155 默认语义):首个 commit 把"未设置 streamSummary"的默认行为改为 524/504 首中即学 SSE,推翻了 #2133 钉住的"无旋钮→永不学、fail-fast"契约,CI 两个 e2e 红。修正为级联双向尊重:显式 false(任一级) = 操作员 opt-out,两条学习路径(400 stream-required + 524/504 首中)都不武装、已学旧标志被忽略;未设置(默认)= 首中 524/504 自动学(#2155 新默认,owner 已拍板方向);显式 true = 首次即流式(#2133 原行为)。两个 #2133 测试改为钉显式 OFF 契约,未设置路由的自动学由 issue2155 测试覆盖。TECHNICAL-NOTES 同步。 |
[bot] 🏷 Review 结论(head 1. 是什么问题:插件被卸载但已开客户端窗口仍带粘滞 2. 什么原因导致的:三个独立根因——(a) 3. 怎么修复的:每请求一次、仅 nudge-active 轮求值的自愈钩子: 4. 是否回归问题:逐路径审过既有行为——pluginMode 翻转与 4 处 nudge 门只在新增 selfHeal 状态下激活,对存量流量零影响;持久化纯增量字段,旧文件可读。已验证你披露的 CI 红:从 ubuntu-24 job 日志确认恰好是两个 #2133 测试( 5. 是否破坏缓存:降级会话回注 ACP 工具会触发 Anthropic tools 前缀缓存 miss,但只发生在本已坏掉的僵尸会话上,健康会话不受触达;nudge 抑制只删尾部注入消息,头部字节稳定;524 学习翻转的是代理内部摘要调用形式,不动客户端前缀缓存。持久化去重键/游标均未动。 6. 是否改了设计方向:无转向——单写者/插件归属契约不变(绑定保留、永不抹除,降级是模式切换不是身份改写);自愈层叠在既有会话状态机之上,恢复路径保证可逆(wire-shape 级改动属实:pluginMode 翻转改变注入与管道选择)。 7. 是否引入了新的配置:无新配置面—— 判定:方向正确、实现干净、回归面已审、CI 全绿。按 §7.4(feat + wire-shape)需人工合并:#2246 ——可以合。 |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.75-master.48b53f3 # this exact build
npm install -g billion-context@master # always the newest merged build
|
会话卡死自愈机制(#2155)
实现 #2155 的三方检测器 + 两档补救,按 owner 拍板方向:检测层照 ework 设计,补救层主档=僵尸会话降级为 proxy 注入(把工具还给会话),降级不可用才落抑制档;D3=524/504 首中即学流式摘要。
检测与补救(src/session-self-heal.ts,常量 SELF_HEAL_WINDOW=5)
pluginMode = pluginAgent !== undefined && !pluginLaneDegraded(session)(src/server.ts),ACP 工具线上回注、压缩 rewriter/CCR/absorb 全部自动跟随、nudge 保留(工具有用了)。compress.injectTool=false时降级不可用→落 suppress-nudge。恢复=活的插件头(pluginLaneRestore 提到 pluginMode 翻转之前,首个带头请求即恢复 plugin 模式;恢复信号绝不能用粘滞 pluginAgent —— 否则降级一轮后自己清掉,已修)。绑定永不抹除。&& !nudgeSuppressed(session)(覆盖 emergency 路径)。恢复=任一压缩缩减或 bili 工具调用。可观测
bili plugin remove <client>尽力查活代理(instance 文件→GET /__bili/sessions,2.5s 超时失败静默),该 client 近 10 分钟有活跃会话则打印提示。验证
设计权衡(已按 #2155 评论讨论落定)
Closes #2155