conversation-session-model-switch-queue.json 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-model-switch-queue",
  4. "spec": "./test/e2e/conversation-session/conversation-session-model-switch-queue.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "upstream-model-switch-held-running-slow",
  8. "description": "N02 held queue 场景首轮慢流,稳定制造 stop 前 queue。",
  9. "metadata": {
  10. "kind": "main",
  11. "timingPolicy": "controlled-stream",
  12. "source": "synthetic",
  13. "syntheticReason": "模型切换 held queue 需要当前轮保持 streaming,真实模型可能过快完成。"
  14. },
  15. "maxMatches": 1,
  16. "match": {
  17. "method": "POST",
  18. "pathIncludes": "/messages",
  19. "bodyIncludes": [
  20. "E2E_SLOW_STREAM",
  21. "E2E_MODEL_SWITCH_HELD_RUNNING"
  22. ],
  23. "bodyExcludes": [
  24. "Generate a concise title",
  25. "CRITICAL: Respond with TEXT ONLY"
  26. ],
  27. "lastUserMessageIncludes": [
  28. "E2E_MODEL_SWITCH_HELD_RUNNING"
  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. "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-model-switch-held-running-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\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\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"-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",
  39. "events": [
  40. {
  41. "sequence": 0,
  42. "offsetMs": 0,
  43. "byteLength": 333,
  44. "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-model-switch-held-running-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"
  45. },
  46. {
  47. "sequence": 1,
  48. "offsetMs": 250,
  49. "byteLength": 120,
  50. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
  51. },
  52. {
  53. "sequence": 2,
  54. "offsetMs": 8000,
  55. "byteLength": 118,
  56. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"deep\"}}\n\n"
  57. },
  58. {
  59. "sequence": 3,
  60. "offsetMs": 16000,
  61. "byteLength": 118,
  62. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"seek\"}}\n\n"
  63. },
  64. {
  65. "sequence": 4,
  66. "offsetMs": 24000,
  67. "byteLength": 122,
  68. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"-e2e-ok\"}}\n\n"
  69. },
  70. {
  71. "sequence": 5,
  72. "offsetMs": 90000,
  73. "byteLength": 49,
  74. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
  75. },
  76. {
  77. "sequence": 6,
  78. "offsetMs": 90100,
  79. "byteLength": 179,
  80. "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"
  81. },
  82. {
  83. "sequence": 7,
  84. "offsetMs": 90200,
  85. "byteLength": 42,
  86. "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  87. }
  88. ]
  89. }
  90. },
  91. {
  92. "id": "upstream-model-switch-held-send-now-secondary",
  93. "description": "N02 held queue 点立即发送后的固定回复,用于断言请求使用 secondary 模型配置。",
  94. "metadata": {
  95. "kind": "main",
  96. "timingPolicy": "fast-text",
  97. "source": "synthetic",
  98. "syntheticReason": "核心断言在请求 capture 的 model/thought,响应只需稳定完成。"
  99. },
  100. "maxMatches": 1,
  101. "match": {
  102. "method": "POST",
  103. "pathIncludes": "/messages",
  104. "bodyIncludes": [
  105. "E2E_MODEL_SWITCH_HELD_SEND_NOW"
  106. ],
  107. "bodyExcludes": [
  108. "Generate a concise title",
  109. "CRITICAL: Respond with TEXT ONLY"
  110. ],
  111. "lastUserMessageIncludes": [
  112. "E2E_MODEL_SWITCH_HELD_SEND_NOW"
  113. ]
  114. },
  115. "response": {
  116. "statusCode": 200,
  117. "text": {
  118. "id": "upstream-e2e-model-switch-held-send-now-secondary",
  119. "inputTokens": 128,
  120. "outputTokens": 12,
  121. "text": "upstream-e2e-ok"
  122. }
  123. }
  124. },
  125. {
  126. "id": "upstream-model-switch-queue-running-slow",
  127. "description": "N02 auto drain 场景首轮慢流,给切 secondary 留出窗口。",
  128. "metadata": {
  129. "kind": "main",
  130. "timingPolicy": "controlled-stream",
  131. "source": "synthetic",
  132. "syntheticReason": "queued text 消费前切模型需要当前轮保持 streaming,真实模型可能过快完成。"
  133. },
  134. "maxMatches": 1,
  135. "match": {
  136. "method": "POST",
  137. "pathIncludes": "/messages",
  138. "bodyIncludes": [
  139. "E2E_SLOW_STREAM",
  140. "E2E_MODEL_SWITCH_QUEUE_RUNNING"
  141. ],
  142. "bodyExcludes": [
  143. "Generate a concise title",
  144. "CRITICAL: Respond with TEXT ONLY"
  145. ],
  146. "lastUserMessageIncludes": [
  147. "E2E_MODEL_SWITCH_QUEUE_RUNNING"
  148. ]
  149. },
  150. "response": {
  151. "statusCode": 200,
  152. "statusMessage": "OK",
  153. "headers": {
  154. "cache-control": "no-cache",
  155. "content-type": "text/event-stream; charset=utf-8"
  156. },
  157. "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-model-switch-queue-running-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\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\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"-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",
  158. "events": [
  159. {
  160. "sequence": 0,
  161. "offsetMs": 0,
  162. "byteLength": 333,
  163. "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-model-switch-queue-running-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"
  164. },
  165. {
  166. "sequence": 1,
  167. "offsetMs": 250,
  168. "byteLength": 120,
  169. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
  170. },
  171. {
  172. "sequence": 2,
  173. "offsetMs": 8000,
  174. "byteLength": 118,
  175. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"deep\"}}\n\n"
  176. },
  177. {
  178. "sequence": 3,
  179. "offsetMs": 16000,
  180. "byteLength": 118,
  181. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"seek\"}}\n\n"
  182. },
  183. {
  184. "sequence": 4,
  185. "offsetMs": 24000,
  186. "byteLength": 122,
  187. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"-e2e-ok\"}}\n\n"
  188. },
  189. {
  190. "sequence": 5,
  191. "offsetMs": 90000,
  192. "byteLength": 49,
  193. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
  194. },
  195. {
  196. "sequence": 6,
  197. "offsetMs": 90100,
  198. "byteLength": 179,
  199. "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"
  200. },
  201. {
  202. "sequence": 7,
  203. "offsetMs": 90200,
  204. "byteLength": 42,
  205. "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  206. }
  207. ]
  208. }
  209. },
  210. {
  211. "id": "upstream-model-switch-queue-auto-drain-secondary",
  212. "description": "N02 queued text auto drain 后固定回复,用于断言消费请求使用 secondary 模型配置。",
  213. "metadata": {
  214. "kind": "main",
  215. "timingPolicy": "fast-text",
  216. "source": "synthetic",
  217. "syntheticReason": "核心断言在请求 capture 的 model/thought,响应只需稳定完成。"
  218. },
  219. "maxMatches": 1,
  220. "match": {
  221. "method": "POST",
  222. "pathIncludes": "/messages",
  223. "bodyIncludes": [
  224. "E2E_MODEL_SWITCH_QUEUE_AUTO_DRAIN"
  225. ],
  226. "bodyExcludes": [
  227. "Generate a concise title",
  228. "CRITICAL: Respond with TEXT ONLY"
  229. ],
  230. "lastUserMessageIncludes": [
  231. "E2E_MODEL_SWITCH_QUEUE_AUTO_DRAIN"
  232. ]
  233. },
  234. "response": {
  235. "statusCode": 200,
  236. "text": {
  237. "id": "upstream-e2e-model-switch-queue-auto-drain-secondary",
  238. "inputTokens": 128,
  239. "outputTokens": 12,
  240. "text": "upstream-e2e-ok"
  241. }
  242. }
  243. },
  244. {
  245. "id": "upstream-model-switch-slow-marker-contract",
  246. "description": "N02 通用 slow stream marker 合同占位,实际由 held/queue running fixture 覆盖。",
  247. "metadata": {
  248. "kind": "main",
  249. "timingPolicy": "controlled-stream",
  250. "source": "synthetic",
  251. "syntheticReason": "用于让 fixture check 明确覆盖 spec 中的通用 E2E_SLOW_STREAM marker。"
  252. },
  253. "maxMatches": 0,
  254. "match": {
  255. "method": "POST",
  256. "pathIncludes": "/messages",
  257. "bodyIncludes": [
  258. "E2E_SLOW_STREAM"
  259. ],
  260. "bodyExcludes": [
  261. "Generate a concise title",
  262. "CRITICAL: Respond with TEXT ONLY"
  263. ],
  264. "lastUserMessageIncludes": [
  265. "E2E_SLOW_STREAM"
  266. ]
  267. },
  268. "response": {
  269. "statusCode": 200,
  270. "text": {
  271. "id": "upstream-e2e-model-switch-slow-marker-contract",
  272. "inputTokens": 128,
  273. "outputTokens": 12,
  274. "text": "upstream-e2e-ok"
  275. }
  276. }
  277. }
  278. ]
  279. }