dsh-workplan 2.1.2 → 2.1.3
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 +21 -0
- package/README.en.md +2 -2
- package/README.md +2 -2
- package/README.zh.md +2 -2
- package/lib/host.js +2 -1
- package/lib/runtime.js +12 -1
- package/package.json +1 -1
- package/src/host.ts +4 -1
- package/src/runtime.ts +18 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
## 2.1.3 — 2026-11-06
|
|
2
|
+
|
|
3
|
+
**修复规划器超时复发的真正根因:把单次规划器调用的墙钟上限从写死的常量改成可配置项。**
|
|
4
|
+
|
|
5
|
+
### 问题
|
|
6
|
+
|
|
7
|
+
2.1.1 把规划器超时常量从 120 秒提到 300 秒,只是推迟了超时,没解决
|
|
8
|
+
「单次 LLM 调用被固定超时卡死」的结构性问题。复杂任务(长上下文 /
|
|
9
|
+
多子任务 JSON)仍会在 5 分钟处稳定触发超时,导致自动任务分解反复降级。
|
|
10
|
+
|
|
11
|
+
### 改了什么
|
|
12
|
+
|
|
13
|
+
新增 `DSH_WORKPLAN_PLANNER_TIMEOUT_MS` 环境变量(毫秒,>0),
|
|
14
|
+
未配置时回落到默认值 300000。复杂任务可按需放宽时限,无需重新编译发布。
|
|
15
|
+
|
|
16
|
+
### 安装
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install dsh-workplan@2.1.3
|
|
20
|
+
```
|
|
21
|
+
|
|
1
22
|
## 2.1.2 — 2026-11-06
|
|
2
23
|
|
|
3
24
|
**修复自动任务拆分「稳定超时被误报成意外中断」的问题:把规划器的思考时间上限从 2 分钟放宽到 5 分钟,并让真正超时时报出明确原因。**
|
package/README.en.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
> **Two selling points, one line: a full ISO/IEC 15408:2026 evidence pack you can verify with 5 commands, and a one-command install with zero runtime dependencies.**
|
|
4
4
|
|
|
5
5
|
[](https://github.com/abbaababa/dsh-workplan/actions/workflows/verify.yml)
|
|
6
|
-
[](https://github.com/abbaababa/dsh-workplan/releases/tag/v2.1.3)
|
|
7
7
|
|
|
8
8
|
Adds "plan first → dispatch real department subagents → watch progress in the sidebar" to **DeepSeek Harness (DSH)**. No app, no DSH source patch, no page replacement.
|
|
9
9
|
|
|
@@ -80,7 +80,7 @@ The full contract — roles, data shapes, state machine, recovery, and the three
|
|
|
80
80
|
## Install
|
|
81
81
|
|
|
82
82
|
```bash
|
|
83
|
-
dsh plugin --profile web add dsh-workplan@2.1.
|
|
83
|
+
dsh plugin --profile web add dsh-workplan@2.1.3
|
|
84
84
|
```
|
|
85
85
|
|
|
86
86
|
Restart the DSH Web process (or reload the page) so the bundle is picked up.
|
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
> **两个卖点,一句话:ISO/IEC 15408:2026 全套安全证据,5 条命令自己验;安装一条命令、零第三方运行时依赖。**
|
|
4
4
|
|
|
5
5
|
[](https://github.com/abbaababa/dsh-workplan/actions/workflows/verify.yml)
|
|
6
|
-
[](https://github.com/abbaababa/dsh-workplan/releases/tag/v2.1.3)
|
|
7
7
|
|
|
8
8
|
给 **DeepSeek Harness(DSH)** 加一段「先拆计划 → 真派部门子 Agent 去做 → 左侧栏实时看进度」的能力。不装 App、不改 DSH 源码、不换页面。
|
|
9
9
|
|
|
@@ -69,7 +69,7 @@ grep -RInE "child_process|execSync|eval\(|writeFileSync" src || echo "0 命中
|
|
|
69
69
|
## 一键安装
|
|
70
70
|
|
|
71
71
|
```bash
|
|
72
|
-
dsh plugin --profile web add dsh-workplan@2.1.
|
|
72
|
+
dsh plugin --profile web add dsh-workplan@2.1.3
|
|
73
73
|
```
|
|
74
74
|
|
|
75
75
|
装完**重启一次 DSH Web**(或重新载入当前页面)让插件生效。
|
package/README.zh.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
> **两个卖点,一句话:ISO/IEC 15408:2026 全套安全证据,5 条命令自己验;安装一条命令、零第三方运行时依赖。**
|
|
4
4
|
|
|
5
5
|
[](https://github.com/abbaababa/dsh-workplan/actions/workflows/verify.yml)
|
|
6
|
-
[](https://github.com/abbaababa/dsh-workplan/releases/tag/v2.1.3)
|
|
7
7
|
|
|
8
8
|
给 **DeepSeek Harness(DSH)** 加一段「先拆计划 → 真派部门子 Agent 去做 → 左侧栏实时看进度」的能力。不装 App、不改 DSH 源码、不换页面。
|
|
9
9
|
|
|
@@ -69,7 +69,7 @@ grep -RInE "child_process|execSync|eval\(|writeFileSync" src || echo "0 命中
|
|
|
69
69
|
## 一键安装
|
|
70
70
|
|
|
71
71
|
```bash
|
|
72
|
-
dsh plugin --profile web add dsh-workplan@2.1.
|
|
72
|
+
dsh plugin --profile web add dsh-workplan@2.1.3
|
|
73
73
|
```
|
|
74
74
|
|
|
75
75
|
装完**重启一次 DSH Web**(或重新载入当前页面)让插件生效。
|
package/lib/host.js
CHANGED
|
@@ -1229,6 +1229,7 @@ export function apply(ctx, config = {}) {
|
|
|
1229
1229
|
buildHash: LOADED_BUILD.buildHash,
|
|
1230
1230
|
},
|
|
1231
1231
|
cwd: typeof config.cwd === 'string' ? config.cwd : undefined,
|
|
1232
|
+
plannerTimeoutMs: numericSetting(config.plannerTimeoutMs, 'DSH_WORKPLAN_PLANNER_TIMEOUT_MS'),
|
|
1232
1233
|
childTimeoutMs: numericSetting(config.childTimeoutMs, 'DSH_WORKPLAN_CHILD_TIMEOUT_MS'),
|
|
1233
1234
|
idleTimeoutMs: numericSetting(config.idleTimeoutMs, 'DSH_WORKPLAN_IDLE_TIMEOUT_MS'),
|
|
1234
1235
|
totalTimeoutMs: numericSetting(config.totalTimeoutMs, 'DSH_WORKPLAN_TOTAL_TIMEOUT_MS'),
|
|
@@ -1363,7 +1364,7 @@ export function apply(ctx, config = {}) {
|
|
|
1363
1364
|
}
|
|
1364
1365
|
export const meta = {
|
|
1365
1366
|
name,
|
|
1366
|
-
version: '2.1.
|
|
1367
|
+
version: '2.1.3',
|
|
1367
1368
|
promptOrder: PROMPT_ORDER,
|
|
1368
1369
|
routes: ['/dsh-workplan/plans', '/dsh-workplan/vendor/chart.umd.js'],
|
|
1369
1370
|
};
|
package/lib/runtime.js
CHANGED
|
@@ -95,6 +95,15 @@ function readinessOf(record, snapshot) {
|
|
|
95
95
|
});
|
|
96
96
|
}
|
|
97
97
|
export const PLANNER_TIMEOUT_MS = 300000;
|
|
98
|
+
/**
|
|
99
|
+
* Wall-clock ceiling for ONE planner attempt (a single LLM stream).
|
|
100
|
+
*
|
|
101
|
+
* 2.1.1 把固定 120s 提到 300s,只是推迟了超时,没解决「单次调用被固定超时
|
|
102
|
+
* 卡死」的结构性问题。2.1.3 起改为可配置:DSH_WORKPLAN_PLANNER_TIMEOUT_MS
|
|
103
|
+
* (毫秒,>0),未配置时回落到这里的默认值。这样复杂任务可以按需放宽,
|
|
104
|
+
* 而不必改代码重新发布。
|
|
105
|
+
*/
|
|
106
|
+
export const PLANNER_IDLE_TIMEOUT_MS = 90000;
|
|
98
107
|
/**
|
|
99
108
|
* Absolute ceiling for one child execution.
|
|
100
109
|
*
|
|
@@ -367,6 +376,7 @@ function contextGuardStrict() {
|
|
|
367
376
|
}
|
|
368
377
|
async function runPlanner(ctx, options) {
|
|
369
378
|
const { taskText, cwd, sessionId, modelSelection, signal, conversationContext = '', budget = {}, sourceMessageIds = [] } = options;
|
|
379
|
+
const plannerTimeoutMs = Number(options.plannerTimeoutMs ?? PLANNER_TIMEOUT_MS);
|
|
370
380
|
let lastErrors = [];
|
|
371
381
|
for (let attempt = 1; attempt <= 2; attempt += 1) {
|
|
372
382
|
if (signal.aborted)
|
|
@@ -376,7 +386,7 @@ async function runPlanner(ctx, options) {
|
|
|
376
386
|
signal.addEventListener('abort', onAbort, { once: true });
|
|
377
387
|
const timeout = setTimeout(() => {
|
|
378
388
|
controller.abort(new PlanError('规划器超时', 'PLANNER_TIMEOUT'));
|
|
379
|
-
},
|
|
389
|
+
}, plannerTimeoutMs);
|
|
380
390
|
try {
|
|
381
391
|
let prompt = buildPlannerPrompt(taskText, cwd, conversationContext, budget);
|
|
382
392
|
if (lastErrors.length > 0) {
|
|
@@ -6277,6 +6287,7 @@ async function maybePlan(ctx, state, payload, downstream, options) {
|
|
|
6277
6287
|
sessionId: session.id,
|
|
6278
6288
|
modelSelection,
|
|
6279
6289
|
signal: payload.signal,
|
|
6290
|
+
plannerTimeoutMs: Number(options?.limits?.plannerTimeoutMs ?? options?.plannerTimeoutMs ?? PLANNER_TIMEOUT_MS),
|
|
6280
6291
|
conversationContext,
|
|
6281
6292
|
sourceMessageIds: human.map((message) => message.id).filter((id) => typeof id === 'string'),
|
|
6282
6293
|
/*
|
package/package.json
CHANGED
package/src/host.ts
CHANGED
|
@@ -169,6 +169,8 @@ function asObject(value: any) {
|
|
|
169
169
|
|
|
170
170
|
export type WorkplanConfig = {
|
|
171
171
|
cwd?: string
|
|
172
|
+
/** [2.1.3] 单次规划器调用上限(毫秒),亦可用 DSH_WORKPLAN_PLANNER_TIMEOUT_MS。 */
|
|
173
|
+
plannerTimeoutMs?: number
|
|
172
174
|
childTimeoutMs?: number
|
|
173
175
|
idleTimeoutMs?: number
|
|
174
176
|
totalTimeoutMs?: number
|
|
@@ -1341,6 +1343,7 @@ export function apply(ctx: any, config: WorkplanConfig = {}) {
|
|
|
1341
1343
|
buildHash: LOADED_BUILD.buildHash,
|
|
1342
1344
|
},
|
|
1343
1345
|
cwd: typeof config.cwd === 'string' ? config.cwd : undefined,
|
|
1346
|
+
plannerTimeoutMs: numericSetting(config.plannerTimeoutMs, 'DSH_WORKPLAN_PLANNER_TIMEOUT_MS'),
|
|
1344
1347
|
childTimeoutMs: numericSetting(config.childTimeoutMs, 'DSH_WORKPLAN_CHILD_TIMEOUT_MS'),
|
|
1345
1348
|
idleTimeoutMs: numericSetting(config.idleTimeoutMs, 'DSH_WORKPLAN_IDLE_TIMEOUT_MS'),
|
|
1346
1349
|
totalTimeoutMs: numericSetting(config.totalTimeoutMs, 'DSH_WORKPLAN_TOTAL_TIMEOUT_MS'),
|
|
@@ -1490,7 +1493,7 @@ export function apply(ctx: any, config: WorkplanConfig = {}) {
|
|
|
1490
1493
|
|
|
1491
1494
|
export const meta = {
|
|
1492
1495
|
name,
|
|
1493
|
-
version: '2.1.
|
|
1496
|
+
version: '2.1.3',
|
|
1494
1497
|
promptOrder: PROMPT_ORDER,
|
|
1495
1498
|
routes: ['/dsh-workplan/plans', '/dsh-workplan/vendor/chart.umd.js'],
|
|
1496
1499
|
}
|
package/src/runtime.ts
CHANGED
|
@@ -173,6 +173,15 @@ function readinessOf(record: any, snapshot?: any) {
|
|
|
173
173
|
}
|
|
174
174
|
|
|
175
175
|
export const PLANNER_TIMEOUT_MS = 300000
|
|
176
|
+
/**
|
|
177
|
+
* Wall-clock ceiling for ONE planner attempt (a single LLM stream).
|
|
178
|
+
*
|
|
179
|
+
* 2.1.1 把固定 120s 提到 300s,只是推迟了超时,没解决「单次调用被固定超时
|
|
180
|
+
* 卡死」的结构性问题。2.1.3 起改为可配置:DSH_WORKPLAN_PLANNER_TIMEOUT_MS
|
|
181
|
+
* (毫秒,>0),未配置时回落到这里的默认值。这样复杂任务可以按需放宽,
|
|
182
|
+
* 而不必改代码重新发布。
|
|
183
|
+
*/
|
|
184
|
+
export const PLANNER_IDLE_TIMEOUT_MS = 90000
|
|
176
185
|
/**
|
|
177
186
|
* Absolute ceiling for one child execution.
|
|
178
187
|
*
|
|
@@ -433,6 +442,7 @@ function contextGuardStrict() {
|
|
|
433
442
|
|
|
434
443
|
async function runPlanner(ctx: any, options: any) {
|
|
435
444
|
const { taskText, cwd, sessionId, modelSelection, signal, conversationContext = '', budget = {}, sourceMessageIds = [] } = options
|
|
445
|
+
const plannerTimeoutMs = Number(options.plannerTimeoutMs ?? PLANNER_TIMEOUT_MS)
|
|
436
446
|
let lastErrors: string[] = []
|
|
437
447
|
for (let attempt = 1; attempt <= 2; attempt += 1) {
|
|
438
448
|
if (signal.aborted) throw abortError()
|
|
@@ -441,7 +451,7 @@ async function runPlanner(ctx: any, options: any) {
|
|
|
441
451
|
signal.addEventListener('abort', onAbort, { once: true })
|
|
442
452
|
const timeout = setTimeout(() => {
|
|
443
453
|
controller.abort(new PlanError('规划器超时', 'PLANNER_TIMEOUT'))
|
|
444
|
-
},
|
|
454
|
+
}, plannerTimeoutMs)
|
|
445
455
|
try {
|
|
446
456
|
let prompt = buildPlannerPrompt(taskText, cwd, conversationContext, budget)
|
|
447
457
|
if (lastErrors.length > 0) {
|
|
@@ -2935,6 +2945,12 @@ function respondJson(res: any, status: any, payload: any) {
|
|
|
2935
2945
|
|
|
2936
2946
|
export type WorkplanRuntimeOptions = {
|
|
2937
2947
|
cwd?: string
|
|
2948
|
+
/**
|
|
2949
|
+
* [2.1.3] 单次规划器调用的墙钟上限(毫秒)。来自
|
|
2950
|
+
* `DSH_WORKPLAN_PLANNER_TIMEOUT_MS` 或显式配置;缺省回落到
|
|
2951
|
+
* `PLANNER_TIMEOUT_MS`。复杂任务(长上下文 / 多子任务 JSON)可按需放宽。
|
|
2952
|
+
*/
|
|
2953
|
+
plannerTimeoutMs?: number
|
|
2938
2954
|
/** Absolute ceiling per child execution, clamped by `normaliseChildTimeout`. */
|
|
2939
2955
|
childTimeoutMs?: number
|
|
2940
2956
|
/** No-progress window per child execution, clamped by `normaliseIdleTimeout`. */
|
|
@@ -6307,6 +6323,7 @@ async function maybePlan(ctx: any, state: any, payload: any, downstream: any, op
|
|
|
6307
6323
|
sessionId: session.id,
|
|
6308
6324
|
modelSelection,
|
|
6309
6325
|
signal: payload.signal,
|
|
6326
|
+
plannerTimeoutMs: Number(options?.limits?.plannerTimeoutMs ?? options?.plannerTimeoutMs ?? PLANNER_TIMEOUT_MS),
|
|
6310
6327
|
conversationContext,
|
|
6311
6328
|
sourceMessageIds: human.map((message: any) => message.id).filter((id: any) => typeof id === 'string'),
|
|
6312
6329
|
/*
|