Skip to content

release v0.1.184 (critical: #2082 desktop tool loss) - #2097

Merged
ranxianglei merged 4 commits into
masterfrom
2026-10-04_release-v0.1.184
Oct 4, 2026
Merged

ranxianglei merged 4 commits into
masterfrom
2026-10-04_release-v0.1.184

Conversation

@ranxianglei

@ranxianglei ranxianglei commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

版本发布 PR:v0.1.184,带 critical 级 release note(下游会在 acp_status / /acp 面板看到 CRITICAL UPDATE READY/AVAILABLE)。

本版内容(自 v0.1.183)

Release note 条目(release-notes/package.json, schema 1)

合并即发布

  • merge 触发 release.yml(分支名 *_release-v* 匹配):typecheck+test+build → npm publish latest + tag v0.1.184 + GitHub Release(auto notes)。
  • 同一 push 触及 release-notes/** → release-notes.yml 发布 companion 包(update-notes.ts 可见面)。
  • 发布后建议 dispatch ci-release-canary(ref=master) 走自更新收敛链路。

定级说明

#2082 属"serious defect users must act on"(可用性类:桌面端压缩/工具永久失效直至重启,用户需升级+重启 dsh),低于 advisory 强升门槛(advisories/ 保留给 force-upgrade 级缺陷),故走 critical tier 而非 advisory——符合 #1870/#1977 政策。#1632(install-dir)已随 0.1.183 发布。

按惯例 release PR 由 owner 合并。


Update (2026-10-04): folded in fix(#2101) — a re-activation after a healthy registration also re-registers the tools now (the same #2082 symptom from the success ordering). Fixes #2101. Regression test verified to time out on the unfixed tree; all #2082 recovery tests still green, typecheck + build clean.

@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-04_release-v0.1.184 (fbc7f03)

Option A — Install this exact build (recommended)

npm install -g billion-context@0.0.2147-pr.2097.cc4bc7a

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Option B — Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr2097.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei
ranxianglei force-pushed the 2026-10-04_release-v0.1.184 branch from bd54781 to 1f07db1 Compare October 4, 2026 12:28
…ation must not be re-poisoned by a stale ctx capture

The #2082 fix reset register.dead on re-activation and armed a detached recovery timer, but two async paths still resolved their PluginContext from a capture taken when the retry was armed or started: the timer tick (armRecoveryTimer captured the first ctx that saw the broken state) and an in-flight registration landing after a mid-fetch re-activation (registerTools captured ctx at call time). If dsh deactivated that context in between (profile switch / settings toggle / desktop copy swap), the stale path registered into it, cordis threw 'inactive context', and register.dead was re-poisoned until dsh restarted — exactly the failure this fix removes, in a narrow interleaving.

Track the latest context in module state (apply() + maybeRetry update it; _resetRegisterForTest clears it). The timer tick and the single-flight registration landing now resolve activeCtx ?? ctx at landing time. Regression tests pin both facets: they fail on the pre-fix code and pass with the fix.
@ranxianglei
ranxianglei force-pushed the 2026-10-04_release-v0.1.184 branch from 1f07db1 to 997c1fd Compare October 4, 2026 12:44
ework-agent added 2 commits October 4, 2026 20:49
…INTERVAL_MS in CONFIGURATION.md en+zh

The #2091 recovery knobs shipped without CONFIGURATION.md entries while every sibling dsh-plugin knob (incl. the adjacent BILI_MODEL_INFO_RETRY_MS) is documented — 'document or don't ship' (env-var discipline #2030, hard rule 4). Both are test/ops hooks with unchanged defaults; production behavior is untouched.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

Review 结论 — release v0.1.184(#2097)

审查方式:按版本区间回归审计规则,把 v0.1.183..HEAD 的全部变更作为一个整体综合审阅(不逐分支拼结论),覆盖五个功能域:#2049 master 滚动 tag、#2053 website、#2073/#2080 docs、#2072 nativeCaller stamp、#2082 desktop tool loss(critical 主体)。release commit 本身干净:仅 version + lockfile + release-notes entry(tier critical,summary 合格)。

审查中发现两个问题,均已在分支上顺手修掉(独立标注 commit):

  1. fix(#2082): resolve the recovery context at landing time(028bb2f) — dsh中工具会突然消失 #2082 的修复在 re-activation 时 reset register.dead 并装了独立恢复定时器,但两条异步路径仍然从「arm/发起时刻的捕获」解析 PluginContext:(a) 定时器 tick 用的是第一个观察到 broken 状态的 ctx;(b) in-flight 注册在 call time 捕获 ctx。若 dsh 在期间 deactivate 了那个 context(profile switch / settings toggle / desktop copy swap —— 正是 dsh中工具会突然消失 #2082 的触发场景),stale 路径会向它注册 → cordis 抛 "inactive context" → register.dead 被重新投毒 → 工具消失直到 dsh 重启。这正是本 release 要消灭的失败模式,只是走了一条更窄的时序窗口。修法:模块级跟踪最新 ctx(apply()/maybeRetry() 更新),两条异步路径都在 landing 时刻解析 activeCtx ?? ctx;无 re-activation 时恒等于原 ctx,行为不变。新增两个回归测试分别钉住两个侧面,已验证:pre-fix 代码上两个测试全红,fix 后全绿。
  2. docs(#2082)(d32db9a) — BILI_DSH_RETRY_INTERVAL_MS / BILI_DSH_RECOVERY_INTERVAL_MS 在 d9fca57 里随码上线但没有 CONFIGURATION.md 条目,而同文件所有兄弟 knob(含紧邻的 BILI_MODEL_INFO_RETRY_MS)都有 en+zh 文档 —— 违反 "document or don't ship"(env-var discipline 彻底整治环境变了滥用,除非必要都走配置文件 #2030 硬规则 4)。已补 en+zh 两行;纯文档,零行为变化。

CI:最终 head 0bec76c8 上 21/21 check runs 全绿(四平台 test 矩阵、全部 e2e lane、hermetic registry e2e、version-guard、image billing)。PR 状态 clean/mergeable。

结构化七问

  1. 是什么问题:v0.1.179 起,dsh 桌面用户自动更新把 profile copy 就地换掉后,bili 工具(compress/acp_status 等)整体丢失且直到重启 dsh 才回来;另有 host-native agent 工具调用可能被 stale sibling session witness 错误改道或 fail-closed(Host-native agent tool forwarding lacks nativeCaller stamping: stale outbound witness misroutes ACP tool calls across subagent sessions #2072)。
  2. 什么原因导致的:三层。(a) 插件侧:cordis deactivate/reactivate 周期中一次 "inactive context" 注册拒绝会把 register.dead 毒化到进程生命周期结束,后续一切重试短路;且恢复完全靠流量驱动——用户空闲时(模型已放弃缺失工具,正是报告场景)没有任何东西再触发重试。(b) 更新器侧:桌面就地刷新 lane 换 copy 前不验证新 copy 能否启动,坏 tarball 落地 = 工作 copy 没了 + 工具也没了。(c) Host-native agent tool forwarding lacks nativeCaller stamping: stale outbound witness misroutes ACP tool calls across subagent sessions #2072:host-native 调用在线上没标记为 native caller,witness 守卫无法把它和外来调用区分开。
  3. 怎么修复的:(a) apply() 每次激活 reset dead;maybeRetry 在 respawn 未 arm 时装 fallback respawn;unref 的独立定时器在零流量下持续重试(周期 knob,默认 = 既有 10s backoff);外加本次 stale-ctx landing fix,保证 re-activation 永远不会被旧捕获重新投毒。(b) installViaTarball 增加 opt-in bootSmoke:删备份前用 scrubbed env + 20s 超时跑 node <pkg.main> --version,失败 → restoreFromBackup + 大声报错;只接入桌面就地 lane。(c) forwardTool 对确认的 host-native 调用点盖 body.nativeCaller=true(truthiness 守卫),witness 逻辑将其作为 ladder rung 0 直接路由回家。
  4. 是否有回归问题:全窗口既有行为逐项审过,均保持——
    • src/update.ts:bootSmoke 是默认关的 opts,其余所有 installViaTarball 调用点字节级不变;失败走既有 restoreFromBackup 路径(fail-fast 保持,不是吞错);throttle/跨进程锁语义未动。
    • shared.ts forwardTool:新增尾参默认 false → 非盖章调用点 wire shape 与旧版一致;pi 站点有 conversationId !== "unknown" 守卫;非 string id 降级回 legacy wire 而不是抛错(fail-safe 方向);盖章点清点过,恰为 host-native 集合。
    • plugin.ts:仅注释。
    • dsh-native.ts:dead reset 严格放宽恢复面(旧行为 dead 到进程退出为止);定时器 unref(不拖住进程退出)、NODE_TEST_CONTEXT 下默认不启动(套件安静)、周期=既有 backoff(不产生超出流量驱动重试的新负载);activeCtx === ctx 在无 re-activation 时恒成立,即除被修的场景外行为逐字节相同。
    • CI workflows:master-build.yml 只在非 release 的 master push 上发 0.0.x-master 滚动 tag、显式跳过 release merge(不与 release.yml 双发);客户端更新器没有任何 @master 解析逻辑(src/ 未动);pr-artifact.yml diff 仅注释;pages.yml + website/ 纯静态站。
    • 高危模式逐项过:错误处理无语义漂移、阈值/时序/输出格式无漂移(除已披露 knob)、缓存失效策略未触。结论:无意回归为零。
  5. 是否破坏缓存:否。prefix-cache / persistence / 去重键路径均未触碰;nativeCaller 盖在路由到 proxy 插件端点的工具执行请求上,消息重建与 prefix 稳定性不变,ACP 压缩缓存不受影响。
  6. 是否改了设计方向:无转向。每项都落在既有机制内:boot-smoke 收紧 install-lane contract 规则 2(每个 copy 必须有活的更新路径——自愈走 owner 认可通道);nativeCaller 给既有 witness ladder 加 rung 0;master tag 是与 release.yml 平行的 CI 发布 lane(滚动 tag,客户端不解析)。唯一有意的新表面:0.0.x-master dist-tag 作为分发布件(已在 workflow 与 ACP_UPDATE_TAG 文档行披露)。
  7. 是否引入了新的配置:BILI_DSH_RETRY_INTERVAL_MS(默认 10000ms)与 BILI_DSH_RECOVERY_INTERVAL_MS(默认跟随前者,10000ms)——dsh 插件宿主侧 test/ops knob,env-only 类别(host-side posture,在第三方 dsh 进程内读取),现已按纪律补入 CONFIGURATION.md en+zh(本次 docs commit);生产环境 unset 时行为与默认完全一致。另有 npm master dist-tag(非配置字段,ACP_UPDATE_TAG=master 才启用)。

判定:✅ 可合。critical-tier 内容端到端验证完毕(回归测试 red→green 实证、CI 21/21 绿、release commit 隔离干净)。合并后 CI 自动 publish latest + tag + GitHub Release + release-notes companion;OP 里的 post-publish 建议(canary dispatch ref=master)照做即可。

A re-activation after a HEALTHY registration used to leave the bili tools
dead until dsh restarted — the same #2082 symptom reached from the success
ordering. apply() reset register.dead and activeCtx, but not
register.toolsReady: the tools registered into the deactivated context die
with it, while every registerTools()/maybeRetry() early-returns on the
stale stamp, so the new context never re-registers (and headersFor keeps
stamping plugin mode for a lane whose dsh side has no tools).

Clear toolsReady (and retryAt, per #1783's fresh-activation rule) when
apply() sees a context change. Scoped to a context CHANGE: a same-context
re-apply keeps its registration (the attach verify path already re-checks
on its own).

tests/issue2101-dsh-reactivation.test.ts: the success-ordering
re-activation test times out on the unfixed tree (verified) and passes
with the clear; a same-context re-apply stays healthy.
@ranxianglei

Copy link
Copy Markdown
Owner Author

重新review一次

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

重新review完成。自上一轮以来 PR 只有一个新提交:fbc7f03(你把 #2101 的修复折叠进本 PR);其余提交未变,第一轮的版本区间审计(v0.1.183..HEAD)结论继续有效。以下是对 fbc7f03 的独立复核(不是照抄 #2101 线程的结论):

代码核对

结构化七问

  1. 是什么问题:bili 工具成功注册进旧上下文后,dsh 停用旧上下文并对同一模块实例重新 apply(profile 切换/设置开关/插件重载),新上下文永远拿不到工具注册,而代理持续以插件模式服务——模型丢全部 bili 工具直到重启(dsh中工具会突然消失 #2082 症状的成功序路径)。
  2. 什么原因导致的:toolsReady/retryAt 进程级锁存器不跟踪上下文身份——一旦为 true,所有注册路径早退,没有任何机制为新上下文触发注册;apply()(dsh中工具会突然消失 #2082 修复)只重置了 dead 没有重置它。
  3. 怎么修复的:在激活决策点(apply())识别「上下文身份真正变化」并清陈旧锁存;下游完全复用既有机制(ready 链重注册 + gate 压首请求),不新增任何恢复路径。
  4. 是否有回归问题:未发现。逐项清单:同上下文 re-apply 行为不变(专用测试钉住,无额外 manifest 拉取);首次 apply no-op;dsh中工具会突然消失 #2082 dead 重置/recovery timer/落地解析不变(issue2082 套件 4/4);back-off/single-flight/spawn-attach 路径未触碰;release 提交本身仍只含版本行+lockfile+notes。证据(本地 A/B):未修树(0bec76c + 仅加新测试)→ not ok 1(恰好超时在新上下文注册等待上)、ok 2;修复树 → issue2101×2 + issue2082×4 = 6/6,dsh-native.test.ts 43/43,typecheck 干净。
  5. 是否破坏缓存:不涉及——缓存/重试游标/去重键均未动(retryAt 清零是有意清除陈旧墙,非失效策略变更)。
  6. 是否改了设计方向:不涉及——纯 register 状态机内的生命周期锁存修复。
  7. 是否引入新配置:不涉及。

行为变更披露:旧行为——健康启动后的一次重激活会永久性丢工具直到重启;新行为——重激活清锁存、触发一次 manifest 拉取+重注册(数十毫秒量级),期间 gate 压住首请求。这是修复目标本身,非附带漂移。

CI:head fbc7f03 —— 20 绿 + 1 skipped(version-guard,release 分支正常跳过)+ 0 失败;PR mergeable。

判定:✅ 可合。合入后 CI 发布 0.1.184(含 #2101 修复)+ companion package;建议发布后照常 dispatch ci-release-canary ref=master。

@ranxianglei
ranxianglei merged commit 4e0eaa7 into master Oct 4, 2026
21 checks passed
@ranxianglei
ranxianglei deleted the 2026-10-04_release-v0.1.184 branch October 15, 2026 05:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dsh-native: apply() on a re-activated context doesn't reset register.toolsReady — tools stay registered only on the dead context

1 participant