dsh-mcmp 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/lib/index.js +10 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -517,6 +517,9 @@ export function apply(ctx) {
|
|
|
517
517
|
state.phase = 'S8 兜底·论文定稿'
|
|
518
518
|
state.agentLabel = 'S8 兜底·论文定稿'
|
|
519
519
|
const fresh = makeController()
|
|
520
|
+
// 关键:把兜底定稿的控制器登记为当前活跃控制器,
|
|
521
|
+
// 否则面板「中止」与 /loopabort 只会 abort 已失效的主控制器,兜底定稿无法被中止
|
|
522
|
+
if (active && active.runId === runId) active.controller = fresh
|
|
520
523
|
const reason = stopReason === 'cancelled' ? '用户中止' : stopReason === 'error' ? errorMsg : '正常流程已结束但定稿步骤未完成'
|
|
521
524
|
const fres = await runChild(provider, session, agent, fresh, '兜底·论文定稿(不论成败)', buildFinalizePrompt(args, reason))
|
|
522
525
|
if (fres.outcome === 'completed') {
|
|
@@ -524,7 +527,13 @@ export function apply(ctx) {
|
|
|
524
527
|
pushLog('兜底定稿完成: 论文定稿.md 已生成')
|
|
525
528
|
} else {
|
|
526
529
|
pushLog('兜底定稿未能完成: ' + (fres.text || '').trim().slice(0, 80) + ' —— 请查看工作区已有成果')
|
|
527
|
-
if (
|
|
530
|
+
if (fres.outcome === 'cancelled') {
|
|
531
|
+
stopReason = 'cancelled'
|
|
532
|
+
errorMsg = '已被用户中止(兜底定稿未完成)'
|
|
533
|
+
} else if (stopReason === 'completed') {
|
|
534
|
+
stopReason = 'error'
|
|
535
|
+
errorMsg = '流水线迭代已完成,但兜底定稿生成失败'
|
|
536
|
+
}
|
|
528
537
|
}
|
|
529
538
|
}
|
|
530
539
|
finishRun(runId, stopReason, errorMsg)
|
package/package.json
CHANGED