conversation-session-dynamic-workflow-gray-always-on-run.json 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-dynamic-workflow-gray-always-on-run",
  4. "spec": "./test/e2e/conversation-session/workflows/conversation-session-dynamic-workflow-gray-always-on-run.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "dwr-title",
  8. "metadata": {
  9. "kind": "common",
  10. "source": "synthetic",
  11. "timingPolicy": "fast-text",
  12. "syntheticReason": "固定 Skill/CreateWorkflow 与收尾回复的模型选择;真实 Skill 加载、工作流编译、确认窗、run 引擎、子代理会话与完成通知由 Agent 执行。"
  13. },
  14. "match": {
  15. "method": "POST",
  16. "pathIncludes": "/messages",
  17. "bodyExcludes": [],
  18. "bodyIncludes": ["Generate a concise title", "E2E_DWR_"]
  19. },
  20. "response": {
  21. "statusCode": 200,
  22. "headers": {
  23. "content-type": "application/json; charset=utf-8"
  24. },
  25. "body": "{\"id\":\"msg_upstream_e2e_text\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[{\"type\":\"text\",\"text\":\"{\\\"title\\\":\\\"工作流运行 E2E\\\"}\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":128,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":12,\"service_tier\":\"standard\"}}"
  26. }
  27. },
  28. {
  29. "id": "dwr-agent-a",
  30. "metadata": {
  31. "kind": "main",
  32. "source": "synthetic",
  33. "timingPolicy": "fast-text",
  34. "syntheticReason": "固定工作流子代理的回答;子代理会话、并行调度、阶段推进与结果回传仍走真实 run 引擎。"
  35. },
  36. "match": {
  37. "method": "POST",
  38. "pathIncludes": "/messages",
  39. "bodyIncludes": ["You are a subagent inside a dynamic workflow run"],
  40. "bodyExcludes": [
  41. "Generate a concise title",
  42. "CRITICAL: Respond with TEXT ONLY",
  43. "You are now acting as the memory extraction subagent"
  44. ],
  45. "lastUserMessageIncludes": ["E2E_DWR_TASK_A"]
  46. },
  47. "response": {
  48. "statusCode": 200,
  49. "text": "E2E_DWR_ANSWER_A 第一份材料结论成立。"
  50. }
  51. },
  52. {
  53. "id": "dwr-agent-b",
  54. "metadata": {
  55. "kind": "main",
  56. "source": "synthetic",
  57. "timingPolicy": "fast-text",
  58. "syntheticReason": "固定工作流子代理的回答;子代理会话、并行调度、阶段推进与结果回传仍走真实 run 引擎。"
  59. },
  60. "match": {
  61. "method": "POST",
  62. "pathIncludes": "/messages",
  63. "bodyIncludes": ["You are a subagent inside a dynamic workflow run"],
  64. "bodyExcludes": [
  65. "Generate a concise title",
  66. "CRITICAL: Respond with TEXT ONLY",
  67. "You are now acting as the memory extraction subagent"
  68. ],
  69. "lastUserMessageIncludes": ["E2E_DWR_TASK_B"]
  70. },
  71. "response": {
  72. "statusCode": 200,
  73. "text": "E2E_DWR_ANSWER_B 第二份材料结论成立。"
  74. }
  75. },
  76. {
  77. "id": "dwr-agent-c",
  78. "metadata": {
  79. "kind": "main",
  80. "source": "synthetic",
  81. "timingPolicy": "controlled-stream",
  82. "syntheticReason": "第二阶段子代理的回答以门闩挂起,在运行态断言完成后由测试显式释放,不依赖固定响应延时。"
  83. },
  84. "match": {
  85. "method": "POST",
  86. "pathIncludes": "/messages",
  87. "bodyIncludes": ["You are a subagent inside a dynamic workflow run"],
  88. "bodyExcludes": [
  89. "Generate a concise title",
  90. "CRITICAL: Respond with TEXT ONLY",
  91. "You are now acting as the memory extraction subagent"
  92. ],
  93. "lastUserMessageIncludes": ["E2E_DWR_TASK_C"]
  94. },
  95. "response": {
  96. "statusCode": 200,
  97. "headers": {
  98. "content-type": "text/event-stream; charset=utf-8"
  99. },
  100. "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_e2e_dwr_agent_c\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"usage\":{\"input_tokens\":256,\"output_tokens\":0}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"E2E_DWR_ANSWER_C 两份结论一致,可以合并。\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":32}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n",
  101. "chunks": [
  102. {
  103. "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_e2e_dwr_agent_c\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"usage\":{\"input_tokens\":256,\"output_tokens\":0}}}\n\n",
  104. "delayMs": 0
  105. },
  106. {
  107. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n",
  108. "delayMs": 0
  109. },
  110. {
  111. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"E2E_DWR_ANSWER_C 两份结论一致,可以合并。\"}}\n\n",
  112. "delayMs": 0
  113. },
  114. {
  115. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n",
  116. "delayMs": 0
  117. },
  118. {
  119. "text": "event: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":32}}\n\n",
  120. "delayMs": 0
  121. },
  122. {
  123. "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n",
  124. "delayMs": 0
  125. }
  126. ],
  127. "releaseAfterChunks": 2
  128. },
  129. "maxMatches": 1
  130. },
  131. {
  132. "id": "dwr-skill",
  133. "metadata": {
  134. "kind": "main",
  135. "source": "synthetic",
  136. "timingPolicy": "fast-text",
  137. "syntheticReason": "固定 Skill/CreateWorkflow 与收尾回复的模型选择;真实 Skill 加载、工作流编译、确认窗、run 引擎、子代理会话与完成通知由 Agent 执行。"
  138. },
  139. "match": {
  140. "method": "POST",
  141. "pathIncludes": "/messages",
  142. "bodyExcludes": [
  143. "Generate a concise title",
  144. "CRITICAL: Respond with TEXT ONLY",
  145. "You are now acting as the memory extraction subagent",
  146. "You are a subagent inside a dynamic workflow run",
  147. "toolu_dwr_skill"
  148. ],
  149. "lastUserMessageIncludes": ["E2E_DWR_START"]
  150. },
  151. "response": {
  152. "statusCode": 200,
  153. "toolUse": {
  154. "id": "toolu_dwr_skill",
  155. "name": "Skill",
  156. "input": {
  157. "skill": "dynamic-workflows"
  158. }
  159. }
  160. }
  161. },
  162. {
  163. "id": "dwr-create",
  164. "metadata": {
  165. "kind": "main",
  166. "source": "synthetic",
  167. "timingPolicy": "fast-text",
  168. "syntheticReason": "固定 Skill/CreateWorkflow 与收尾回复的模型选择;真实 Skill 加载、工作流编译、确认窗、run 引擎、子代理会话与完成通知由 Agent 执行。"
  169. },
  170. "match": {
  171. "method": "POST",
  172. "pathIncludes": "/messages",
  173. "bodyExcludes": [
  174. "Generate a concise title",
  175. "CRITICAL: Respond with TEXT ONLY",
  176. "You are now acting as the memory extraction subagent",
  177. "You are a subagent inside a dynamic workflow run",
  178. "toolu_dwr_create"
  179. ],
  180. "bodyIncludes": ["E2E_DWR_START", "toolu_dwr_skill"]
  181. },
  182. "response": {
  183. "statusCode": 200,
  184. "toolUse": {
  185. "id": "toolu_dwr_create",
  186. "name": "CreateWorkflow",
  187. "input": {
  188. "name": "E2E 调研汇总",
  189. "script": "phase(\"调研\");\nconst first = agent(\"调研员甲\").ask(\"E2E_DWR_TASK_A 调研第一份材料,给出一句结论。\");\nconst second = agent(\"调研员乙\").ask(\"E2E_DWR_TASK_B 调研第二份材料,给出一句结论。\");\n// 两份调研并行,汇总需要两份结论:这里是唯一的汇合点。\nconst [a, b] = await Promise.all([first, second]);\nphase(\"汇总\");\nconst summary = await agent(\"汇总员\").ask(`E2E_DWR_TASK_C 汇总两份结论:${a} / ${b}`);\nreturn { summary, parts: [a, b] };"
  190. }
  191. }
  192. }
  193. },
  194. {
  195. "id": "dwr-notified",
  196. "metadata": {
  197. "kind": "main",
  198. "source": "synthetic",
  199. "timingPolicy": "fast-text",
  200. "syntheticReason": "固定 Skill/CreateWorkflow 与收尾回复的模型选择;真实 Skill 加载、工作流编译、确认窗、run 引擎、子代理会话与完成通知由 Agent 执行。"
  201. },
  202. "match": {
  203. "method": "POST",
  204. "pathIncludes": "/messages",
  205. "bodyExcludes": [
  206. "Generate a concise title",
  207. "CRITICAL: Respond with TEXT ONLY",
  208. "You are now acting as the memory extraction subagent",
  209. "You are a subagent inside a dynamic workflow run"
  210. ],
  211. "bodyIncludes": ["E2E_DWR_START"],
  212. "lastUserMessageIncludes": ["<task-notification>", "<status>completed</status>"]
  213. },
  214. "response": {
  215. "statusCode": 200,
  216. "text": "E2E_DWR_DONE 工作流已完成:两份材料结论一致。"
  217. }
  218. },
  219. {
  220. "id": "dwr-created",
  221. "metadata": {
  222. "kind": "main",
  223. "source": "synthetic",
  224. "timingPolicy": "fast-text",
  225. "syntheticReason": "固定 Skill/CreateWorkflow 与收尾回复的模型选择;真实 Skill 加载、工作流编译、确认窗、run 引擎、子代理会话与完成通知由 Agent 执行。"
  226. },
  227. "match": {
  228. "method": "POST",
  229. "pathIncludes": "/messages",
  230. "bodyExcludes": [
  231. "Generate a concise title",
  232. "CRITICAL: Respond with TEXT ONLY",
  233. "You are now acting as the memory extraction subagent",
  234. "You are a subagent inside a dynamic workflow run"
  235. ],
  236. "bodyIncludes": ["E2E_DWR_START", "toolu_dwr_create"]
  237. },
  238. "response": {
  239. "statusCode": 200,
  240. "text": "E2E_DWR_STARTED 工作流已启动,结果会以通知送达。"
  241. }
  242. }
  243. ]
  244. }