conversation-session-goal-queue.json 17 KB

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