conversation-session-subagent-legacy-part-cold-load.json 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-subagent-legacy-part-cold-load",
  4. "spec": "./test/e2e/conversation-session/subagents/conversation-session-subagent-legacy-part-cold-load.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "conversation-session-subagent-legacy-part-cold-load-title",
  8. "description": "本例标题旁路响应。",
  9. "metadata": {
  10. "kind": "common",
  11. "source": "synthetic",
  12. "timingPolicy": "fast-text",
  13. "syntheticReason": "标题生成不属于 SAT31,只需稳定返回以免误匹配业务 fixture。"
  14. },
  15. "match": {
  16. "method": "POST",
  17. "pathIncludes": "/messages",
  18. "bodyIncludes": ["Generate a concise title", "E2E_SAT31_PARENT"]
  19. },
  20. "response": {
  21. "statusCode": 200,
  22. "statusMessage": "OK",
  23. "headers": {
  24. "content-type": "application/json; charset=utf-8"
  25. },
  26. "body": "{\"id\":\"upstream-e2e-sat31-title\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[{\"type\":\"text\",\"text\":\"{\\\"title\\\": \\\"SAT31 Legacy Agent Parts\\\"}\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":125,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":24,\"service_tier\":\"standard\"}}"
  27. }
  28. },
  29. {
  30. "id": "conversation-session-subagent-legacy-part-cold-load-parent-sync-agent",
  31. "description": "父模型先启动一个前台 Agent。",
  32. "metadata": {
  33. "kind": "main",
  34. "source": "synthetic",
  35. "timingPolicy": "fast-tool-use",
  36. "syntheticReason": "固定派发真实前台 Agent;child 完成、落盘与冷加载都走生产代码。"
  37. },
  38. "maxMatches": 1,
  39. "match": {
  40. "method": "POST",
  41. "pathIncludes": "/messages",
  42. "lastUserMessageIncludes": ["E2E_SAT31_PARENT"],
  43. "bodyExcludes": [
  44. "Generate a concise title",
  45. "CRITICAL: Respond with TEXT ONLY",
  46. "E2E_SAT31_SYNC_CHILD:",
  47. "E2E_SAT31_BG_CHILD:"
  48. ]
  49. },
  50. "response": {
  51. "statusCode": 200,
  52. "toolUse": {
  53. "id": "toolu_e2e_sat31_sync",
  54. "name": "Agent",
  55. "input": {
  56. "description": "SAT31 sync child",
  57. "prompt": "E2E_SAT31_SYNC_CHILD: reply with exactly E2E_SAT31_SYNC_DONE",
  58. "run_in_background": false,
  59. "subagent_type": "general-purpose"
  60. }
  61. }
  62. }
  63. },
  64. {
  65. "id": "conversation-session-subagent-legacy-part-cold-load-sync-child",
  66. "description": "前台 child 直接完成。",
  67. "metadata": {
  68. "kind": "subagent",
  69. "source": "synthetic",
  70. "timingPolicy": "fast-text",
  71. "syntheticReason": "前台 child 完成后,同步结果文本带 agentId 行;它是旧 part 唯一的身份来源。"
  72. },
  73. "maxMatches": 1,
  74. "match": {
  75. "method": "POST",
  76. "pathIncludes": "/messages",
  77. "lastUserMessageIncludes": ["E2E_SAT31_SYNC_CHILD:"],
  78. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  79. },
  80. "response": {
  81. "statusCode": 200,
  82. "text": {
  83. "id": "upstream-e2e-sat31-sync-child",
  84. "text": "E2E_SAT31_SYNC_DONE",
  85. "inputTokens": 64,
  86. "outputTokens": 8
  87. }
  88. }
  89. },
  90. {
  91. "id": "conversation-session-subagent-legacy-part-cold-load-parent-background-agent",
  92. "description": "父模型收到前台结果后再启动一个后台 Agent。",
  93. "metadata": {
  94. "kind": "main",
  95. "source": "synthetic",
  96. "timingPolicy": "fast-tool-use",
  97. "syntheticReason": "bodyIncludes 的 agentId 行证明前台结果已交回;固定派发真实后台 Agent。"
  98. },
  99. "maxMatches": 1,
  100. "match": {
  101. "method": "POST",
  102. "pathIncludes": "/messages",
  103. "bodyIncludes": ["E2E_SAT31_PARENT", "toolu_e2e_sat31_sync", "agentId: agent_"],
  104. "bodyExcludes": [
  105. "Generate a concise title",
  106. "CRITICAL: Respond with TEXT ONLY",
  107. "toolu_e2e_sat31_bg"
  108. ]
  109. },
  110. "response": {
  111. "statusCode": 200,
  112. "toolUse": {
  113. "id": "toolu_e2e_sat31_bg",
  114. "name": "Agent",
  115. "input": {
  116. "description": "SAT31 background child",
  117. "prompt": "E2E_SAT31_BG_CHILD: reply with exactly E2E_SAT31_BG_DONE",
  118. "run_in_background": true,
  119. "subagent_type": "general-purpose"
  120. }
  121. }
  122. }
  123. },
  124. {
  125. "id": "conversation-session-subagent-legacy-part-cold-load-background-child",
  126. "description": "后台 child 完成;输出停在半途,等父 turn 收口后由测试释放。",
  127. "metadata": {
  128. "kind": "subagent",
  129. "source": "synthetic",
  130. "timingPolicy": "controlled-stream",
  131. "syntheticReason": "后台 child 停在半途,避免完成通知插进父 turn;测试看到父模型的启动回复后再释放,完成通知单独唤醒父会话。"
  132. },
  133. "maxMatches": 1,
  134. "match": {
  135. "method": "POST",
  136. "pathIncludes": "/messages",
  137. "lastUserMessageIncludes": ["E2E_SAT31_BG_CHILD:"],
  138. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  139. },
  140. "response": {
  141. "statusCode": 200,
  142. "headers": {
  143. "content-type": "text/event-stream; charset=utf-8"
  144. },
  145. "chunks": [
  146. {
  147. "offsetMs": 0,
  148. "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-sat31-background-child\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":64,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":0}}}\n\n"
  149. },
  150. {
  151. "offsetMs": 0,
  152. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
  153. },
  154. {
  155. "offsetMs": 0,
  156. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"E2E_SAT31_BG_\"}}\n\n"
  157. },
  158. {
  159. "offsetMs": 0,
  160. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"DONE\"}}\n\n"
  161. },
  162. {
  163. "offsetMs": 0,
  164. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
  165. },
  166. {
  167. "offsetMs": 0,
  168. "text": "event: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":64,\"output_tokens\":8}}\n\n"
  169. },
  170. {
  171. "offsetMs": 0,
  172. "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  173. }
  174. ],
  175. "releaseAfterChunks": 3
  176. }
  177. },
  178. {
  179. "id": "conversation-session-subagent-legacy-part-cold-load-parent-after-launch",
  180. "description": "父模型收到后台启动回执后结束当前 turn。",
  181. "metadata": {
  182. "kind": "main",
  183. "source": "synthetic",
  184. "timingPolicy": "fast-text",
  185. "syntheticReason": "bodyIncludes 的回执前缀证明后台启动回执进入了父 transcript;它是旧 part 判断后台启动的依据。"
  186. },
  187. "maxMatches": 1,
  188. "match": {
  189. "method": "POST",
  190. "pathIncludes": "/messages",
  191. "bodyIncludes": [
  192. "E2E_SAT31_PARENT",
  193. "toolu_e2e_sat31_bg",
  194. "Async agent launched successfully"
  195. ],
  196. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  197. "lastUserMessageExcludes": ["<task-notification>"]
  198. },
  199. "response": {
  200. "statusCode": 200,
  201. "text": {
  202. "id": "upstream-e2e-sat31-parent-after-launch",
  203. "text": "E2E_SAT31_PARENT_LAUNCHED",
  204. "inputTokens": 64,
  205. "outputTokens": 8
  206. }
  207. }
  208. },
  209. {
  210. "id": "conversation-session-subagent-legacy-part-cold-load-parent-notification",
  211. "description": "后台 child 的完成通知回到父模型。",
  212. "metadata": {
  213. "kind": "main",
  214. "source": "synthetic",
  215. "timingPolicy": "task-notification",
  216. "syntheticReason": "后台 Agent 完成通知经 runtime command queue 回到父模型并收口,之后再重启。"
  217. },
  218. "maxMatches": 1,
  219. "match": {
  220. "method": "POST",
  221. "pathIncludes": "/messages",
  222. "lastUserMessageIncludes": ["<task-notification>", "<status>completed</status>"],
  223. "bodyIncludes": ["E2E_SAT31_PARENT", "E2E_SAT31_BG_DONE"],
  224. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  225. },
  226. "response": {
  227. "statusCode": 200,
  228. "text": {
  229. "id": "upstream-e2e-sat31-parent-notification",
  230. "text": "E2E_SAT31_NOTIFICATION_DONE",
  231. "inputTokens": 64,
  232. "outputTokens": 8
  233. }
  234. }
  235. }
  236. ]
  237. }