dsh-workplan 2.2.9 → 2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-workplan",
3
- "version": "2.2.9",
3
+ "version": "2.3.2",
4
4
  "description": "Automatic task decomposition, real department subagents, and a responsive workplan dashboard for DeepSeek Harness.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/host.ts CHANGED
@@ -118,6 +118,12 @@ const PROMPT_SECTION = [
118
118
  * (上方 1.8.7/1.8.13 注释)全部保留,不删。
119
119
  */
120
120
  '7. 子任务的时间是「协商上限」+「安全兜底」,不是固定交付期限:规模参考 15 分钟量级(仅供参考、非承诺,实际时长由执行专家开工预告协商决定),整轮预算(默认 20 分钟)同样只是安全兜底,不是交付期限。子 Agent 接近上限时应先把已完成内容落盘并在结论里列出路径。任何「达到协商上限」「本轮预算用尽」都不等于「什么都没做」:状态里的 error 会列出「声明产物已在盘上」,必须先用文件核对;若产物已覆盖验收标准,用 dsh_workplan_update 复核改判,只补缺失部分再续跑,禁止无视盘上产物把整步重跑。确认需要更多时间时,主 Agent 可用 dsh_workplan_update 的 extendMs 协商放宽(放宽永远有界:累计超过初始协商上限的一倍即拒绝,转新轮续跑或转 escalate 请主 Agent/用户裁决)。',
121
+ /*
122
+ * [2.3.0][T1] 专家执行时间机制三条款(用户 2026-11-10 要求 1/2 的主 Agent 侧义务):
123
+ * 预估上报后必须转告用户;第 1 次超时必须放宽并告知专家(插件自动投递最新时限
124
+ * 与质量效率要求);第 2 次超时由主 Agent 接手,已完成部分只读保护、禁止丢弃。
125
+ */
126
+ '7a. [2.3.0] 专家时间机制:专家开工预告(timeNotice/【专家预估上报】通知)到达后,必须把该预估执行时间告知用户;专家第一次超时(【执行中断】通知与状态行 timeoutCount=1)时,必须用 extendMs 放宽——延期成功后插件自动把最新执行时限与「必须在保证工作质量的前提下高效率执行」告知专家,回执 childNotified=false 时用 dsh_workplan_followup 补发;同一子任务第二次超时(timeoutCount≥2,takeoverRequired=true)后不再重派专家,由主 Agent 直接接手:只继续 takeoverBrief.remainingOutputs 与未满足的验收,专家已完成产物已登记为只读保护(landedRefs 并入 artifacts,只增不减),禁止丢弃、禁止删除或覆盖、禁止整步重跑。',
121
127
  '8. 出现「待指示」项(closure=escalated,左侧栏显示「待指示」并附问题摘录)时,必须在当轮处理:用 dsh_workplan_instruct 下发决定(投递到子会话并把该行恢复为执行中),或确认放弃后用 dsh_workplan_update 置 blocked。不要沉默略过,也不要把待指示当成普通失败——它是一条还没被回答的请示,会一直占着交付门禁。',
122
128
  '9. 出现「已下发未响应」(ackOverdue)时,不要重复派发:先用 dsh_workplan_status 看该行 childId 与已等待时长,必要时用 dsh_workplan_followup 投递一次说明;超过硬超时仍未响应会记为 blocked(blockedKind=no-ack),可以再下发指示复活。',
123
129
  /*
@@ -233,6 +239,8 @@ function createUpdateTool(runtime: any) {
233
239
  + '把子任务标成 done 时,必须同时给出真实的 verification 与 acceptance(每项 result="pass"),'
234
240
  + '否则计划不会变成可交付状态(deliveryReady=false,present 会被拒绝)。'
235
241
  + '运行中的子任务需要更多时间时,传 extendMs(毫秒)即可协商放宽,不需要 force;放宽永远有界(累计 ≤ 初始协商上限 × 1),超出转新轮续跑或转 escalate 请主 Agent 裁决。'
242
+ + '[2.3.0] 延期成功后插件自动向执行中的专家投递最新执行时限与「保证质量、高效率执行」要求(回执 childNotified);'
243
+ + '同一子任务第二次超时自动置 takeoverRequired,由主 Agent 接手未完成部分,已完成产物只读保护、禁止丢弃。'
236
244
  + '这些字段会写入会话日志,刷新/重启后仍然生效。',
237
245
  parameters: {
238
246
  type: 'object',
@@ -333,7 +341,8 @@ function createUpdateTool(runtime: any) {
333
341
  type: 'integer',
334
342
  description: '延期毫秒数(正整数,仅主 Agent 可用):只推移本子任务的协商截止并重置计时,'
335
343
  + '不改状态判定;运行中可用,不需要 force。除非另传 status,否则可省略 status。'
336
- + '放宽永远有界:累计延期 ≤ 初始协商上限的一倍,超出会被拒绝并提示转新轮续跑或转 escalate 请主 Agent 裁决。',
344
+ + '放宽永远有界:累计延期 ≤ 初始协商上限的一倍,超出会被拒绝并提示转新轮续跑或转 escalate 请主 Agent 裁决。'
345
+ + '[2.3.0] 延期成功后插件自动告知专家最新执行时限(含保证质量、高效率执行要求);每次超时计一行内 timeoutCount,第二次触发 takeoverRequired(主 Agent 接手,已完成部分只读保护)。',
337
346
  },
338
347
  /*
339
348
  * [2.2.0][T5/O-4c] O-2a 专家开工预告:{declaredMinutes, reason}。与 extendMs
@@ -341,7 +350,8 @@ function createUpdateTool(runtime: any) {
341
350
  */
342
351
  timeNotice: {
343
352
  type: 'object',
344
- description: '专家开工预告(O-2a):{ declaredMinutes, reason },只记入协商流水,不改状态与判定。',
353
+ description: '专家开工预告(O-2a):{ declaredMinutes, reason },只记入协商流水,不改状态与判定。'
354
+ + '[2.3.0] 落档后插件立即向主会话推送【专家预估上报】通知,提醒主 Agent 把该预期执行时间告知用户。',
345
355
  properties: {
346
356
  declaredMinutes: { type: 'number', description: '预计完成本子任务的分钟数(仅供参考、非承诺)。' },
347
357
  reason: { type: 'string', description: '预告理由(可选)。' },
@@ -1571,7 +1581,7 @@ export function apply(ctx: any, config: WorkplanConfig = {}) {
1571
1581
 
1572
1582
  export const meta = {
1573
1583
  name,
1574
- version: '2.2.9',
1584
+ version: '2.3.2',
1575
1585
  promptOrder: PROMPT_ORDER,
1576
1586
  routes: ['/dsh-workplan/plans', '/dsh-workplan/vendor/chart.umd.js'],
1577
1587
  }
package/src/plan.ts CHANGED
@@ -251,10 +251,45 @@ export function truncate(value: any, max: any) {
251
251
 
252
252
  export function messageText(message: any) {
253
253
  if (!message || !Array.isArray(message.content)) return ''
254
- return message.content
254
+ const texts = message.content
255
255
  .filter((block: any) => block && block.type === 'text' && typeof block.text === 'string')
256
256
  .map((block: any) => block.text)
257
- .join('\n')
257
+ /*
258
+ * [2.3.1][D1] 附件事实渲染(用户 2026-11-10 点名的严重缺陷:规划器与 fresh
259
+ * 子 Agent 看不见用户图片)。
260
+ *
261
+ * 旧实现只收 text 块:image/file 块的 attachment 元数据(attachmentId/名称/
262
+ * 尺寸)在到达规划器 taskText 之前就被整块丢弃,专家被迫 escalate 请示
263
+ * 「截图在哪」,往返吃掉整段时间预算(wp-73bb2cd4 事故实证:修复主链 8 分钟、
264
+ * 往返 17 分钟)。
265
+ *
266
+ * 现在把附件渲染成一行标注并入文本面,taskText→taskAnchor→派发锚点块→回放
267
+ * 上下文全部同源受益;标注含 attachment-id(官方读图工具接受该 id 作为
268
+ * path),接收方可直接读取,不再靠猜。
269
+ * 消费方安全审计(2026-11-10):plan/result/cancel/update 四类 marker 解析
270
+ * 消息永不含图片块;replan/supersede 为用户消息子串匹配,附加行零误伤。
271
+ */
272
+ const notes = message.content
273
+ .filter((block: any) => block && (block.type === 'image' || block.type === 'file' || block.type === 'document') && (block.attachment ?? block.file))
274
+ .map((block: any) => renderAttachmentNote(block))
275
+ .filter((line: string) => line !== '')
276
+ if (notes.length === 0) return texts.join('\n')
277
+ return [...texts, ...notes].join('\n')
278
+ }
279
+
280
+ /** [2.3.1][D1] 单个附件块的只读标注行;元数据缺失时返回空串(不泄漏、不猜测)。 */
281
+ function renderAttachmentNote(block: any) {
282
+ const att = block.attachment ?? block.file ?? {}
283
+ const id = typeof att.attachmentId === 'string' ? att.attachmentId : ''
284
+ const name = typeof att.name === 'string' ? att.name : (typeof att.filename === 'string' ? att.filename : '')
285
+ if (!id && !name) return ''
286
+ const media = typeof att.mediaType === 'string' ? att.mediaType : ''
287
+ const size = Number.isFinite(Number(att.width)) && Number.isFinite(Number(att.height))
288
+ ? `|${String(att.width)}x${String(att.height)}` : ''
289
+ return `[用户附件] ${block.type === 'image' ? '图片' : '文件'} "${name || '未命名'}"`
290
+ + (media ? `|mediaType=${media}` : '') + size
291
+ + (id ? `|attachment-id: ${id}` : '')
292
+ + '|如需其内容:把 attachment-id 作为 path 传给可用的读图/视觉工具直接读取,禁止凭空猜测附件内容。'
258
293
  }
259
294
 
260
295
  /*
@@ -1040,12 +1075,37 @@ export function flattenSubtasks(plan: any): Array<{ stage: any; subtask: any }>
1040
1075
  * 规划器返回的 JSON 常见三类损伤:少一个 `}`、多一个尾逗号、字符串里有裸换行。
1041
1076
  * 旧实现直接 JSON.parse,一个字符之差就抛 INVALID_JSON,整个计划降级。
1042
1077
  * 这里做的是纯结构修复:配对括号、去掉尾逗号、把字符串里的裸控制符转义。
1078
+ *
1079
+ * [2.3.2][D2-P0] D2 现场(qwen3.8-flash INVALID_JSON ×3、86.9 秒白烧)实测穿透的
1080
+ * 三类损伤——成员间漏逗号、字符串外全角标点、多余闭合括号——在同一趟扫描内补齐。
1081
+ * 旧实现只「补」不「插/删/归一」,这三类必然失败后靠全量重掷碰运气。三条新规则
1082
+ * 全部满足「只修结构、绝不碰内容」红线:
1083
+ * 1. 插逗号:容器内(栈非空)值结束符(`"`/`}`/`]`/数字/true|false|null)之后
1084
+ * 紧邻下一个起点 token 且无分隔符 → 插入 `,`;深度 0 不插(不吞多对象文档);
1085
+ * 2. 归一半角:仅字符串外 `,`→`,`、`:`→`:`、`“`/`”`→`"`;字符串内一字不动;
1086
+ * 3. 删多余闭合:栈已空时出现的 `}`/`]` 直接丢弃(旧实现原样保留 → 必解析失败)。
1043
1087
  * 绝不猜测、绝不编造任何字段或值——修不好就照旧抛错。
1044
1088
  */
1045
1089
  export function repairJsonStructure(input: string): string {
1046
1090
  const stack: string[] = []
1047
1091
  let inString = false
1048
1092
  let escaped = false
1093
+ // [2.3.2] afterValue = 上一个字符串外记号是「完整值收尾」(闭合引号/闭合括号/裸 token 结束)。
1094
+ let afterValue = false
1095
+ // [2.3.2] inToken = 正在读数字或 true/false/null 这类裸 token(须等它结束才可能插逗号)。
1096
+ let inToken = false
1097
+ // [2.3.2] 字符串定界样式:全角引号开的字符串须由 `”`(或半角 `"`)闭合,
1098
+ // 否则 `{“a”:1}` 的 `”` 会被当作字符串内容吞掉;半角字符串不受影响。
1099
+ let stringUnicode = false
1100
+ const isTokenChar = (ch: string) =>
1101
+ (ch >= '0' && ch <= '9')
1102
+ || (ch >= 'a' && ch <= 'z')
1103
+ || (ch >= 'A' && ch <= 'Z')
1104
+ || ch === '.' || ch === '+' || ch === '-'
1105
+ const separatorBefore = () => {
1106
+ // 只在「值收尾 → 新值起点」且确有容器时才插逗号;键后接冒号、值后接闭合都不走这里。
1107
+ if (afterValue && stack.length > 0) out += ','
1108
+ }
1049
1109
  let out = ''
1050
1110
  for (let i = 0; i < input.length; i += 1) {
1051
1111
  const ch = input[i] as string
@@ -1060,9 +1120,10 @@ export function repairJsonStructure(input: string): string {
1060
1120
  escaped = true
1061
1121
  continue
1062
1122
  }
1063
- if (ch === '"') {
1123
+ if (ch === '"' || (stringUnicode && ch === '”')) {
1064
1124
  inString = false
1065
- out += ch
1125
+ afterValue = true
1126
+ out += '"'
1066
1127
  continue
1067
1128
  }
1068
1129
  if (ch === '\n') {
@@ -1084,23 +1145,66 @@ export function repairJsonStructure(input: string): string {
1084
1145
  out += ch
1085
1146
  continue
1086
1147
  }
1148
+ if (inToken && !isTokenChar(ch)) {
1149
+ inToken = false
1150
+ afterValue = true
1151
+ }
1087
1152
  if (ch === '"') {
1153
+ separatorBefore()
1088
1154
  inString = true
1155
+ stringUnicode = false
1156
+ afterValue = false
1089
1157
  out += ch
1090
1158
  continue
1091
1159
  }
1160
+ // [2.3.2] 全角引号 → 半角双引号开字符串(仅字符串外;归一只动标点不动内容)。
1161
+ if (ch === '“' || ch === '”' || ch === '"') {
1162
+ separatorBefore()
1163
+ inString = true
1164
+ stringUnicode = true
1165
+ afterValue = false
1166
+ out += '"'
1167
+ continue
1168
+ }
1092
1169
  if (ch === '{' || ch === '[') {
1170
+ separatorBefore()
1093
1171
  stack.push(ch)
1172
+ afterValue = false
1094
1173
  out += ch
1095
1174
  continue
1096
1175
  }
1097
1176
  if (ch === '}' || ch === ']') {
1177
+ // [2.3.2] 规则 3:栈空 = 这个闭合符在语法上无处安放,丢弃(旧实现保留 → E 类穿透)。
1178
+ if (stack.length === 0) {
1179
+ afterValue = true
1180
+ continue
1181
+ }
1098
1182
  const want = ch === '}' ? '{' : '['
1099
1183
  while (stack.length > 0 && stack[stack.length - 1] !== want) {
1100
1184
  out += stack.pop() === '{' ? '}' : ']'
1101
1185
  }
1102
1186
  if (stack.length > 0) stack.pop()
1103
1187
  out += ch
1188
+ afterValue = true
1189
+ continue
1190
+ }
1191
+ if (ch === ',' || ch === ',') {
1192
+ // [2.3.2] 规则 2:字符串外全角逗号归一为半角。
1193
+ out += ','
1194
+ afterValue = false
1195
+ continue
1196
+ }
1197
+ if (ch === ':' || ch === ':') {
1198
+ // [2.3.2] 规则 2:字符串外全角冒号归一为半角;键后的冒号不是「新值起点」,不插逗号。
1199
+ out += ':'
1200
+ afterValue = false
1201
+ continue
1202
+ }
1203
+ if (isTokenChar(ch)) {
1204
+ separatorBefore()
1205
+ inToken = true
1206
+ afterValue = false
1207
+ out += ch
1104
1208
  continue
1105
1209
  }
1106
1210
  out += ch
@@ -1111,7 +1215,41 @@ export function repairJsonStructure(input: string): string {
1111
1215
  }
1112
1216
 
1113
1217
  function stripTrailingCommas(input: string): string {
1114
- return input.replace(/,(\s*[}\]])/g, '$1')
1218
+ /*
1219
+ * [2.3.2][D2-QA-1 修复] 字符串边界感知的尾逗号删除(T3 审查红线发现)。
1220
+ *
1221
+ * 旧实现正则 /,(\s*[}\]])/g 不感知字符串边界,会吃掉字符串值内部的
1222
+ * 「半角逗号+空白+闭括号」——`{"note":"p, } q"}` 被改成 `"p } q"`,是值
1223
+ * 篡改(缺陷自 2.1.0 既有,本补丁 P0 扩能后其可达面被扩大;T3 探针
1224
+ * TAMPER-3 实锤并定性为既有)。现在只有字符串外的逗号才会被删,
1225
+ * 与旧语义一致(只删逗号、保留其间空白与闭括号)。
1226
+ */
1227
+ let inString = false
1228
+ let escaped = false
1229
+ let out = ''
1230
+ for (let i = 0; i < input.length; i += 1) {
1231
+ const ch = input[i] as string
1232
+ if (inString) {
1233
+ out += ch
1234
+ if (escaped) escaped = false
1235
+ else if (ch === '\\') escaped = true
1236
+ else if (ch === '"') inString = false
1237
+ continue
1238
+ }
1239
+ if (ch === '"') {
1240
+ inString = true
1241
+ out += ch
1242
+ continue
1243
+ }
1244
+ if (ch === ',') {
1245
+ let j = i + 1
1246
+ while (j < input.length && (input[j] as string).trim() === '') j += 1
1247
+ const next = input[j]
1248
+ if (next === '}' || next === ']') continue
1249
+ }
1250
+ out += ch
1251
+ }
1252
+ return out
1115
1253
  }
1116
1254
 
1117
1255
  /** 找到最后一个「成员边界」逗号(在任何嵌套深度上、且不在字符串内)。 */
@@ -1147,6 +1285,25 @@ function* truncatedCandidates(input: string, rounds = 24): Generator<string> {
1147
1285
  }
1148
1286
  }
1149
1287
 
1288
+ /**
1289
+ * [2.3.2][D2-P1] 定向位置反馈:旧实现回喂只有「末尾 120 字符」,断点在 6KB 文档
1290
+ * 中部时模型依然盲,只能整段重掷(×3 ≈86.9 秒白烧的机制根因之一)。V8 对长输入的
1291
+ * 解析错误带 `at position N`,这里据此从候选文本切出断点 ±60 字符原文随错误一并
1292
+ * 回喂(runtime 的 lastErrors 直接透传该 message),让下一次请求是「定向修复」而
1293
+ * 非「盲目重生成」。短输入的新式消息本身已带上下文,正则不中则原样返回。
1294
+ */
1295
+ function parseFailureHint(candidate: string, error: unknown): string {
1296
+ const message = error instanceof Error ? error.message : String(error)
1297
+ const match = /at position (\d+)/.exec(message)
1298
+ if (!match) return ''
1299
+ const position = Math.min(Number(match[1]), candidate.length)
1300
+ const from = Math.max(0, position - 60)
1301
+ const to = Math.min(candidate.length, position + 60)
1302
+ const snippet = candidate.slice(from, to).replace(/\s+/g, ' ')
1303
+ return `;错误位置 ${position},断点附近原文(字符 ${from}-${to}):${JSON.stringify(snippet)}`
1304
+ + '——请只修复该处 JSON 语法后重新输出完整对象,不得改动任何字段值'
1305
+ }
1306
+
1150
1307
  export function extractJson(text: any) {
1151
1308
  if (typeof text !== 'string' || text.trim() === '') {
1152
1309
  throw new PlanError('规划器没有返回内容', 'EMPTY_OUTPUT')
@@ -1168,7 +1325,7 @@ export function extractJson(text: any) {
1168
1325
  const repaired = repairJsonStructure(candidate)
1169
1326
  try {
1170
1327
  const value2 = JSON.parse(repaired)
1171
- console.warn('[dsh-workplan] 规划器 JSON 结构已修复(只补括号/逗号,未改内容)')
1328
+ console.warn('[dsh-workplan] 规划器 JSON 结构已修复(只动括号/逗号/字符串外全角标点,未改内容)')
1172
1329
  return value2
1173
1330
  } catch {
1174
1331
  for (const attempt of truncatedCandidates(repaired)) {
@@ -1181,7 +1338,8 @@ export function extractJson(text: any) {
1181
1338
  }
1182
1339
  }
1183
1340
  }
1184
- throw new PlanError(`规划器返回的 JSON 无法解析:${error instanceof Error ? error.message : String(error)}`, 'INVALID_JSON')
1341
+ // [2.3.2][D2-P1] 抛出前附断点原文切片:重试请求据此定向修复,不再盲掷全文。
1342
+ throw new PlanError(`规划器返回的 JSON 无法解析:${error instanceof Error ? error.message : String(error)}${parseFailureHint(candidate, error)}`, 'INVALID_JSON')
1185
1343
  }
1186
1344
  }
1187
1345
 
@@ -1260,6 +1418,8 @@ export function buildPlannerPrompt(taskText: any, cwd: any, conversationContext:
1260
1418
  '- 子任务必须可独立执行、可验收;不要为了凑数拆无意义任务。',
1261
1419
  '- 子任务由子 Agent 独立执行:它们没有派发权限、不能重启服务、不能安装或升级依赖。禁止把「调用 dsh_workplan_dispatch」「重启/停止 dsh web」「安装或升级插件」这类只有主 Agent 才能执行的动作写进子任务;确实需要时,写成“给出结论或建议,由主 Agent 执行”。',
1262
1420
  '- 单个子任务无须在 10 分钟内完成——10 分钟只是拆步规模建议,不是完成期限、也不构成承诺;实际时长由执行专家开工预告协商决定,不设固定完成时间;动手重的任务要拆成多个小步,避免整条计划被一个慢子任务拖住。',
1421
+ // [2.3.2][D2-P2] 半角/逗号/括号自检硬约束:与解析层兜底(P0)互为防线,中文模型全角标点高发。
1422
+ '- JSON 只允许半角标点(, : " { } [ ]);对象与数组的相邻成员之间必须有逗号;输出前自检括号成对、每个字符串以半角"闭合。',
1263
1423
  '- 不要输出 Markdown 代码围栏、解释或前后缀;只输出一个 JSON 对象。',
1264
1424
  '',
1265
1425
  '本轮时间预算(硬事实,请据此规划规模):',
@@ -4678,6 +4838,16 @@ export function resetBlockedStatuses(statuses: any) {
4678
4838
  * (给出指示改判 instructed,或明确放弃改判 blocked)后才离开这个状态。
4679
4839
  */
4680
4840
  if (item?.closure === 'escalated' || item?.closure === 'instructed') continue
4841
+ /*
4842
+ * [2.3.0][T1] 二次超时 = 主 Agent 接手,不再把专家重派一遍。
4843
+ *
4844
+ * 用户要求 2:预估时间超时两次后由主 Agent 接手尚未完成的事,且禁止丢弃
4845
+ * 专家已完成部分。若续跑把这行重置为 pending 重派,等于让新专家从零重做、
4846
+ * 绕开 takeoverBrief 的只读保护——这里直接跳过:行保持 blocked,
4847
+ * takeoverRequired/takeoverBrief/artifacts 保护登记原样保留,由主 Agent
4848
+ * 用 dsh_workplan_update 复核改判(只补缺口)或人工裁决后离开该状态。
4849
+ */
4850
+ if (item?.takeoverRequired === true) continue
4681
4851
  next = applyStatus(next, item.subtaskId, {
4682
4852
  status: 'pending',
4683
4853
  progress: 0,
@@ -4991,6 +5161,16 @@ export function buildChildPrompt({
4991
5161
  : []),
4992
5162
  // [T3 扩展点·T6] 供 T6 在此行之后追加「完成即时通知」条款(O-1a 插件兜底通道语义);上方三条款为 O-1a①+O-2a+O-4a 合并协议段(矩阵 Z1),既有条款不得删改。
4993
5163
  // [2.2.0][T6/O-1a] 完成即时通知条款(插件兜底通道):完成即报是第一通道(见上方「完成即回报」);插件另设兜底——子任务结算成功后立即向主会话推送一条含子任务 ID、摘要、验收计数与用时的即时通知,不等待整轮结束。兜底不替代主动回报。
5164
+ /*
5165
+ * [2.3.0][T1] 超时放宽告知与二次超时接手条款(用户 2026-11-10 要求 1/2):
5166
+ * 预告会由插件自动转告主 Agent「请把预期时间告知用户」;超时后主 Agent
5167
+ * 放宽时插件会把最新执行时限推送给你;连续两次超时改由主 Agent 接手,
5168
+ * 因此专家任何时候都要把已完成内容及时落盘并在回报中列路径——已完成部分
5169
+ * 会被登记为只读保护,禁止被丢弃。以下既有条款零删改。
5170
+ */
5171
+ '- 预估上报会被插件即时转告主 Agent(含「请把此预期执行时间告知用户」提示),主 Agent 会把你报的预估时间告知用户,让双方都有准备。',
5172
+ '- 超时后主 Agent 放宽时,插件会向你的会话推送【延期告知】:内含最新执行时间与剩余余量,并要求你在保证工作质量的前提下高效率执行——收到通知继续当前工作,不要重新开始;已完成内容及时落盘。',
5173
+ '- 连续两次超时后本行转为「主 Agent 接手」(takeoverRequired):你已完成的产物会被登记为只读保护(禁止丢弃),主 Agent 只继续未完成部分;所以每个阶段都要及时落盘并在回报中列出已完成路径。',
4994
5174
  '',
4995
5175
  '遇阻上报(强制,先于继续动作):',
4996
5176
  '- 出现以下任一情况,第一动作是上报,不是猜测、绕过或静默继续:缺少权限/输入/依赖产物;需求自相矛盾;无法验证;同一命令连续两次失败;需要主 Agent 决定方向。',