conversation-session-v4-stop-queue.json 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-v4-stop-queue",
  4. "spec": "./test/e2e/conversation-session/queue/conversation-session-v4-stop-queue.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "v4-stop-queue-title",
  8. "description": "E2E_V4_HELD_SLOW 首发的 case-local 标题生成响应。",
  9. "metadata": {
  10. "kind": "common",
  11. "timingPolicy": "fast-text",
  12. "source": "synthetic",
  13. "syntheticReason": "E2E_V4_HELD_SLOW 首发会触发默认 title sidecar;固定 case-local 标题响应,避免 default replay 回退 legacy provider-basic,并用该首发 marker 隔离跨 case 匹配。"
  14. },
  15. "match": {
  16. "method": "POST",
  17. "pathIncludes": "/messages",
  18. "bodyIncludes": ["Generate a concise title", "E2E_V4_HELD_SLOW"]
  19. },
  20. "response": {
  21. "statusCode": 200,
  22. "text": {
  23. "id": "v4-stop-queue-title",
  24. "inputTokens": 64,
  25. "outputTokens": 8,
  26. "text": "{\"title\":\"V4 Stop Queue E2E\"}"
  27. }
  28. }
  29. },
  30. {
  31. "id": "v4-stop-queue-q1",
  32. "description": "held queue 项 1 的消费回复(sendQueuedNow / drain 后可见)。",
  33. "metadata": {
  34. "kind": "main",
  35. "timingPolicy": "fast-text",
  36. "source": "synthetic",
  37. "syntheticReason": "held queue 项被显式消费后需要可断言的回复哨兵。"
  38. },
  39. "match": {
  40. "method": "POST",
  41. "pathIncludes": "/messages",
  42. "lastUserMessageIncludes": ["E2E_V4_HELD_Q1"],
  43. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  44. },
  45. "response": {
  46. "statusCode": 200,
  47. "statusMessage": "OK",
  48. "headers": {
  49. "cache-control": "no-cache",
  50. "content-type": "text/event-stream; charset=utf-8"
  51. },
  52. "chunks": [
  53. {
  54. "offsetMs": 0,
  55. "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"v4-held-q1\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":90,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":0,\"service_tier\":\"standard\"}}}\n\n"
  56. },
  57. {
  58. "offsetMs": 100,
  59. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
  60. },
  61. {
  62. "offsetMs": 200,
  63. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"V4_HELD_Q1_REPLY\"}}\n\n"
  64. },
  65. {
  66. "offsetMs": 300,
  67. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
  68. },
  69. {
  70. "offsetMs": 400,
  71. "text": "event: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":90,\"output_tokens\":6,\"service_tier\":\"standard\"}}\n\n"
  72. },
  73. {
  74. "offsetMs": 500,
  75. "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  76. }
  77. ],
  78. "text": {
  79. "id": "v4-held-q1",
  80. "inputTokens": 90,
  81. "outputTokens": 6,
  82. "text": "V4_HELD_Q1_REPLY"
  83. }
  84. }
  85. },
  86. {
  87. "id": "v4-stop-queue-q2",
  88. "description": "暂停队列项 2 在继续自动消费后的 FIFO 回复。",
  89. "metadata": {
  90. "kind": "main",
  91. "timingPolicy": "fast-text",
  92. "source": "synthetic",
  93. "syntheticReason": "B14 需要第二个可区分的回复哨兵,证明点击继续后 Q1/Q2 由 CLI 按 FIFO 消费到空。"
  94. },
  95. "match": {
  96. "method": "POST",
  97. "pathIncludes": "/messages",
  98. "lastUserMessageIncludes": ["E2E_V4_HELD_Q2"],
  99. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  100. },
  101. "response": {
  102. "statusCode": 200,
  103. "statusMessage": "OK",
  104. "headers": {
  105. "cache-control": "no-cache",
  106. "content-type": "text/event-stream; charset=utf-8"
  107. },
  108. "chunks": [
  109. {
  110. "offsetMs": 0,
  111. "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"v4-held-q2\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":90,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":0,\"service_tier\":\"standard\"}}}\n\n"
  112. },
  113. {
  114. "offsetMs": 100,
  115. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
  116. },
  117. {
  118. "offsetMs": 200,
  119. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"V4_HELD_Q2_REPLY\"}}\n\n"
  120. },
  121. {
  122. "offsetMs": 300,
  123. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
  124. },
  125. {
  126. "offsetMs": 400,
  127. "text": "event: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":90,\"output_tokens\":6,\"service_tier\":\"standard\"}}\n\n"
  128. },
  129. {
  130. "offsetMs": 500,
  131. "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  132. }
  133. ],
  134. "text": {
  135. "id": "v4-held-q2",
  136. "inputTokens": 90,
  137. "outputTokens": 6,
  138. "text": "V4_HELD_Q2_REPLY"
  139. }
  140. }
  141. },
  142. {
  143. "id": "v4-stop-queue-keep-send",
  144. "description": "暂停队列 modal 选择保留并发送后的受控慢流回复。",
  145. "metadata": {
  146. "kind": "main",
  147. "timingPolicy": "controlled-stream",
  148. "source": "synthetic",
  149. "syntheticReason": "B06 需要可断言的 keepQueueAndSend 回复;B15 还需要稳定 running 窗口,在当前流完成前点击继续并证明旧暂停队首不抢占。"
  150. },
  151. "match": {
  152. "method": "POST",
  153. "pathIncludes": "/messages",
  154. "lastUserMessageIncludes": ["E2E_V4_HELD_KEEP"],
  155. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  156. },
  157. "response": {
  158. "statusCode": 200,
  159. "statusMessage": "OK",
  160. "headers": {
  161. "cache-control": "no-cache",
  162. "content-type": "text/event-stream; charset=utf-8"
  163. },
  164. "chunks": [
  165. {
  166. "offsetMs": 0,
  167. "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"v4-held-keep\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":95,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":0,\"service_tier\":\"standard\"}}}\n\n"
  168. },
  169. {
  170. "offsetMs": 100,
  171. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
  172. },
  173. {
  174. "offsetMs": 200,
  175. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"V4_HELD_KEEP_STREAMING \"}}\n\n"
  176. },
  177. {
  178. "offsetMs": 3500,
  179. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"V4_HELD_KEEP_REPLY\"}}\n\n"
  180. },
  181. {
  182. "offsetMs": 3600,
  183. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
  184. },
  185. {
  186. "offsetMs": 3700,
  187. "text": "event: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":95,\"output_tokens\":6,\"service_tier\":\"standard\"}}\n\n"
  188. },
  189. {
  190. "offsetMs": 3800,
  191. "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  192. }
  193. ],
  194. "text": {
  195. "id": "v4-held-keep",
  196. "inputTokens": 95,
  197. "outputTokens": 6,
  198. "text": "V4_HELD_KEEP_STREAMING V4_HELD_KEEP_REPLY"
  199. }
  200. }
  201. },
  202. {
  203. "id": "v4-stop-queue-clear-send",
  204. "description": "暂停队列 modal 选择“清空队列”后的新一轮回复。",
  205. "metadata": {
  206. "kind": "main",
  207. "timingPolicy": "fast-text",
  208. "source": "synthetic",
  209. "syntheticReason": "clearQueueAndSend 需要可断言的新回复哨兵,同时 queue 清空。"
  210. },
  211. "match": {
  212. "method": "POST",
  213. "pathIncludes": "/messages",
  214. "lastUserMessageIncludes": ["E2E_V4_HELD_CLEAR"],
  215. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  216. },
  217. "response": {
  218. "statusCode": 200,
  219. "statusMessage": "OK",
  220. "headers": {
  221. "cache-control": "no-cache",
  222. "content-type": "text/event-stream; charset=utf-8"
  223. },
  224. "chunks": [
  225. {
  226. "offsetMs": 0,
  227. "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"v4-held-clear\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":95,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":0,\"service_tier\":\"standard\"}}}\n\n"
  228. },
  229. {
  230. "offsetMs": 100,
  231. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
  232. },
  233. {
  234. "offsetMs": 200,
  235. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"V4_HELD_CLEAR_REPLY\"}}\n\n"
  236. },
  237. {
  238. "offsetMs": 300,
  239. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
  240. },
  241. {
  242. "offsetMs": 400,
  243. "text": "event: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":95,\"output_tokens\":6,\"service_tier\":\"standard\"}}\n\n"
  244. },
  245. {
  246. "offsetMs": 500,
  247. "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  248. }
  249. ],
  250. "text": {
  251. "id": "v4-held-clear",
  252. "inputTokens": 95,
  253. "outputTokens": 6,
  254. "text": "V4_HELD_CLEAR_REPLY"
  255. }
  256. }
  257. },
  258. {
  259. "id": "v4-stop-queue-slow-turn",
  260. "description": "B02/B04 held queue 门禁:可控慢流首轮,保持 running 以便入队后 stop。",
  261. "metadata": {
  262. "kind": "main",
  263. "timingPolicy": "controlled-stream",
  264. "source": "synthetic",
  265. "syntheticReason": "stop 保留 queue 的断言需要稳定 running 窗口(入队两条后 stop)。"
  266. },
  267. "match": {
  268. "method": "POST",
  269. "pathIncludes": "/messages",
  270. "lastUserMessageIncludes": ["E2E_V4_HELD_SLOW"],
  271. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  272. "lastUserMessageExcludes": [
  273. "E2E_V4_HELD_KEEP",
  274. "E2E_V4_HELD_CLEAR",
  275. "E2E_V4_HELD_Q1",
  276. "E2E_V4_HELD_Q2"
  277. ]
  278. },
  279. "response": {
  280. "statusCode": 200,
  281. "statusMessage": "OK",
  282. "headers": {
  283. "cache-control": "no-cache",
  284. "content-type": "text/event-stream; charset=utf-8"
  285. },
  286. "chunks": [
  287. {
  288. "offsetMs": 0,
  289. "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"v4-held-slow\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":80,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":0,\"service_tier\":\"standard\"}}}\n\n"
  290. },
  291. {
  292. "offsetMs": 250,
  293. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
  294. },
  295. {
  296. "offsetMs": 500,
  297. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"V4_HELD_STREAMING \"}}\n\n"
  298. },
  299. {
  300. "offsetMs": 45000,
  301. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
  302. },
  303. {
  304. "offsetMs": 45100,
  305. "text": "event: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":80,\"output_tokens\":4,\"service_tier\":\"standard\"}}\n\n"
  306. },
  307. {
  308. "offsetMs": 45200,
  309. "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  310. }
  311. ],
  312. "text": {
  313. "id": "v4-held-slow",
  314. "inputTokens": 80,
  315. "outputTokens": 4,
  316. "text": "V4_HELD_STREAMING"
  317. }
  318. }
  319. }
  320. ]
  321. }