@feng0531/dsh-execution-bus 0.2.10 → 0.2.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  “萧何”是产品与模式显示名,执行总线是其技术功能;不新增人物 Agent,不进行角色扮演。仓库 dsh-execution-bus、npm 包名、execution_bus 工具名及 execution-bus-test 预设 ID 保持不变。历史版本发布说明保留当时名称。
6
6
 
7
- DSH 独立插件:`@feng0531/dsh-execution-bus` · 当前版本 **0.2.10**
7
+ DSH 独立插件:`@feng0531/dsh-execution-bus` · 当前版本 **0.2.11**
8
8
 
9
9
  > 当前是早期可运行版本,不是完整生产验收版。已验证真实 DSH 组件和脚本模型驱动的内存会话;真实模型、桌面界面和 PTC 完整链路尚未验收。**不支持重启后恢复任务。**
10
10
 
@@ -102,7 +102,7 @@ flowchart TD
102
102
  2. 在你选定的隔离 DSH 配置依赖目录安装固定版本,不要在 DSH 程序安装目录执行:
103
103
 
104
104
  ```powershell
105
- npm install --ignore-scripts @feng0531/dsh-execution-bus@0.2.10
105
+ npm install --ignore-scripts @feng0531/dsh-execution-bus@0.2.11
106
106
  ```
107
107
 
108
108
  这是 npm 目录示例。若目标配置使用 pnpm,应沿用其包管理器,不混用锁文件。遇到宿主 peer 版本冲突就停止,不用强制安装绕过。
@@ -231,7 +231,7 @@ npm run test:install # 临时目录安装,不操作日常 DSH
231
231
 
232
232
  - [协议和投递语义](<docs/protocol.md>):字段、状态、重复处理与取消规则。
233
233
  - [宿主兼容性与源码调用链](<docs/host-compatibility.md>):为什么可以等待,为什么不能跨重启恢复。
234
- - [验证记录](<docs/validation.md>)、[0.2.10 发布说明](<docs/releases/0.2.10.md>):已验证与未验证范围。
234
+ - [验证记录](<docs/validation.md>)、[0.2.11 发布说明](<docs/releases/0.2.11.md>):已验证与未验证范围。
235
235
  - [维护者发布流程](<docs/RELEASING.md>):标签 CI、安装包校验与正式发布门禁。
236
236
 
237
237
  ## 许可
package/dist/plugin.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { randomUUID } from "node:crypto";
2
+ import { setTimeout as pause } from "node:timers/promises";
2
3
  import { ExecutionBus, parse } from "./bus.js";
3
4
  import { testHandler, readHandler } from "./handlers.js";
4
5
  export const name = "execution-bus";
@@ -107,12 +108,6 @@ export function apply(ctx) {
107
108
  },
108
109
  });
109
110
  const ownerId = exec.agent.id;
110
- let hostCommitted;
111
- const hostSettlement = new Promise(resolve => { hostCommitted = resolve; });
112
- const stopSettlementObserver = ctx.jobs.events.subscribe({ owner: ownerId }, event => {
113
- if ((event.type === "settled" || event.type === "removed") && event.job.id === job && event.job.owner === ownerId)
114
- hostCommitted();
115
- });
116
111
  // One registered host waiter suppresses extra completion messages for every attachment.
117
112
  settled = (async () => {
118
113
  try {
@@ -140,19 +135,30 @@ export function apply(ctx) {
140
135
  // attached, drain both producer and host outcome, then attempt cleanup once.
141
136
  await attached.done;
142
137
  if (!alreadyRemoved) {
143
- await hostSettlement;
144
- try {
145
- ctx.jobs.remove(job, ownerId);
146
- }
147
- catch {
148
- /* Best effort cleanup must not replace the original service error. */
138
+ // No scope-owned observer: teardown can remove it before settlement.
139
+ // After producer drain, allow a bounded host commit window. This is
140
+ // program-side cleanup only, never execution retry or model polling.
141
+ for (let attempt = 0; attempt < 20; attempt++) {
142
+ try {
143
+ const view = ctx.jobs
144
+ .list(ownerId)
145
+ .find((view) => view.id === job && view.owner === ownerId);
146
+ if (!view)
147
+ break;
148
+ if (view.status !== "running" &&
149
+ view.status !== "stopping") {
150
+ ctx.jobs.remove(job, ownerId);
151
+ break;
152
+ }
153
+ }
154
+ catch {
155
+ break;
156
+ }
157
+ await pause(10);
149
158
  }
150
159
  throw error;
151
160
  }
152
161
  }
153
- finally {
154
- stopSettlementObserver();
155
- }
156
162
  })();
157
163
  sharedJobs.set(jobKey, settled);
158
164
  void settled.then(() => sharedJobs.delete(jobKey), () => sharedJobs.delete(jobKey));
@@ -0,0 +1,13 @@
1
+ # 萧何 / Xiao He 0.2.11
2
+
3
+ ## BUG 修复
4
+
5
+ 移除等待异常排空对作用域内 Job 终态观察者的依赖,修复等待服务先失败、随后 Agent/插件作用域卸载时,监听器先被解除导致原调用及卸载永久等待的问题。
6
+
7
+ 异常路径始终先等待原执行达到终态,保留原服务错误;之后按原 owner 查询确切 Job 的状态,最多进行 20 次、间隔 10 毫秒的程序侧清理检查。该有界窗口只等待宿主记录提交,不会放弃仍运行的 Handler、调用模型轮询或重试执行。服务持续不可用时保留原错误,记录可能延后由宿主生命周期清理。
8
+
9
+ ## 验证与边界
10
+
11
+ 新增真实 Cordis/ToolRuntime/LocalJobs 有界回归:等待失败后销毁作用域,原调用与卸载都能结束且 Job 清空。修复前该用例 4 秒超时。正常等待、先行移除、等待与清理故障继续回归。正式发布仍执行完整 CI 和同包门禁。
12
+
13
+ 兼容 DSH 0.2.0-rc.2,非商业源码公开许可。真实模型、GUI 和 PTC 完整链路未验收,不支持跨重启恢复;不安装或重启 DSH。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feng0531/dsh-execution-bus",
3
- "version": "0.2.10",
3
+ "version": "0.2.11",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "license": "SEE LICENSE IN LICENSE",