dsh-foreman 0.3.1 → 0.3.2
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/CHANGELOG.md +14 -0
- package/lib/index.js +16 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,20 @@
|
|
|
6
6
|
|
|
7
7
|
本项目自己的版本从 `0.1.0` 开始。
|
|
8
8
|
|
|
9
|
+
## 0.3.2 — 2026-11-08
|
|
10
|
+
|
|
11
|
+
### 修复:派单文本没有说要回报
|
|
12
|
+
|
|
13
|
+
真机上一次派单,设备做了 30 步、写完整答案,**一次都没调用 `foreman_report`**——因为派单文本里
|
|
14
|
+
根本没提这件事。设备收到的只有标题、请求原文和附件说明,模型自然当成普通任务做完就停,
|
|
15
|
+
hub 于是永远停在 `running`。
|
|
16
|
+
|
|
17
|
+
现在每张派单的末尾都有一段:`foreman_report` 是结果到达问话人的唯一途径,答在对话里
|
|
18
|
+
不算完成,**没回报就不算做完**。
|
|
19
|
+
|
|
20
|
+
配套地,设备侧 `dsh-foreman-node@0.2.1` 加了一层兜底:一轮结束而还没回报时自动补一条
|
|
21
|
+
`ready`。两层一起,模型照做时走正路,不照做也不会让工单挂死。
|
|
22
|
+
|
|
9
23
|
## 0.3.1 — 2026-11-08
|
|
10
24
|
|
|
11
25
|
### 修复:同一 id 的两个连接互相踢,设备永远上不了线
|
package/lib/index.js
CHANGED
|
@@ -9622,6 +9622,20 @@ function attachmentSection(names) {
|
|
|
9622
9622
|
*
|
|
9623
9623
|
* @throws When the attachments together exceed the frame budget: a truncated task would be worse than a refused one.
|
|
9624
9624
|
*/
|
|
9625
|
+
/**
|
|
9626
|
+
* What a device is told about reporting, appended to every assignment.
|
|
9627
|
+
*
|
|
9628
|
+
* Without it the job Session simply answers and stops: on a real deployment a device did thirty steps of real work,
|
|
9629
|
+
* wrote a complete answer, and never called `foreman_report`, so the hub sat at `running` with no report forever and
|
|
9630
|
+
* a person saw a job that never finished. The tool exists, but nothing told the model it was required or final.
|
|
9631
|
+
*/
|
|
9632
|
+
const REPORT_SECTION = [
|
|
9633
|
+
"\n## Reporting back\n",
|
|
9634
|
+
"\nWhen you have finished, call `foreman_report` — that tool is how this job reaches the person who asked, and ",
|
|
9635
|
+
"answering in chat does not reach them. Report `ready` with a one-sentence summary of the result, or `blocked` with ",
|
|
9636
|
+
"the one question only they can answer, or `failed` if the work cannot be done. The job is not finished until you ",
|
|
9637
|
+
"have reported.\n"
|
|
9638
|
+
].join("");
|
|
9625
9639
|
function renderForDevice(input) {
|
|
9626
9640
|
const { ticket, trigger } = input;
|
|
9627
9641
|
const refs = refsOf(trigger);
|
|
@@ -9645,7 +9659,8 @@ function renderForDevice(input) {
|
|
|
9645
9659
|
`# ${ticket.title}`,
|
|
9646
9660
|
scope === "" ? "" : `\n${scope}\n`,
|
|
9647
9661
|
request === "" ? "" : `\n## The request as it was written\n\n${request}\n`,
|
|
9648
|
-
attachmentSection(attachments.map((attachment) => attachment.name ?? attachment.id))
|
|
9662
|
+
attachmentSection(attachments.map((attachment) => attachment.name ?? attachment.id)),
|
|
9663
|
+
REPORT_SECTION
|
|
9649
9664
|
].filter((section) => section !== "").join(""),
|
|
9650
9665
|
attachments
|
|
9651
9666
|
};
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "dsh-foreman",
|
|
3
3
|
"author": "niechao136",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "0.3.
|
|
5
|
+
"version": "0.3.2",
|
|
6
6
|
"description": "dsh-foreman:主 loop 在多设备上派单的 DSH bundle:需求来自本机操作者的主会话而不是 GitHub/飞书,每个工作区各有一条主会话,主会话只负责路由,真正的活儿派给 Worker 在该工作区目录里执行。",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "lib/index.js",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
},
|
|
63
63
|
"packageManager": "pnpm@11.7.0",
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"dsh-foreman-node": "0.2.
|
|
65
|
+
"dsh-foreman-node": "0.2.1",
|
|
66
66
|
"proper-lockfile": "4.1.2",
|
|
67
67
|
"ws": "8.22.0",
|
|
68
68
|
"zod": "4.4.3"
|