conversation-session-background-history-layout.json 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-background-history-layout",
  4. "spec": "./test/e2e/conversation-session/background/conversation-session-background-history-layout.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "bg-history-title",
  8. "description": "bg-history-title",
  9. "metadata": {
  10. "kind": "common",
  11. "source": "synthetic",
  12. "timingPolicy": "fast-text",
  13. "syntheticReason": "固定后台结果空正文和非空历史,用真实 Agent 通知与 UI 验证折叠布局。"
  14. },
  15. "match": {
  16. "method": "POST",
  17. "pathIncludes": "/messages",
  18. "bodyIncludes": ["Generate a concise title", "E2E_BG_HISTORY_"]
  19. },
  20. "response": {
  21. "statusCode": 200,
  22. "headers": {
  23. "content-type": "application/json"
  24. },
  25. "body": "{\"id\": \"bg_history_title\", \"type\": \"message\", \"role\": \"assistant\", \"model\": \"deepseek-v4-flash\", \"content\": [{\"type\": \"text\", \"text\": \"{\\\"title\\\":\\\"Background history\\\"}\"}], \"stop_reason\": \"end_turn\", \"usage\": {\"input_tokens\": 100, \"output_tokens\": 10}}"
  26. }
  27. },
  28. {
  29. "id": "bg-history-empty-launch",
  30. "description": "bg-history-empty-launch",
  31. "metadata": {
  32. "kind": "main",
  33. "source": "synthetic",
  34. "timingPolicy": "fast-tool-use",
  35. "syntheticReason": "固定后台结果空正文和非空历史,用真实 Agent 通知与 UI 验证折叠布局。"
  36. },
  37. "match": {
  38. "method": "POST",
  39. "pathIncludes": "/messages",
  40. "lastUserMessageIncludes": ["E2E_BG_HISTORY_EMPTY"],
  41. "bodyExcludes": [
  42. "Generate a concise title",
  43. "CRITICAL: Respond with TEXT ONLY",
  44. "toolu_bg_history_empty"
  45. ],
  46. "lastUserMessageExcludes": ["E2E_BG_HISTORY_EMPTY_CHILD", "<task-notification>"]
  47. },
  48. "response": {
  49. "statusCode": 200,
  50. "toolUse": {
  51. "id": "toolu_bg_history_empty",
  52. "name": "Agent",
  53. "input": {
  54. "description": "E2E_BG_HISTORY_EMPTY",
  55. "prompt": "E2E_BG_HISTORY_EMPTY_CHILD",
  56. "run_in_background": true,
  57. "subagent_type": "general-purpose"
  58. }
  59. }
  60. }
  61. },
  62. {
  63. "id": "bg-history-empty-ack",
  64. "description": "bg-history-empty-ack",
  65. "metadata": {
  66. "kind": "main",
  67. "source": "synthetic",
  68. "timingPolicy": "fast-text",
  69. "syntheticReason": "固定后台结果空正文和非空历史,用真实 Agent 通知与 UI 验证折叠布局。"
  70. },
  71. "match": {
  72. "method": "POST",
  73. "pathIncludes": "/messages",
  74. "lastUserMessageIncludes": ["Async agent launched successfully"],
  75. "bodyIncludes": [
  76. "toolu_bg_history_empty",
  77. "Async agent launched successfully",
  78. "E2E_BG_HISTORY_EMPTY"
  79. ],
  80. "lastUserMessageExcludes": ["<task-notification>"],
  81. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  82. },
  83. "response": {
  84. "statusCode": 200,
  85. "text": "E2E_BG_HISTORY_EMPTY_ACK"
  86. }
  87. },
  88. {
  89. "id": "bg-history-empty-child",
  90. "description": "bg-history-empty-child",
  91. "metadata": {
  92. "kind": "subagent",
  93. "source": "synthetic",
  94. "timingPolicy": "controlled-stream",
  95. "syntheticReason": "固定后台结果空正文和非空历史,用真实 Agent 通知与 UI 验证折叠布局。"
  96. },
  97. "match": {
  98. "method": "POST",
  99. "pathIncludes": "/messages",
  100. "lastUserMessageIncludes": ["E2E_BG_HISTORY_EMPTY_CHILD"],
  101. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  102. "lastUserMessageExcludes": ["<task-notification>"]
  103. },
  104. "response": {
  105. "statusCode": 200,
  106. "headers": {
  107. "content-type": "text/event-stream"
  108. },
  109. "chunks": [
  110. {
  111. "offsetMs": 0,
  112. "text": "event: message_start\ndata: {\"type\": \"message_start\", \"message\": {\"id\": \"msg_bg-history-empty\", \"type\": \"message\", \"role\": \"assistant\", \"model\": \"deepseek-v4-flash\", \"content\": [], \"stop_reason\": null, \"usage\": {\"input_tokens\": 100, \"output_tokens\": 0}}}\n\n"
  113. },
  114. {
  115. "offsetMs": 0,
  116. "text": "event: content_block_start\ndata: {\"type\": \"content_block_start\", \"index\": 0, \"content_block\": {\"type\": \"text\", \"text\": \"\"}}\n\n"
  117. },
  118. {
  119. "offsetMs": 0,
  120. "text": "event: content_block_delta\ndata: {\"type\": \"content_block_delta\", \"index\": 0, \"delta\": {\"type\": \"text_delta\", \"text\": \"E2E_BG_HISTORY_EMPTY_CHILD_RESULT\"}}\n\n"
  121. },
  122. {
  123. "offsetMs": 0,
  124. "text": "event: content_block_stop\ndata: {\"type\": \"content_block_stop\", \"index\": 0}\n\n"
  125. },
  126. {
  127. "offsetMs": 0,
  128. "text": "event: message_delta\ndata: {\"type\": \"message_delta\", \"delta\": {\"stop_reason\": \"end_turn\", \"stop_sequence\": null}, \"usage\": {\"output_tokens\": 10}}\n\n"
  129. },
  130. {
  131. "offsetMs": 0,
  132. "text": "event: message_stop\ndata: {\"type\": \"message_stop\"}\n\n"
  133. }
  134. ],
  135. "releaseAfterChunks": 3
  136. }
  137. },
  138. {
  139. "id": "bg-history-empty-empty",
  140. "description": "bg-history-empty-empty",
  141. "metadata": {
  142. "kind": "main",
  143. "source": "synthetic",
  144. "timingPolicy": "fast-text",
  145. "syntheticReason": "固定后台结果空正文和非空历史,用真实 Agent 通知与 UI 验证折叠布局。"
  146. },
  147. "match": {
  148. "method": "POST",
  149. "pathIncludes": "/messages",
  150. "lastUserMessageIncludes": [
  151. "<task-notification>",
  152. "<tool-use-id>toolu_bg_history_empty</tool-use-id>",
  153. "E2E_BG_HISTORY_EMPTY_CHILD_RESULT"
  154. ],
  155. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  156. },
  157. "response": {
  158. "statusCode": 200,
  159. "text": ""
  160. }
  161. },
  162. {
  163. "id": "bg-history-history-launch",
  164. "description": "bg-history-history-launch",
  165. "metadata": {
  166. "kind": "main",
  167. "source": "synthetic",
  168. "timingPolicy": "fast-tool-use",
  169. "syntheticReason": "固定后台结果空正文和非空历史,用真实 Agent 通知与 UI 验证折叠布局。"
  170. },
  171. "match": {
  172. "method": "POST",
  173. "pathIncludes": "/messages",
  174. "lastUserMessageIncludes": ["E2E_BG_HISTORY_HISTORY"],
  175. "bodyExcludes": [
  176. "Generate a concise title",
  177. "CRITICAL: Respond with TEXT ONLY",
  178. "toolu_bg_history_history"
  179. ],
  180. "lastUserMessageExcludes": ["E2E_BG_HISTORY_HISTORY_CHILD", "<task-notification>"]
  181. },
  182. "response": {
  183. "statusCode": 200,
  184. "toolUse": {
  185. "id": "toolu_bg_history_history",
  186. "name": "Agent",
  187. "input": {
  188. "description": "E2E_BG_HISTORY_HISTORY",
  189. "prompt": "E2E_BG_HISTORY_HISTORY_CHILD",
  190. "run_in_background": true,
  191. "subagent_type": "general-purpose"
  192. }
  193. }
  194. }
  195. },
  196. {
  197. "id": "bg-history-history-ack",
  198. "description": "bg-history-history-ack",
  199. "metadata": {
  200. "kind": "main",
  201. "source": "synthetic",
  202. "timingPolicy": "fast-text",
  203. "syntheticReason": "固定后台结果空正文和非空历史,用真实 Agent 通知与 UI 验证折叠布局。"
  204. },
  205. "match": {
  206. "method": "POST",
  207. "pathIncludes": "/messages",
  208. "lastUserMessageIncludes": ["Async agent launched successfully"],
  209. "bodyIncludes": [
  210. "toolu_bg_history_history",
  211. "Async agent launched successfully",
  212. "E2E_BG_HISTORY_HISTORY"
  213. ],
  214. "lastUserMessageExcludes": ["<task-notification>"],
  215. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  216. },
  217. "response": {
  218. "statusCode": 200,
  219. "text": "E2E_BG_HISTORY_HISTORY_ACK"
  220. }
  221. },
  222. {
  223. "id": "bg-history-history-child",
  224. "description": "bg-history-history-child",
  225. "metadata": {
  226. "kind": "subagent",
  227. "source": "synthetic",
  228. "timingPolicy": "controlled-stream",
  229. "syntheticReason": "固定后台结果空正文和非空历史,用真实 Agent 通知与 UI 验证折叠布局。"
  230. },
  231. "match": {
  232. "method": "POST",
  233. "pathIncludes": "/messages",
  234. "lastUserMessageIncludes": ["E2E_BG_HISTORY_HISTORY_CHILD"],
  235. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  236. "lastUserMessageExcludes": ["<task-notification>"]
  237. },
  238. "response": {
  239. "statusCode": 200,
  240. "headers": {
  241. "content-type": "text/event-stream"
  242. },
  243. "chunks": [
  244. {
  245. "offsetMs": 0,
  246. "text": "event: message_start\ndata: {\"type\": \"message_start\", \"message\": {\"id\": \"msg_bg-history-history\", \"type\": \"message\", \"role\": \"assistant\", \"model\": \"deepseek-v4-flash\", \"content\": [], \"stop_reason\": null, \"usage\": {\"input_tokens\": 100, \"output_tokens\": 0}}}\n\n"
  247. },
  248. {
  249. "offsetMs": 0,
  250. "text": "event: content_block_start\ndata: {\"type\": \"content_block_start\", \"index\": 0, \"content_block\": {\"type\": \"text\", \"text\": \"\"}}\n\n"
  251. },
  252. {
  253. "offsetMs": 0,
  254. "text": "event: content_block_delta\ndata: {\"type\": \"content_block_delta\", \"index\": 0, \"delta\": {\"type\": \"text_delta\", \"text\": \"E2E_BG_HISTORY_HISTORY_CHILD_RESULT\"}}\n\n"
  255. },
  256. {
  257. "offsetMs": 0,
  258. "text": "event: content_block_stop\ndata: {\"type\": \"content_block_stop\", \"index\": 0}\n\n"
  259. },
  260. {
  261. "offsetMs": 0,
  262. "text": "event: message_delta\ndata: {\"type\": \"message_delta\", \"delta\": {\"stop_reason\": \"end_turn\", \"stop_sequence\": null}, \"usage\": {\"output_tokens\": 10}}\n\n"
  263. },
  264. {
  265. "offsetMs": 0,
  266. "text": "event: message_stop\ndata: {\"type\": \"message_stop\"}\n\n"
  267. }
  268. ],
  269. "releaseAfterChunks": 3
  270. }
  271. },
  272. {
  273. "id": "bg-history-history-tool",
  274. "description": "bg-history-history-tool",
  275. "metadata": {
  276. "kind": "main",
  277. "source": "synthetic",
  278. "timingPolicy": "fast-tool-use",
  279. "syntheticReason": "固定后台结果空正文和非空历史,用真实 Agent 通知与 UI 验证折叠布局。"
  280. },
  281. "match": {
  282. "method": "POST",
  283. "pathIncludes": "/messages",
  284. "lastUserMessageIncludes": [
  285. "<task-notification>",
  286. "<tool-use-id>toolu_bg_history_history</tool-use-id>",
  287. "E2E_BG_HISTORY_HISTORY_CHILD_RESULT"
  288. ],
  289. "bodyExcludes": [
  290. "Generate a concise title",
  291. "CRITICAL: Respond with TEXT ONLY",
  292. "toolu_bg_history_probe"
  293. ]
  294. },
  295. "response": {
  296. "statusCode": 200,
  297. "toolUse": {
  298. "id": "toolu_bg_history_probe",
  299. "name": "Bash",
  300. "input": {
  301. "command": "echo E2E_BG_HISTORY_TOOL_RESULT",
  302. "description": "E2E_BG_HISTORY_TOOL"
  303. }
  304. }
  305. }
  306. },
  307. {
  308. "id": "bg-history-history-final",
  309. "description": "bg-history-history-final",
  310. "metadata": {
  311. "kind": "main",
  312. "source": "synthetic",
  313. "timingPolicy": "fast-text",
  314. "syntheticReason": "固定后台结果空正文和非空历史,用真实 Agent 通知与 UI 验证折叠布局。"
  315. },
  316. "match": {
  317. "method": "POST",
  318. "pathIncludes": "/messages",
  319. "lastUserMessageIncludes": ["E2E_BG_HISTORY_TOOL_RESULT"],
  320. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  321. "bodyIncludes": ["toolu_bg_history_probe", "E2E_BG_HISTORY_TOOL_RESULT"]
  322. },
  323. "response": {
  324. "statusCode": 200,
  325. "text": "E2E_BG_HISTORY_HISTORY_FINAL"
  326. }
  327. }
  328. ]
  329. }