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

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