conversation-session-goal-queue.json 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-goal-queue",
  4. "spec": "./test/e2e/conversation-session/conversation-session-goal-queue.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "upstream-goal-queue-base-slow-stream",
  8. "description": "Goal queue 编辑场景的基础慢流,稳定制造 mixed queue 入队窗口。",
  9. "metadata": {
  10. "kind": "main",
  11. "timingPolicy": "controlled-stream",
  12. "source": "synthetic",
  13. "syntheticReason": "goal/text 混合 queue 需要当前轮保持 running;真实 provider 过快完成会让输入不再进入队列。"
  14. },
  15. "maxMatches": 1,
  16. "match": {
  17. "method": "POST",
  18. "pathIncludes": "/messages",
  19. "bodyIncludes": [
  20. "E2E_SLOW_STREAM",
  21. "E2E_GOAL_QUEUE_BASE"
  22. ],
  23. "bodyExcludes": [
  24. "Generate a concise title",
  25. "CRITICAL: Respond with TEXT ONLY"
  26. ],
  27. "lastUserMessageIncludes": [
  28. "E2E_GOAL_QUEUE_BASE"
  29. ]
  30. },
  31. "response": {
  32. "statusCode": 200,
  33. "statusMessage": "OK",
  34. "headers": {
  35. "cache-control": "no-cache",
  36. "content-type": "text/event-stream; charset=utf-8"
  37. },
  38. "events": [
  39. {
  40. "sequence": 0,
  41. "offsetMs": 0,
  42. "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-goal-queue-base-slow-stream\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":120,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":0,\"service_tier\":\"standard\"}}}\n\n"
  43. },
  44. {
  45. "sequence": 1,
  46. "offsetMs": 250,
  47. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
  48. },
  49. {
  50. "sequence": 2,
  51. "offsetMs": 700,
  52. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"deep\"}}\n\n"
  53. },
  54. {
  55. "sequence": 3,
  56. "offsetMs": 60000,
  57. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"seek-e2e-ok\"}}\n\n"
  58. },
  59. {
  60. "sequence": 4,
  61. "offsetMs": 60100,
  62. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
  63. },
  64. {
  65. "sequence": 5,
  66. "offsetMs": 60200,
  67. "text": "event: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":120,\"output_tokens\":12,\"service_tier\":\"standard\"}}\n\n"
  68. },
  69. {
  70. "sequence": 6,
  71. "offsetMs": 60300,
  72. "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  73. }
  74. ]
  75. }
  76. },
  77. {
  78. "id": "upstream-goal-queue-order-base-slow-stream",
  79. "description": "Goal queue 顺序消费场景的基础慢流。",
  80. "metadata": {
  81. "kind": "main",
  82. "timingPolicy": "controlled-stream",
  83. "source": "synthetic",
  84. "syntheticReason": "queued goal 顺序消费前需要基础轮保持 running;真实 provider 过快完成会跳过 held queue 语义。"
  85. },
  86. "maxMatches": 1,
  87. "match": {
  88. "method": "POST",
  89. "pathIncludes": "/messages",
  90. "bodyIncludes": [
  91. "E2E_SLOW_STREAM",
  92. "E2E_GOAL_QUEUE_ORDER_BASE"
  93. ],
  94. "bodyExcludes": [
  95. "Generate a concise title",
  96. "CRITICAL: Respond with TEXT ONLY"
  97. ],
  98. "lastUserMessageIncludes": [
  99. "E2E_GOAL_QUEUE_ORDER_BASE"
  100. ]
  101. },
  102. "response": {
  103. "statusCode": 200,
  104. "statusMessage": "OK",
  105. "headers": {
  106. "cache-control": "no-cache",
  107. "content-type": "text/event-stream; charset=utf-8"
  108. },
  109. "events": [
  110. {
  111. "sequence": 0,
  112. "offsetMs": 0,
  113. "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-goal-queue-order-base-slow-stream\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":120,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":0,\"service_tier\":\"standard\"}}}\n\n"
  114. },
  115. {
  116. "sequence": 1,
  117. "offsetMs": 250,
  118. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
  119. },
  120. {
  121. "sequence": 2,
  122. "offsetMs": 700,
  123. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"deep\"}}\n\n"
  124. },
  125. {
  126. "sequence": 3,
  127. "offsetMs": 60000,
  128. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"seek-e2e-ok\"}}\n\n"
  129. },
  130. {
  131. "sequence": 4,
  132. "offsetMs": 60100,
  133. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
  134. },
  135. {
  136. "sequence": 5,
  137. "offsetMs": 60200,
  138. "text": "event: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":120,\"output_tokens\":12,\"service_tier\":\"standard\"}}\n\n"
  139. },
  140. {
  141. "sequence": 6,
  142. "offsetMs": 60300,
  143. "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  144. }
  145. ]
  146. }
  147. },
  148. {
  149. "id": "upstream-goal-queue-order-first-continuation-slow",
  150. "description": "第一条 queued goal 立即发送后的 continuation 慢流。",
  151. "metadata": {
  152. "kind": "main",
  153. "timingPolicy": "controlled-stream",
  154. "source": "synthetic",
  155. "syntheticReason": "测试需要在第一条 queued goal 已成为 active target 且仍 streaming 时验证可 stop。"
  156. },
  157. "maxMatches": 1,
  158. "match": {
  159. "method": "POST",
  160. "pathIncludes": "/messages",
  161. "bodyIncludes": [
  162. "E2E_GOAL_QUEUE_ORDER_FIRST",
  163. "Continue working toward the active session goal"
  164. ],
  165. "bodyExcludes": [
  166. "Generate a concise title",
  167. "CRITICAL: Respond with TEXT ONLY",
  168. "Verify whether the active session goal"
  169. ]
  170. },
  171. "response": {
  172. "statusCode": 200,
  173. "statusMessage": "OK",
  174. "headers": {
  175. "cache-control": "no-cache",
  176. "content-type": "text/event-stream; charset=utf-8"
  177. },
  178. "events": [
  179. {
  180. "sequence": 0,
  181. "offsetMs": 0,
  182. "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-goal-queue-order-first-continuation-slow\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":120,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":0,\"service_tier\":\"standard\"}}}\n\n"
  183. },
  184. {
  185. "sequence": 1,
  186. "offsetMs": 250,
  187. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
  188. },
  189. {
  190. "sequence": 2,
  191. "offsetMs": 700,
  192. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"deep\"}}\n\n"
  193. },
  194. {
  195. "sequence": 3,
  196. "offsetMs": 60000,
  197. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"seek-e2e-ok\"}}\n\n"
  198. },
  199. {
  200. "sequence": 4,
  201. "offsetMs": 60100,
  202. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
  203. },
  204. {
  205. "sequence": 5,
  206. "offsetMs": 60200,
  207. "text": "event: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":120,\"output_tokens\":12,\"service_tier\":\"standard\"}}\n\n"
  208. },
  209. {
  210. "sequence": 6,
  211. "offsetMs": 60300,
  212. "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  213. }
  214. ]
  215. }
  216. },
  217. {
  218. "id": "upstream-goal-queue-order-second-continuation-slow",
  219. "description": "第二条 queued goal 立即发送后的 continuation 慢流。",
  220. "metadata": {
  221. "kind": "main",
  222. "timingPolicy": "controlled-stream",
  223. "source": "synthetic",
  224. "syntheticReason": "测试需要在第二条 queued goal 覆盖第一目标且仍 streaming 时验证最终 queue 清空。"
  225. },
  226. "maxMatches": 1,
  227. "match": {
  228. "method": "POST",
  229. "pathIncludes": "/messages",
  230. "bodyIncludes": [
  231. "E2E_GOAL_QUEUE_ORDER_SECOND",
  232. "Continue working toward the active session goal"
  233. ],
  234. "bodyExcludes": [
  235. "Generate a concise title",
  236. "CRITICAL: Respond with TEXT ONLY",
  237. "Verify whether the active session goal"
  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. "events": [
  248. {
  249. "sequence": 0,
  250. "offsetMs": 0,
  251. "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-goal-queue-order-second-continuation-slow\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":120,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":0,\"service_tier\":\"standard\"}}}\n\n"
  252. },
  253. {
  254. "sequence": 1,
  255. "offsetMs": 250,
  256. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
  257. },
  258. {
  259. "sequence": 2,
  260. "offsetMs": 700,
  261. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"deep\"}}\n\n"
  262. },
  263. {
  264. "sequence": 3,
  265. "offsetMs": 60000,
  266. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"seek-e2e-ok\"}}\n\n"
  267. },
  268. {
  269. "sequence": 4,
  270. "offsetMs": 60100,
  271. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
  272. },
  273. {
  274. "sequence": 5,
  275. "offsetMs": 60200,
  276. "text": "event: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":120,\"output_tokens\":12,\"service_tier\":\"standard\"}}\n\n"
  277. },
  278. {
  279. "sequence": 6,
  280. "offsetMs": 60300,
  281. "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  282. }
  283. ]
  284. }
  285. },
  286. {
  287. "id": "upstream-goal-queue-first-contract",
  288. "description": "第一条 mixed queue goal marker 合同占位;running 中不应立即发 provider。",
  289. "metadata": {
  290. "kind": "main",
  291. "timingPolicy": "fast-text",
  292. "source": "synthetic",
  293. "syntheticReason": "running 中 /goal 只进入本地 queue;fixture 只覆盖 marker 合同。"
  294. },
  295. "maxMatches": 0,
  296. "match": {
  297. "method": "POST",
  298. "pathIncludes": "/messages",
  299. "bodyIncludes": [
  300. "E2E_GOAL_QUEUE_FIRST"
  301. ],
  302. "bodyExcludes": [
  303. "Generate a concise title",
  304. "CRITICAL: Respond with TEXT ONLY"
  305. ]
  306. },
  307. "response": {
  308. "statusCode": 200,
  309. "text": {
  310. "id": "upstream-e2e-goal-queue-first-should-not-send",
  311. "inputTokens": 128,
  312. "outputTokens": 12,
  313. "text": "upstream-e2e-ok"
  314. }
  315. }
  316. },
  317. {
  318. "id": "upstream-goal-queue-text-contract",
  319. "description": "mixed queue 普通文本 marker 合同占位;running 中不应立即发 provider。",
  320. "metadata": {
  321. "kind": "main",
  322. "timingPolicy": "fast-text",
  323. "source": "synthetic",
  324. "syntheticReason": "running 中普通文本只进入本地 queue;fixture 只覆盖 marker 合同。"
  325. },
  326. "maxMatches": 0,
  327. "match": {
  328. "method": "POST",
  329. "pathIncludes": "/messages",
  330. "bodyIncludes": [
  331. "E2E_GOAL_QUEUE_TEXT"
  332. ],
  333. "bodyExcludes": [
  334. "Generate a concise title",
  335. "CRITICAL: Respond with TEXT ONLY"
  336. ]
  337. },
  338. "response": {
  339. "statusCode": 200,
  340. "text": {
  341. "id": "upstream-e2e-goal-queue-text-should-not-send",
  342. "inputTokens": 128,
  343. "outputTokens": 12,
  344. "text": "upstream-e2e-ok"
  345. }
  346. }
  347. },
  348. {
  349. "id": "upstream-goal-queue-second-contract",
  350. "description": "第二条 mixed queue goal marker 合同占位;running 中不应立即发 provider。",
  351. "metadata": {
  352. "kind": "main",
  353. "timingPolicy": "fast-text",
  354. "source": "synthetic",
  355. "syntheticReason": "running 中第二条 /goal 只进入本地 queue;fixture 只覆盖 marker 合同。"
  356. },
  357. "maxMatches": 0,
  358. "match": {
  359. "method": "POST",
  360. "pathIncludes": "/messages",
  361. "bodyIncludes": [
  362. "E2E_GOAL_QUEUE_SECOND"
  363. ],
  364. "bodyExcludes": [
  365. "Generate a concise title",
  366. "CRITICAL: Respond with TEXT ONLY"
  367. ]
  368. },
  369. "response": {
  370. "statusCode": 200,
  371. "text": {
  372. "id": "upstream-e2e-goal-queue-second-should-not-send",
  373. "inputTokens": 128,
  374. "outputTokens": 12,
  375. "text": "upstream-e2e-ok"
  376. }
  377. }
  378. },
  379. {
  380. "id": "upstream-goal-queue-second-edited-contract",
  381. "description": "编辑后的第二条 mixed queue goal marker 合同占位;保存编辑不应发 provider。",
  382. "metadata": {
  383. "kind": "main",
  384. "timingPolicy": "fast-text",
  385. "source": "synthetic",
  386. "syntheticReason": "queue edit 只改本地队列项,不应触发 provider;fixture 只覆盖 marker 合同。"
  387. },
  388. "maxMatches": 0,
  389. "match": {
  390. "method": "POST",
  391. "pathIncludes": "/messages",
  392. "bodyIncludes": [
  393. "E2E_GOAL_QUEUE_SECOND_EDITED"
  394. ],
  395. "bodyExcludes": [
  396. "Generate a concise title",
  397. "CRITICAL: Respond with TEXT ONLY"
  398. ]
  399. },
  400. "response": {
  401. "statusCode": 200,
  402. "text": {
  403. "id": "upstream-e2e-goal-queue-second-edited-should-not-send",
  404. "inputTokens": 128,
  405. "outputTokens": 12,
  406. "text": "upstream-e2e-ok"
  407. }
  408. }
  409. }
  410. ]
  411. }