conversation-session-dynamic-workflow-gray-always-on-notify.json 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-dynamic-workflow-gray-always-on-notify",
  4. "spec": "./test/e2e/conversation-session/workflows/conversation-session-dynamic-workflow-gray-always-on-notify.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "dwn-title",
  8. "metadata": {
  9. "kind": "common",
  10. "source": "synthetic",
  11. "timingPolicy": "fast-text",
  12. "syntheticReason": "固定 Skill/CreateWorkflow 与通知回复的模型选择;真实工作流编译、审批、运行、world.run 文件闸、完成/出错通知的铸造与投递由 Agent 执行。"
  13. },
  14. "match": {
  15. "method": "POST",
  16. "pathIncludes": "/messages",
  17. "bodyIncludes": ["Generate a concise title", "E2E_DWN_"]
  18. },
  19. "response": {
  20. "statusCode": 200,
  21. "text": "{\"title\":\"工作流通知 E2E\"}"
  22. }
  23. },
  24. {
  25. "id": "dwn-ok-notified",
  26. "metadata": {
  27. "kind": "main",
  28. "source": "synthetic",
  29. "timingPolicy": "fast-text",
  30. "syntheticReason": "固定 Skill/CreateWorkflow 与通知回复的模型选择;真实工作流编译、审批、运行、world.run 文件闸、完成/出错通知的铸造与投递由 Agent 执行。"
  31. },
  32. "match": {
  33. "method": "POST",
  34. "pathIncludes": "/messages",
  35. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  36. "lastUserMessageIncludes": ["<task-notification>", "E2E_DWN_OK_RESULT"]
  37. },
  38. "response": {
  39. "statusCode": 200,
  40. "text": "E2E_DWN_OK_DIGESTED 工作流已完成:三个文件都检查过了。"
  41. }
  42. },
  43. {
  44. "id": "dwn-fail-notified",
  45. "metadata": {
  46. "kind": "main",
  47. "source": "synthetic",
  48. "timingPolicy": "fast-text",
  49. "syntheticReason": "固定 Skill/CreateWorkflow 与通知回复的模型选择;真实工作流编译、审批、运行、world.run 文件闸、完成/出错通知的铸造与投递由 Agent 执行。"
  50. },
  51. "match": {
  52. "method": "POST",
  53. "pathIncludes": "/messages",
  54. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  55. "lastUserMessageIncludes": ["<task-notification>", "E2E_DWN_FAIL_BOOM"]
  56. },
  57. "response": {
  58. "statusCode": 200,
  59. "text": "E2E_DWN_FAIL_DIGESTED 工作流出错:清单缺失,需要修脚本。"
  60. }
  61. },
  62. {
  63. "id": "dwn-busy-notified",
  64. "metadata": {
  65. "kind": "main",
  66. "source": "synthetic",
  67. "timingPolicy": "fast-text",
  68. "syntheticReason": "固定 Skill/CreateWorkflow 与通知回复的模型选择;真实工作流编译、审批、运行、world.run 文件闸、完成/出错通知的铸造与投递由 Agent 执行。"
  69. },
  70. "match": {
  71. "method": "POST",
  72. "pathIncludes": "/messages",
  73. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  74. "lastUserMessageIncludes": ["<task-notification>", "E2E_DWN_BUSY_RESULT"]
  75. },
  76. "response": {
  77. "statusCode": 200,
  78. "text": "E2E_DWN_BUSY_DIGESTED 忙碌期间结束的工作流已完成。"
  79. }
  80. },
  81. {
  82. "id": "dwn-busy-hold",
  83. "metadata": {
  84. "kind": "main",
  85. "source": "synthetic",
  86. "timingPolicy": "controlled-stream",
  87. "syntheticReason": "忙碌窗口需要主代理的一轮停在流中途,让 run 在这一轮进行中结束;由用例在断言后放行,不改变产品时序。"
  88. },
  89. "maxMatches": 1,
  90. "match": {
  91. "method": "POST",
  92. "pathIncludes": "/messages",
  93. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  94. "lastUserMessageIncludes": ["E2E_DWN_BUSY_HOLD"]
  95. },
  96. "response": {
  97. "statusCode": 200,
  98. "statusMessage": "OK",
  99. "headers": {
  100. "cache-control": "no-cache",
  101. "content-type": "text/event-stream; charset=utf-8"
  102. },
  103. "releaseAfterChunks": 3,
  104. "chunks": [
  105. {
  106. "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-dwn-busy-hold\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":120,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":0,\"service_tier\":\"standard\"}}}\n\n",
  107. "offsetMs": 0
  108. },
  109. {
  110. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n",
  111. "offsetMs": 0
  112. },
  113. {
  114. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"E2E_DWN_BUSY_\"}}\n\n",
  115. "offsetMs": 0
  116. },
  117. {
  118. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"HELD 这一轮答完了。\"}}\n\n",
  119. "offsetMs": 0
  120. },
  121. {
  122. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n",
  123. "offsetMs": 0
  124. },
  125. {
  126. "text": "event: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":120,\"output_tokens\":12,\"service_tier\":\"standard\"}}\n\n",
  127. "offsetMs": 0
  128. },
  129. {
  130. "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n",
  131. "offsetMs": 0
  132. }
  133. ]
  134. }
  135. },
  136. {
  137. "id": "dwn-ok-skill",
  138. "metadata": {
  139. "kind": "main",
  140. "source": "synthetic",
  141. "timingPolicy": "fast-text",
  142. "syntheticReason": "固定 Skill/CreateWorkflow 与通知回复的模型选择;真实工作流编译、审批、运行、world.run 文件闸、完成/出错通知的铸造与投递由 Agent 执行。"
  143. },
  144. "maxMatches": 1,
  145. "match": {
  146. "method": "POST",
  147. "pathIncludes": "/messages",
  148. "bodyExcludes": [
  149. "Generate a concise title",
  150. "CRITICAL: Respond with TEXT ONLY",
  151. "toolu_dwn_ok_skill"
  152. ],
  153. "lastUserMessageIncludes": ["E2E_DWN_OK_START"]
  154. },
  155. "response": {
  156. "statusCode": 200,
  157. "toolUse": {
  158. "id": "toolu_dwn_ok_skill",
  159. "name": "Skill",
  160. "input": {
  161. "skill": "dynamic-workflows"
  162. }
  163. }
  164. }
  165. },
  166. {
  167. "id": "dwn-ok-create",
  168. "metadata": {
  169. "kind": "main",
  170. "source": "synthetic",
  171. "timingPolicy": "fast-text",
  172. "syntheticReason": "固定 Skill/CreateWorkflow 与通知回复的模型选择;真实工作流编译、审批、运行、world.run 文件闸、完成/出错通知的铸造与投递由 Agent 执行。"
  173. },
  174. "maxMatches": 1,
  175. "match": {
  176. "method": "POST",
  177. "pathIncludes": "/messages",
  178. "bodyExcludes": [
  179. "Generate a concise title",
  180. "CRITICAL: Respond with TEXT ONLY",
  181. "toolu_dwn_ok_create"
  182. ],
  183. "bodyIncludes": ["E2E_DWN_OK_START", "toolu_dwn_ok_skill"]
  184. },
  185. "response": {
  186. "statusCode": 200,
  187. "toolUse": {
  188. "id": "toolu_dwn_ok_create",
  189. "name": "CreateWorkflow",
  190. "input": {
  191. "name": "E2E 通知完成工作流",
  192. "script": "phase(\"等待放行\");\nawait world.run(\"node\", [\"-e\", \"const fs = require(\\\"node:fs\\\"); const timer = setInterval(() => { if (fs.existsSync(\\\"{{e2eRuntimeRoot}}/dwn-gate-ok\\\")) clearInterval(timer); }, 100);\"], { output: \"discard\", timeoutMs: 600000 });\nreturn { verdict: \"E2E_DWN_OK_RESULT\", checked: 3 };"
  193. }
  194. }
  195. }
  196. },
  197. {
  198. "id": "dwn-ok-created",
  199. "metadata": {
  200. "kind": "main",
  201. "source": "synthetic",
  202. "timingPolicy": "fast-text",
  203. "syntheticReason": "固定 Skill/CreateWorkflow 与通知回复的模型选择;真实工作流编译、审批、运行、world.run 文件闸、完成/出错通知的铸造与投递由 Agent 执行。"
  204. },
  205. "maxMatches": 1,
  206. "match": {
  207. "method": "POST",
  208. "pathIncludes": "/messages",
  209. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  210. "bodyIncludes": ["E2E_DWN_OK_START", "toolu_dwn_ok_create"]
  211. },
  212. "response": {
  213. "statusCode": 200,
  214. "text": "E2E_DWN_OK_STARTED 工作流已启动,结束时会通知我。"
  215. }
  216. },
  217. {
  218. "id": "dwn-fail-skill",
  219. "metadata": {
  220. "kind": "main",
  221. "source": "synthetic",
  222. "timingPolicy": "fast-text",
  223. "syntheticReason": "固定 Skill/CreateWorkflow 与通知回复的模型选择;真实工作流编译、审批、运行、world.run 文件闸、完成/出错通知的铸造与投递由 Agent 执行。"
  224. },
  225. "maxMatches": 1,
  226. "match": {
  227. "method": "POST",
  228. "pathIncludes": "/messages",
  229. "bodyExcludes": [
  230. "Generate a concise title",
  231. "CRITICAL: Respond with TEXT ONLY",
  232. "toolu_dwn_fail_skill"
  233. ],
  234. "lastUserMessageIncludes": ["E2E_DWN_FAIL_START"]
  235. },
  236. "response": {
  237. "statusCode": 200,
  238. "toolUse": {
  239. "id": "toolu_dwn_fail_skill",
  240. "name": "Skill",
  241. "input": {
  242. "skill": "dynamic-workflows"
  243. }
  244. }
  245. }
  246. },
  247. {
  248. "id": "dwn-fail-create",
  249. "metadata": {
  250. "kind": "main",
  251. "source": "synthetic",
  252. "timingPolicy": "fast-text",
  253. "syntheticReason": "固定 Skill/CreateWorkflow 与通知回复的模型选择;真实工作流编译、审批、运行、world.run 文件闸、完成/出错通知的铸造与投递由 Agent 执行。"
  254. },
  255. "maxMatches": 1,
  256. "match": {
  257. "method": "POST",
  258. "pathIncludes": "/messages",
  259. "bodyExcludes": [
  260. "Generate a concise title",
  261. "CRITICAL: Respond with TEXT ONLY",
  262. "toolu_dwn_fail_create"
  263. ],
  264. "bodyIncludes": ["E2E_DWN_FAIL_START", "toolu_dwn_fail_skill"]
  265. },
  266. "response": {
  267. "statusCode": 200,
  268. "toolUse": {
  269. "id": "toolu_dwn_fail_create",
  270. "name": "CreateWorkflow",
  271. "input": {
  272. "name": "E2E 通知出错工作流",
  273. "script": "phase(\"等待放行\");\nawait world.run(\"node\", [\"-e\", \"const fs = require(\\\"node:fs\\\"); const timer = setInterval(() => { if (fs.existsSync(\\\"{{e2eRuntimeRoot}}/dwn-gate-fail\\\")) clearInterval(timer); }, 100);\"], { output: \"discard\", timeoutMs: 600000 });\nthrow new Error(\"E2E_DWN_FAIL_BOOM 清单缺失\");"
  274. }
  275. }
  276. }
  277. },
  278. {
  279. "id": "dwn-fail-created",
  280. "metadata": {
  281. "kind": "main",
  282. "source": "synthetic",
  283. "timingPolicy": "fast-text",
  284. "syntheticReason": "固定 Skill/CreateWorkflow 与通知回复的模型选择;真实工作流编译、审批、运行、world.run 文件闸、完成/出错通知的铸造与投递由 Agent 执行。"
  285. },
  286. "maxMatches": 1,
  287. "match": {
  288. "method": "POST",
  289. "pathIncludes": "/messages",
  290. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  291. "bodyIncludes": ["E2E_DWN_FAIL_START", "toolu_dwn_fail_create"]
  292. },
  293. "response": {
  294. "statusCode": 200,
  295. "text": "E2E_DWN_FAIL_STARTED 工作流已启动,结束时会通知我。"
  296. }
  297. },
  298. {
  299. "id": "dwn-busy-skill",
  300. "metadata": {
  301. "kind": "main",
  302. "source": "synthetic",
  303. "timingPolicy": "fast-text",
  304. "syntheticReason": "固定 Skill/CreateWorkflow 与通知回复的模型选择;真实工作流编译、审批、运行、world.run 文件闸、完成/出错通知的铸造与投递由 Agent 执行。"
  305. },
  306. "maxMatches": 1,
  307. "match": {
  308. "method": "POST",
  309. "pathIncludes": "/messages",
  310. "bodyExcludes": [
  311. "Generate a concise title",
  312. "CRITICAL: Respond with TEXT ONLY",
  313. "toolu_dwn_busy_skill"
  314. ],
  315. "lastUserMessageIncludes": ["E2E_DWN_BUSY_START"]
  316. },
  317. "response": {
  318. "statusCode": 200,
  319. "toolUse": {
  320. "id": "toolu_dwn_busy_skill",
  321. "name": "Skill",
  322. "input": {
  323. "skill": "dynamic-workflows"
  324. }
  325. }
  326. }
  327. },
  328. {
  329. "id": "dwn-busy-create",
  330. "metadata": {
  331. "kind": "main",
  332. "source": "synthetic",
  333. "timingPolicy": "fast-text",
  334. "syntheticReason": "固定 Skill/CreateWorkflow 与通知回复的模型选择;真实工作流编译、审批、运行、world.run 文件闸、完成/出错通知的铸造与投递由 Agent 执行。"
  335. },
  336. "maxMatches": 1,
  337. "match": {
  338. "method": "POST",
  339. "pathIncludes": "/messages",
  340. "bodyExcludes": [
  341. "Generate a concise title",
  342. "CRITICAL: Respond with TEXT ONLY",
  343. "toolu_dwn_busy_create"
  344. ],
  345. "bodyIncludes": ["E2E_DWN_BUSY_START", "toolu_dwn_busy_skill"]
  346. },
  347. "response": {
  348. "statusCode": 200,
  349. "toolUse": {
  350. "id": "toolu_dwn_busy_create",
  351. "name": "CreateWorkflow",
  352. "input": {
  353. "name": "E2E 通知忙碌工作流",
  354. "script": "phase(\"等待放行\");\nawait world.run(\"node\", [\"-e\", \"const fs = require(\\\"node:fs\\\"); const timer = setInterval(() => { if (fs.existsSync(\\\"{{e2eRuntimeRoot}}/dwn-gate-busy\\\")) clearInterval(timer); }, 100);\"], { output: \"discard\", timeoutMs: 600000 });\nreturn \"E2E_DWN_BUSY_RESULT 忙碌期间完成。\";"
  355. }
  356. }
  357. }
  358. },
  359. {
  360. "id": "dwn-busy-created",
  361. "metadata": {
  362. "kind": "main",
  363. "source": "synthetic",
  364. "timingPolicy": "fast-text",
  365. "syntheticReason": "固定 Skill/CreateWorkflow 与通知回复的模型选择;真实工作流编译、审批、运行、world.run 文件闸、完成/出错通知的铸造与投递由 Agent 执行。"
  366. },
  367. "maxMatches": 1,
  368. "match": {
  369. "method": "POST",
  370. "pathIncludes": "/messages",
  371. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  372. "bodyIncludes": ["E2E_DWN_BUSY_START", "toolu_dwn_busy_create"]
  373. },
  374. "response": {
  375. "statusCode": 200,
  376. "text": "E2E_DWN_BUSY_STARTED 工作流已启动,结束时会通知我。"
  377. }
  378. }
  379. ]
  380. }