conversation-session-stop-held-queue.json 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-stop-held-queue",
  4. "spec": "./test/e2e/conversation-session/queue/conversation-session-stop-held-queue.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "conversation-session-stop-held-queue-title-sidecar",
  8. "description": "本例标题旁路响应。",
  9. "metadata": {
  10. "kind": "common",
  11. "source": "synthetic",
  12. "timingPolicy": "fast-text",
  13. "syntheticReason": "默认回放捕获到显式发送成功后的标题旁路;本例登记固定响应以避免依赖共享旧 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-stop-held-queue-first-contract",
  31. "description": "首项暂停后由用户立即发送,返回成功正文以验证完成后其余项仍暂停。",
  32. "metadata": {
  33. "kind": "main",
  34. "timingPolicy": "fast-text",
  35. "source": "synthetic",
  36. "syntheticReason": "B08 允许显式立即发送首项一次;发送前及完成后,其余暂停项均不得自动消费。"
  37. },
  38. "maxMatches": 1,
  39. "match": {
  40. "method": "POST",
  41. "pathIncludes": "/messages",
  42. "bodyIncludes": ["E2E_STOP_HELD_QUEUE_FIRST"],
  43. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  44. "lastUserMessageIncludes": ["E2E_STOP_HELD_QUEUE_FIRST"]
  45. },
  46. "response": {
  47. "statusCode": 200,
  48. "text": {
  49. "id": "upstream-e2e-stop-held-queue-first-send-now",
  50. "inputTokens": 128,
  51. "outputTokens": 12,
  52. "text": "upstream-e2e-ok"
  53. }
  54. }
  55. },
  56. {
  57. "id": "upstream-stop-held-running-slow-stream",
  58. "description": "Stop held queue 首轮慢流,稳定制造 held queue 入队窗口。",
  59. "metadata": {
  60. "kind": "main",
  61. "timingPolicy": "controlled-stream",
  62. "source": "synthetic",
  63. "syntheticReason": "held queue 需要当前轮保持 running;真实 provider 过快完成会让后续输入变成普通新轮。"
  64. },
  65. "maxMatches": 1,
  66. "match": {
  67. "method": "POST",
  68. "pathIncludes": "/messages",
  69. "bodyIncludes": ["E2E_SLOW_STREAM", "E2E_STOP_HELD_RUNNING"],
  70. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  71. "lastUserMessageIncludes": ["E2E_STOP_HELD_RUNNING"]
  72. },
  73. "response": {
  74. "statusCode": 200,
  75. "statusMessage": "OK",
  76. "headers": {
  77. "cache-control": "no-cache",
  78. "content-type": "text/event-stream; charset=utf-8"
  79. },
  80. "chunks": [
  81. {
  82. "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-stop-held-running-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",
  83. "delayMs": 0
  84. },
  85. {
  86. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n",
  87. "delayMs": 0
  88. },
  89. {
  90. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"deep\"}}\n\n",
  91. "delayMs": 0
  92. },
  93. {
  94. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"seek-e2e-ok\"}}\n\n",
  95. "delayMs": 0
  96. },
  97. {
  98. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n",
  99. "delayMs": 0
  100. },
  101. {
  102. "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",
  103. "delayMs": 0
  104. },
  105. {
  106. "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n",
  107. "delayMs": 0
  108. }
  109. ],
  110. "releaseAfterChunks": 3
  111. }
  112. },
  113. {
  114. "id": "upstream-stop-held-queue-second-contract",
  115. "description": "第二条 held queue marker 合同占位;stop 后不应自动发送。",
  116. "metadata": {
  117. "kind": "main",
  118. "timingPolicy": "fast-text",
  119. "source": "synthetic",
  120. "syntheticReason": "held queue 的产品语义是保留队列且不自动消费;fixture 只覆盖 marker 合同。"
  121. },
  122. "maxMatches": 0,
  123. "match": {
  124. "method": "POST",
  125. "pathIncludes": "/messages",
  126. "bodyIncludes": ["E2E_STOP_HELD_QUEUE_SECOND"],
  127. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  128. "lastUserMessageIncludes": ["E2E_STOP_HELD_QUEUE_SECOND"]
  129. },
  130. "response": {
  131. "statusCode": 200,
  132. "text": {
  133. "id": "upstream-e2e-stop-held-queue-second-should-not-send",
  134. "inputTokens": 128,
  135. "outputTokens": 12,
  136. "text": "upstream-e2e-ok"
  137. }
  138. }
  139. },
  140. {
  141. "id": "upstream-stop-held-queue-third-contract",
  142. "description": "第三条 held queue marker 合同占位;stop 后不应自动发送。",
  143. "metadata": {
  144. "kind": "main",
  145. "timingPolicy": "fast-text",
  146. "source": "synthetic",
  147. "syntheticReason": "held queue 的产品语义是保留队列且不自动消费;fixture 只覆盖 marker 合同。"
  148. },
  149. "maxMatches": 0,
  150. "match": {
  151. "method": "POST",
  152. "pathIncludes": "/messages",
  153. "bodyIncludes": ["E2E_STOP_HELD_QUEUE_THIRD"],
  154. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  155. "lastUserMessageIncludes": ["E2E_STOP_HELD_QUEUE_THIRD"]
  156. },
  157. "response": {
  158. "statusCode": 200,
  159. "text": {
  160. "id": "upstream-e2e-stop-held-queue-third-should-not-send",
  161. "inputTokens": 128,
  162. "outputTokens": 12,
  163. "text": "upstream-e2e-ok"
  164. }
  165. }
  166. },
  167. {
  168. "id": "upstream-stop-held-queue-append-contract",
  169. "description": "B06 取消暂停队列发送确认后保留草稿,不产生 APPEND 请求。",
  170. "metadata": {
  171. "kind": "main",
  172. "timingPolicy": "fast-text",
  173. "source": "synthetic",
  174. "syntheticReason": "取消发送确认必须保留原草稿和队列,不发送 APPEND marker。"
  175. },
  176. "maxMatches": 0,
  177. "match": {
  178. "method": "POST",
  179. "pathIncludes": "/messages",
  180. "bodyIncludes": ["E2E_STOP_HELD_QUEUE_APPEND"],
  181. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  182. "lastUserMessageIncludes": ["E2E_STOP_HELD_QUEUE_APPEND"]
  183. },
  184. "response": {
  185. "statusCode": 200,
  186. "text": {
  187. "id": "upstream-e2e-stop-held-queue-append-should-not-send",
  188. "inputTokens": 128,
  189. "outputTokens": 12,
  190. "text": "upstream-e2e-ok"
  191. }
  192. }
  193. }
  194. ]
  195. }