conversation-session-dynamic-workflow-gray-always-on-questions.json 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-dynamic-workflow-gray-always-on-questions",
  4. "spec": "./test/e2e/conversation-session/workflows/conversation-session-dynamic-workflow-gray-always-on-questions.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "dwq-title",
  8. "metadata": {
  9. "kind": "common",
  10. "source": "synthetic",
  11. "timingPolicy": "fast-text",
  12. "syntheticReason": "固定 Skill/CreateWorkflow/ResolveWorkflowQuestion 与回复的模型选择;真实 Skill 加载、工作流编译、确认窗、run 引擎、升级问答的停驻与恢复、通知的铸造与投递由 Agent 执行。"
  13. },
  14. "match": {
  15. "method": "POST",
  16. "pathIncludes": "/messages",
  17. "bodyExcludes": [],
  18. "bodyIncludes": ["Generate a concise title", "E2E_DWQ_"]
  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": "dwq-agent-ask",
  30. "metadata": {
  31. "kind": "main",
  32. "source": "synthetic",
  33. "timingPolicy": "fast-text",
  34. "syntheticReason": "固定工作流子代理的回答:先用 escalate 提问,拿到答案后给出结论;子代理会话、停驻、作答回传与 run 推进仍走真实 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. "toolu_dwq_escalate"
  45. ],
  46. "lastUserMessageIncludes": ["E2E_DWQ_TASK"]
  47. },
  48. "response": {
  49. "statusCode": 200,
  50. "toolUse": {
  51. "id": "toolu_dwq_escalate",
  52. "name": "escalate",
  53. "input": {
  54. "question": "E2E_DWQ_QUESTION 仓库里有两份发布清单,应该按哪一份核对?",
  55. "context": "E2E_DWQ_CONTEXT release-a.md 和 release-b.md 的版本号互相矛盾,我无法判断哪份是最新的。"
  56. }
  57. }
  58. }
  59. },
  60. {
  61. "id": "dwq-agent-resumed",
  62. "metadata": {
  63. "kind": "main",
  64. "source": "synthetic",
  65. "timingPolicy": "fast-text",
  66. "syntheticReason": "固定工作流子代理的回答:先用 escalate 提问,拿到答案后给出结论;子代理会话、停驻、作答回传与 run 推进仍走真实 run 引擎。"
  67. },
  68. "match": {
  69. "method": "POST",
  70. "pathIncludes": "/messages",
  71. "bodyIncludes": ["You are a subagent inside a dynamic workflow run", "toolu_dwq_escalate"],
  72. "bodyExcludes": [
  73. "Generate a concise title",
  74. "CRITICAL: Respond with TEXT ONLY",
  75. "You are now acting as the memory extraction subagent"
  76. ],
  77. "lastUserMessageIncludes": ["E2E_DWQ_ANSWER"]
  78. },
  79. "response": {
  80. "statusCode": 200,
  81. "text": "E2E_DWQ_RESULT 按 release-b.md 核对完毕,清单一致。"
  82. }
  83. },
  84. {
  85. "id": "dwq-notified",
  86. "metadata": {
  87. "kind": "main",
  88. "source": "synthetic",
  89. "timingPolicy": "fast-text",
  90. "syntheticReason": "固定 Skill/CreateWorkflow/ResolveWorkflowQuestion 与回复的模型选择;真实 Skill 加载、工作流编译、确认窗、run 引擎、升级问答的停驻与恢复、通知的铸造与投递由 Agent 执行。"
  91. },
  92. "match": {
  93. "method": "POST",
  94. "pathIncludes": "/messages",
  95. "bodyExcludes": [
  96. "Generate a concise title",
  97. "CRITICAL: Respond with TEXT ONLY",
  98. "You are now acting as the memory extraction subagent",
  99. "You are a subagent inside a dynamic workflow run"
  100. ],
  101. "lastUserMessageIncludes": ["<task-notification>", "<status>completed</status>"],
  102. "bodyIncludes": ["E2E_DWQ_START"]
  103. },
  104. "response": {
  105. "statusCode": 200,
  106. "text": "E2E_DWQ_DONE 工作流已完成:按 release-b.md 核对完毕。"
  107. }
  108. },
  109. {
  110. "id": "dwq-seen",
  111. "metadata": {
  112. "kind": "main",
  113. "source": "synthetic",
  114. "timingPolicy": "fast-text",
  115. "syntheticReason": "固定 Skill/CreateWorkflow/ResolveWorkflowQuestion 与回复的模型选择;真实 Skill 加载、工作流编译、确认窗、run 引擎、升级问答的停驻与恢复、通知的铸造与投递由 Agent 执行。"
  116. },
  117. "match": {
  118. "method": "POST",
  119. "pathIncludes": "/messages",
  120. "bodyExcludes": [
  121. "Generate a concise title",
  122. "CRITICAL: Respond with TEXT ONLY",
  123. "You are now acting as the memory extraction subagent",
  124. "You are a subagent inside a dynamic workflow run"
  125. ],
  126. "lastUserMessageIncludes": ["<workflow-escalation>"],
  127. "bodyIncludes": ["E2E_DWQ_START"]
  128. },
  129. "response": {
  130. "statusCode": 200,
  131. "text": "E2E_DWQ_SEEN 子代理在问按哪份清单核对,请你确认。"
  132. }
  133. },
  134. {
  135. "id": "dwq-resolve",
  136. "metadata": {
  137. "kind": "main",
  138. "source": "synthetic",
  139. "timingPolicy": "fast-text",
  140. "syntheticReason": "固定 Skill/CreateWorkflow/ResolveWorkflowQuestion 与回复的模型选择;真实 Skill 加载、工作流编译、确认窗、run 引擎、升级问答的停驻与恢复、通知的铸造与投递由 Agent 执行。"
  141. },
  142. "match": {
  143. "method": "POST",
  144. "pathIncludes": "/messages",
  145. "bodyExcludes": [
  146. "Generate a concise title",
  147. "CRITICAL: Respond with TEXT ONLY",
  148. "You are now acting as the memory extraction subagent",
  149. "You are a subagent inside a dynamic workflow run",
  150. "toolu_dwq_resolve"
  151. ],
  152. "lastUserMessageIncludes": ["E2E_DWQ_REPLY_NOW"]
  153. },
  154. "response": {
  155. "statusCode": 200,
  156. "toolUse": {
  157. "id": "toolu_dwq_resolve",
  158. "name": "ResolveWorkflowQuestion",
  159. "input": {
  160. "question_id": "{{latestWorkflowQuestionId}}",
  161. "answer": "E2E_DWQ_ANSWER 按 release-b.md 核对,它是最新的一份。"
  162. }
  163. }
  164. }
  165. },
  166. {
  167. "id": "dwq-resolved",
  168. "metadata": {
  169. "kind": "main",
  170. "source": "synthetic",
  171. "timingPolicy": "fast-text",
  172. "syntheticReason": "固定 Skill/CreateWorkflow/ResolveWorkflowQuestion 与回复的模型选择;真实 Skill 加载、工作流编译、确认窗、run 引擎、升级问答的停驻与恢复、通知的铸造与投递由 Agent 执行。"
  173. },
  174. "match": {
  175. "method": "POST",
  176. "pathIncludes": "/messages",
  177. "bodyExcludes": [
  178. "Generate a concise title",
  179. "CRITICAL: Respond with TEXT ONLY",
  180. "You are now acting as the memory extraction subagent",
  181. "You are a subagent inside a dynamic workflow run"
  182. ],
  183. "bodyIncludes": ["E2E_DWQ_REPLY_NOW", "toolu_dwq_resolve"]
  184. },
  185. "response": {
  186. "statusCode": 200,
  187. "text": "E2E_DWQ_RESOLVED 已告诉子代理按 release-b.md 核对。"
  188. }
  189. },
  190. {
  191. "id": "dwq-skill",
  192. "metadata": {
  193. "kind": "main",
  194. "source": "synthetic",
  195. "timingPolicy": "fast-text",
  196. "syntheticReason": "固定 Skill/CreateWorkflow/ResolveWorkflowQuestion 与回复的模型选择;真实 Skill 加载、工作流编译、确认窗、run 引擎、升级问答的停驻与恢复、通知的铸造与投递由 Agent 执行。"
  197. },
  198. "match": {
  199. "method": "POST",
  200. "pathIncludes": "/messages",
  201. "bodyExcludes": [
  202. "Generate a concise title",
  203. "CRITICAL: Respond with TEXT ONLY",
  204. "You are now acting as the memory extraction subagent",
  205. "You are a subagent inside a dynamic workflow run",
  206. "toolu_dwq_skill"
  207. ],
  208. "lastUserMessageIncludes": ["E2E_DWQ_START"]
  209. },
  210. "response": {
  211. "statusCode": 200,
  212. "toolUse": {
  213. "id": "toolu_dwq_skill",
  214. "name": "Skill",
  215. "input": {
  216. "skill": "dynamic-workflows"
  217. }
  218. }
  219. }
  220. },
  221. {
  222. "id": "dwq-create",
  223. "metadata": {
  224. "kind": "main",
  225. "source": "synthetic",
  226. "timingPolicy": "fast-text",
  227. "syntheticReason": "固定 Skill/CreateWorkflow/ResolveWorkflowQuestion 与回复的模型选择;真实 Skill 加载、工作流编译、确认窗、run 引擎、升级问答的停驻与恢复、通知的铸造与投递由 Agent 执行。"
  228. },
  229. "match": {
  230. "method": "POST",
  231. "pathIncludes": "/messages",
  232. "bodyExcludes": [
  233. "Generate a concise title",
  234. "CRITICAL: Respond with TEXT ONLY",
  235. "You are now acting as the memory extraction subagent",
  236. "You are a subagent inside a dynamic workflow run",
  237. "toolu_dwq_create"
  238. ],
  239. "bodyIncludes": ["E2E_DWQ_START", "toolu_dwq_skill"]
  240. },
  241. "response": {
  242. "statusCode": 200,
  243. "toolUse": {
  244. "id": "toolu_dwq_create",
  245. "name": "CreateWorkflow",
  246. "input": {
  247. "name": "E2E 提问工作流",
  248. "script": "phase(\"核对\");\n// 闸文件:用例在启动轮收尾之后才写它,升级通知因此唤起自己的一轮,不并进启动轮。\nawait world.run(\"node\", [\"-e\", \"const fs = require(\\\"node:fs\\\"); const timer = setInterval(() => { if (fs.existsSync(\\\"{{e2eRuntimeRoot}}/dwq-gate\\\")) clearInterval(timer); }, 100);\"], { output: \"discard\", timeoutMs: 600000 });\nconst verdict = await agent(\"核对员\").ask(\"E2E_DWQ_TASK 核对发布清单,给出一句结论;拿不准按哪份清单时用 escalate 问主代理。\");\nreturn { verdict };"
  249. }
  250. }
  251. }
  252. },
  253. {
  254. "id": "dwq-created",
  255. "metadata": {
  256. "kind": "main",
  257. "source": "synthetic",
  258. "timingPolicy": "fast-text",
  259. "syntheticReason": "固定 Skill/CreateWorkflow/ResolveWorkflowQuestion 与回复的模型选择;真实 Skill 加载、工作流编译、确认窗、run 引擎、升级问答的停驻与恢复、通知的铸造与投递由 Agent 执行。"
  260. },
  261. "match": {
  262. "method": "POST",
  263. "pathIncludes": "/messages",
  264. "bodyExcludes": [
  265. "Generate a concise title",
  266. "CRITICAL: Respond with TEXT ONLY",
  267. "You are now acting as the memory extraction subagent",
  268. "You are a subagent inside a dynamic workflow run"
  269. ],
  270. "bodyIncludes": ["E2E_DWQ_START", "toolu_dwq_create"]
  271. },
  272. "response": {
  273. "statusCode": 200,
  274. "text": "E2E_DWQ_STARTED 工作流已启动,子代理有问题会来问。"
  275. }
  276. }
  277. ]
  278. }