conversation-session-dynamic-workflow-gray-always-on-transcript.json 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-dynamic-workflow-gray-always-on-transcript",
  4. "spec": "./test/e2e/conversation-session/workflows/conversation-session-dynamic-workflow-gray-always-on-transcript.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "dwt-title",
  8. "metadata": {
  9. "kind": "common",
  10. "source": "synthetic",
  11. "timingPolicy": "fast-text",
  12. "syntheticReason": "固定 Skill/CreateWorkflow 与收尾回复的模型选择;真实 Skill 加载、工作流编译、确认窗、run 引擎(world.run 真实执行命令并落 journal)、子代理会话与完成通知由 Agent 执行。"
  13. },
  14. "match": {
  15. "method": "POST",
  16. "pathIncludes": "/messages",
  17. "bodyExcludes": [],
  18. "bodyIncludes": ["Generate a concise title", "E2E_DWT_"]
  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": "dwt-agent",
  30. "metadata": {
  31. "kind": "main",
  32. "source": "synthetic",
  33. "timingPolicy": "controlled-stream",
  34. "syntheticReason": "复核员子代理的回答以门闩挂起,run 停在第二阶段时断言脚本 transcript 的运行态,再由测试显式释放,不依赖固定响应延时。"
  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_DWT_TASK"]
  46. },
  47. "response": {
  48. "statusCode": 200,
  49. "headers": {
  50. "content-type": "text/event-stream; charset=utf-8"
  51. },
  52. "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_e2e_dwt_agent\",\"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_DWT_VERDICT 第一条检查通过,第二条以退出码 3 失败。\"}}\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",
  53. "chunks": [
  54. {
  55. "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_e2e_dwt_agent\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"usage\":{\"input_tokens\":256,\"output_tokens\":0}}}\n\n",
  56. "delayMs": 0
  57. },
  58. {
  59. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n",
  60. "delayMs": 0
  61. },
  62. {
  63. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"E2E_DWT_VERDICT 第一条检查通过,第二条以退出码 3 失败。\"}}\n\n",
  64. "delayMs": 0
  65. },
  66. {
  67. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n",
  68. "delayMs": 0
  69. },
  70. {
  71. "text": "event: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":32}}\n\n",
  72. "delayMs": 0
  73. },
  74. {
  75. "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n",
  76. "delayMs": 0
  77. }
  78. ],
  79. "releaseAfterChunks": 2
  80. },
  81. "maxMatches": 1
  82. },
  83. {
  84. "id": "dwt-skill",
  85. "metadata": {
  86. "kind": "main",
  87. "source": "synthetic",
  88. "timingPolicy": "fast-text",
  89. "syntheticReason": "固定 Skill/CreateWorkflow 与收尾回复的模型选择;真实 Skill 加载、工作流编译、确认窗、run 引擎(world.run 真实执行命令并落 journal)、子代理会话与完成通知由 Agent 执行。"
  90. },
  91. "match": {
  92. "method": "POST",
  93. "pathIncludes": "/messages",
  94. "bodyExcludes": [
  95. "Generate a concise title",
  96. "CRITICAL: Respond with TEXT ONLY",
  97. "You are now acting as the memory extraction subagent",
  98. "You are a subagent inside a dynamic workflow run",
  99. "toolu_dwt_skill"
  100. ],
  101. "lastUserMessageIncludes": ["E2E_DWT_START"]
  102. },
  103. "response": {
  104. "statusCode": 200,
  105. "toolUse": {
  106. "id": "toolu_dwt_skill",
  107. "name": "Skill",
  108. "input": {
  109. "skill": "dynamic-workflows"
  110. }
  111. }
  112. }
  113. },
  114. {
  115. "id": "dwt-create",
  116. "metadata": {
  117. "kind": "main",
  118. "source": "synthetic",
  119. "timingPolicy": "fast-text",
  120. "syntheticReason": "固定 Skill/CreateWorkflow 与收尾回复的模型选择;真实 Skill 加载、工作流编译、确认窗、run 引擎(world.run 真实执行命令并落 journal)、子代理会话与完成通知由 Agent 执行。"
  121. },
  122. "match": {
  123. "method": "POST",
  124. "pathIncludes": "/messages",
  125. "bodyExcludes": [
  126. "Generate a concise title",
  127. "CRITICAL: Respond with TEXT ONLY",
  128. "You are now acting as the memory extraction subagent",
  129. "You are a subagent inside a dynamic workflow run",
  130. "toolu_dwt_create"
  131. ],
  132. "bodyIncludes": ["E2E_DWT_START", "toolu_dwt_skill"]
  133. },
  134. "response": {
  135. "statusCode": 200,
  136. "toolUse": {
  137. "id": "toolu_dwt_create",
  138. "name": "CreateWorkflow",
  139. "input": {
  140. "name": "E2E 检查命令",
  141. "script": "phase(\"检查\");\nlog(\"E2E_DWT_LOG 开始跑四条检查命令\");\nconst ok = await world.run(\"node\", [\"-e\", \"console.log('E2E_DWT_OK_1');console.log('E2E_DWT_OK_2');console.log('E2E_DWT_OK_3');console.log('E2E_DWT_OK_4')\"]);\nconst bad = await world.run(\"node\", [\"-e\", \"console.error('Error: E2E_DWT_BAD config missing');process.exit(3)\"]);\nconst long = await world.run(\"node\", [\"-e\", \"for(let i=1;i<=260;i++)console.log('E2E_DWT_LONG_'+i)\"]);\nconst tail = await world.run(\"node\", [\"-e\", \"process.stdout.write('E2E_DWT_HEAD_'.repeat(20)+'E2E_DWT_TAIL_END')\"], { output: { tail: 16 } });\nlog(`E2E_DWT_LOG 检查结束:${ok.exitCode} / ${bad.exitCode}`);\nphase(\"复核\");\nconst verdict = await agent(\"复核员\").ask(`E2E_DWT_TASK 依据两条检查的退出码 ${ok.exitCode} 与 ${bad.exitCode} 给出一句结论。`);\nreturn { ok: ok.exitCode, bad: bad.exitCode, longLines: long.stdout.split(\"\\n\").length, tail: tail.stdout, verdict };"
  142. }
  143. }
  144. }
  145. },
  146. {
  147. "id": "dwt-notified",
  148. "metadata": {
  149. "kind": "main",
  150. "source": "synthetic",
  151. "timingPolicy": "fast-text",
  152. "syntheticReason": "固定 Skill/CreateWorkflow 与收尾回复的模型选择;真实 Skill 加载、工作流编译、确认窗、run 引擎(world.run 真实执行命令并落 journal)、子代理会话与完成通知由 Agent 执行。"
  153. },
  154. "match": {
  155. "method": "POST",
  156. "pathIncludes": "/messages",
  157. "bodyExcludes": [
  158. "Generate a concise title",
  159. "CRITICAL: Respond with TEXT ONLY",
  160. "You are now acting as the memory extraction subagent",
  161. "You are a subagent inside a dynamic workflow run"
  162. ],
  163. "bodyIncludes": ["E2E_DWT_START"],
  164. "lastUserMessageIncludes": ["<task-notification>", "<status>completed</status>"]
  165. },
  166. "response": {
  167. "statusCode": 200,
  168. "text": "E2E_DWT_DONE 工作流已完成:第二条检查失败。"
  169. }
  170. },
  171. {
  172. "id": "dwt-created",
  173. "metadata": {
  174. "kind": "main",
  175. "source": "synthetic",
  176. "timingPolicy": "fast-text",
  177. "syntheticReason": "固定 Skill/CreateWorkflow 与收尾回复的模型选择;真实 Skill 加载、工作流编译、确认窗、run 引擎(world.run 真实执行命令并落 journal)、子代理会话与完成通知由 Agent 执行。"
  178. },
  179. "match": {
  180. "method": "POST",
  181. "pathIncludes": "/messages",
  182. "bodyExcludes": [
  183. "Generate a concise title",
  184. "CRITICAL: Respond with TEXT ONLY",
  185. "You are now acting as the memory extraction subagent",
  186. "You are a subagent inside a dynamic workflow run"
  187. ],
  188. "bodyIncludes": ["E2E_DWT_START", "toolu_dwt_create"]
  189. },
  190. "response": {
  191. "statusCode": 200,
  192. "text": "E2E_DWT_STARTED 工作流已启动,结果会以通知送达。"
  193. }
  194. }
  195. ]
  196. }