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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-model-switch-queue",
  4. "spec": "./test/e2e/conversation-session/models/conversation-session-model-switch-queue.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "conversation-session-model-switch-queue-title-sidecar",
  8. "description": "本例标题旁路响应。",
  9. "metadata": {
  10. "kind": "common",
  11. "source": "synthetic",
  12. "timingPolicy": "fast-text",
  13. "syntheticReason": "运行时证据显示标题旁路缺少响应;在本例显式登记固定标题,避免依赖 legacy fixture 或触发后台网络重试。"
  14. },
  15. "match": {
  16. "method": "POST",
  17. "pathIncludes": "/messages",
  18. "bodyIncludes": ["Generate a concise title"]
  19. },
  20. "response": {
  21. "statusCode": 200,
  22. "statusMessage": "OK",
  23. "headers": {
  24. "content-type": "application/json; charset=utf-8"
  25. },
  26. "body": "{\"id\":\"upstream-e2e-title-fixture\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[{\"type\":\"text\",\"text\":\"{\\\"title\\\":\\\"Upstream E2E Fixture\\\"}\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":125,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":24,\"service_tier\":\"standard\"}}"
  27. }
  28. },
  29. {
  30. "id": "upstream-model-switch-held-running-slow",
  31. "description": "N02 held queue 场景首轮慢流,稳定制造 stop 前 queue。",
  32. "metadata": {
  33. "kind": "main",
  34. "timingPolicy": "controlled-stream",
  35. "source": "synthetic",
  36. "syntheticReason": "模型切换 held queue 需要当前轮保持 streaming,真实模型可能过快完成。"
  37. },
  38. "maxMatches": 1,
  39. "match": {
  40. "method": "POST",
  41. "pathIncludes": "/messages",
  42. "bodyIncludes": ["E2E_SLOW_STREAM", "E2E_MODEL_SWITCH_HELD_RUNNING"],
  43. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  44. "lastUserMessageIncludes": ["E2E_MODEL_SWITCH_HELD_RUNNING"]
  45. },
  46. "response": {
  47. "statusCode": 200,
  48. "statusMessage": "OK",
  49. "headers": {
  50. "cache-control": "no-cache",
  51. "content-type": "text/event-stream; charset=utf-8"
  52. },
  53. "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",
  54. "releaseAfterChunks": 3,
  55. "chunks": [
  56. {
  57. "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",
  58. "delayMs": 0
  59. },
  60. {
  61. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n",
  62. "delayMs": 0
  63. },
  64. {
  65. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"deep\"}}\n\n",
  66. "delayMs": 0
  67. },
  68. {
  69. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"seek\"}}\n\n",
  70. "delayMs": 0
  71. },
  72. {
  73. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"-e2e-ok\"}}\n\n",
  74. "delayMs": 0
  75. },
  76. {
  77. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n",
  78. "delayMs": 0
  79. },
  80. {
  81. "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",
  82. "delayMs": 0
  83. },
  84. {
  85. "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n",
  86. "delayMs": 0
  87. }
  88. ]
  89. }
  90. },
  91. {
  92. "id": "upstream-model-switch-held-send-now-primary",
  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": ["E2E_MODEL_SWITCH_HELD_SEND_NOW"],
  105. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  106. "lastUserMessageIncludes": ["E2E_MODEL_SWITCH_HELD_SEND_NOW"]
  107. },
  108. "response": {
  109. "statusCode": 200,
  110. "text": {
  111. "id": "upstream-e2e-model-switch-held-send-now-primary",
  112. "inputTokens": 128,
  113. "outputTokens": 12,
  114. "text": "upstream-e2e-ok"
  115. }
  116. }
  117. },
  118. {
  119. "id": "upstream-model-switch-queue-running-slow",
  120. "description": "N02 auto drain 场景首轮慢流,给切 secondary 留出窗口。",
  121. "metadata": {
  122. "kind": "main",
  123. "timingPolicy": "controlled-stream",
  124. "source": "synthetic",
  125. "syntheticReason": "queued text 消费前切模型需要当前轮保持 streaming,真实模型可能过快完成。"
  126. },
  127. "maxMatches": 1,
  128. "match": {
  129. "method": "POST",
  130. "pathIncludes": "/messages",
  131. "bodyIncludes": ["E2E_SLOW_STREAM", "E2E_MODEL_SWITCH_QUEUE_RUNNING"],
  132. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  133. "lastUserMessageIncludes": ["E2E_MODEL_SWITCH_QUEUE_RUNNING"]
  134. },
  135. "response": {
  136. "statusCode": 200,
  137. "statusMessage": "OK",
  138. "headers": {
  139. "cache-control": "no-cache",
  140. "content-type": "text/event-stream; charset=utf-8"
  141. },
  142. "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",
  143. "releaseAfterChunks": 3,
  144. "chunks": [
  145. {
  146. "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",
  147. "delayMs": 0
  148. },
  149. {
  150. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n",
  151. "delayMs": 0
  152. },
  153. {
  154. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"deep\"}}\n\n",
  155. "delayMs": 0
  156. },
  157. {
  158. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"seek\"}}\n\n",
  159. "delayMs": 0
  160. },
  161. {
  162. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"-e2e-ok\"}}\n\n",
  163. "delayMs": 0
  164. },
  165. {
  166. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n",
  167. "delayMs": 0
  168. },
  169. {
  170. "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",
  171. "delayMs": 0
  172. },
  173. {
  174. "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n",
  175. "delayMs": 0
  176. }
  177. ]
  178. }
  179. },
  180. {
  181. "id": "upstream-model-switch-queue-auto-drain-primary",
  182. "description": "N02 queued text auto drain 后固定回复,用于断言消费请求使用 secondary 模型配置。",
  183. "metadata": {
  184. "kind": "main",
  185. "timingPolicy": "fast-text",
  186. "source": "synthetic",
  187. "syntheticReason": "核心断言在请求 capture 的 model/thought,响应只需稳定完成。"
  188. },
  189. "maxMatches": 1,
  190. "match": {
  191. "method": "POST",
  192. "pathIncludes": "/messages",
  193. "bodyIncludes": ["E2E_MODEL_SWITCH_QUEUE_AUTO_DRAIN"],
  194. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  195. "lastUserMessageIncludes": ["E2E_MODEL_SWITCH_QUEUE_AUTO_DRAIN"]
  196. },
  197. "response": {
  198. "statusCode": 200,
  199. "text": {
  200. "id": "upstream-e2e-model-switch-queue-auto-drain-primary",
  201. "inputTokens": 128,
  202. "outputTokens": 12,
  203. "text": "upstream-e2e-ok"
  204. }
  205. }
  206. },
  207. {
  208. "id": "upstream-model-switch-slow-marker-contract",
  209. "description": "N02 通用 slow stream marker 合同占位,实际由 held/queue running fixture 覆盖。",
  210. "metadata": {
  211. "kind": "main",
  212. "timingPolicy": "controlled-stream",
  213. "source": "synthetic",
  214. "syntheticReason": "用于让 fixture check 明确覆盖 spec 中的通用 E2E_SLOW_STREAM marker。"
  215. },
  216. "maxMatches": 0,
  217. "match": {
  218. "method": "POST",
  219. "pathIncludes": "/messages",
  220. "bodyIncludes": ["E2E_SLOW_STREAM"],
  221. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  222. "lastUserMessageIncludes": ["E2E_SLOW_STREAM"]
  223. },
  224. "response": {
  225. "statusCode": 200,
  226. "text": {
  227. "id": "upstream-e2e-model-switch-slow-marker-contract",
  228. "inputTokens": 128,
  229. "outputTokens": 12,
  230. "text": "upstream-e2e-ok"
  231. }
  232. }
  233. }
  234. ]
  235. }