conversation-session-v4-vertical-slice.json 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-v4-vertical-slice",
  4. "spec": "./test/e2e/conversation-session/conversation-session-v4-vertical-slice.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "v4-vertical-slice-title",
  8. "description": "E2E_V4_SLICE_TURN1 首发的 case-local 标题生成响应。",
  9. "metadata": {
  10. "kind": "common",
  11. "timingPolicy": "fast-text",
  12. "source": "synthetic",
  13. "syntheticReason": "E2E_V4_SLICE_TURN1 首发会触发默认 title sidecar;固定 case-local 标题响应,避免 default replay 回退 legacy provider-basic,并用该首发 marker 隔离跨 case 匹配。"
  14. },
  15. "match": {
  16. "method": "POST",
  17. "pathIncludes": "/messages",
  18. "bodyIncludes": [
  19. "Generate a concise title",
  20. "E2E_V4_SLICE_TURN1"
  21. ]
  22. },
  23. "response": {
  24. "statusCode": 200,
  25. "text": {
  26. "id": "v4-vertical-slice-title",
  27. "inputTokens": 64,
  28. "outputTokens": 8,
  29. "text": "{\"title\":\"V4 Vertical Slice E2E\"}"
  30. }
  31. }
  32. },
  33. {
  34. "id": "v4-slice-turn1-controlled-stream",
  35. "description": "M3 竖切门禁 turn1:可控慢流,制造「agent 输出中刷新」窗口(首 delta 0.5s,完流 12s)。",
  36. "metadata": {
  37. "kind": "main",
  38. "timingPolicy": "controlled-stream",
  39. "source": "synthetic",
  40. "syntheticReason": "刷新恢复断言需要稳定的 streaming 窗口;真实 provider 完流时间不可控。"
  41. },
  42. "match": {
  43. "method": "POST",
  44. "pathIncludes": "/messages",
  45. "lastUserMessageIncludes": ["E2E_V4_SLICE_TURN1"],
  46. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  47. },
  48. "response": {
  49. "statusCode": 200,
  50. "statusMessage": "OK",
  51. "headers": {
  52. "cache-control": "no-cache",
  53. "content-type": "text/event-stream; charset=utf-8"
  54. },
  55. "chunks": [
  56. {
  57. "offsetMs": 0,
  58. "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"v4-slice-turn1\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":64,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":0,\"service_tier\":\"standard\"}}}\n\n"
  59. },
  60. {
  61. "offsetMs": 250,
  62. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
  63. },
  64. {
  65. "offsetMs": 500,
  66. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"V4_TURN1_STREAMING \"}}\n\n"
  67. },
  68. {
  69. "offsetMs": 3000,
  70. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"part-two \"}}\n\n"
  71. },
  72. {
  73. "offsetMs": 6000,
  74. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"part-three \"}}\n\n"
  75. },
  76. {
  77. "offsetMs": 9000,
  78. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"part-four \"}}\n\n"
  79. },
  80. {
  81. "offsetMs": 12000,
  82. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"V4_TURN1_DONE\"}}\n\n"
  83. },
  84. {
  85. "offsetMs": 12200,
  86. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
  87. },
  88. {
  89. "offsetMs": 12300,
  90. "text": "event: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":64,\"output_tokens\":24,\"service_tier\":\"standard\"}}\n\n"
  91. },
  92. {
  93. "offsetMs": 12400,
  94. "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  95. }
  96. ],
  97. "text": {
  98. "id": "v4-slice-turn1",
  99. "inputTokens": 64,
  100. "outputTokens": 24,
  101. "text": "V4_TURN1_STREAMING part-two part-three part-four V4_TURN1_DONE"
  102. }
  103. }
  104. },
  105. {
  106. "id": "v4-slice-turn2-controlled-stream",
  107. "description": "M3 竖切门禁 turn2:长尾慢流(45s 才完流),留出点 stop 的窗口;stop 后客户端 abort。",
  108. "metadata": {
  109. "kind": "main",
  110. "timingPolicy": "controlled-stream",
  111. "source": "synthetic",
  112. "syntheticReason": "stop 断言需要 running 窗口远大于点击耗时,避免时序抖动误报。"
  113. },
  114. "match": {
  115. "method": "POST",
  116. "pathIncludes": "/messages",
  117. "lastUserMessageIncludes": ["E2E_V4_SLICE_TURN2"],
  118. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  119. },
  120. "response": {
  121. "statusCode": 200,
  122. "statusMessage": "OK",
  123. "headers": {
  124. "cache-control": "no-cache",
  125. "content-type": "text/event-stream; charset=utf-8"
  126. },
  127. "chunks": [
  128. {
  129. "offsetMs": 0,
  130. "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"v4-slice-turn2\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":96,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":0,\"service_tier\":\"standard\"}}}\n\n"
  131. },
  132. {
  133. "offsetMs": 250,
  134. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
  135. },
  136. {
  137. "offsetMs": 500,
  138. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"V4_TURN2_STREAMING \"}}\n\n"
  139. },
  140. {
  141. "offsetMs": 5000,
  142. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"turn2-part-two \"}}\n\n"
  143. },
  144. {
  145. "offsetMs": 45000,
  146. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
  147. },
  148. {
  149. "offsetMs": 45100,
  150. "text": "event: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":96,\"output_tokens\":12,\"service_tier\":\"standard\"}}\n\n"
  151. },
  152. {
  153. "offsetMs": 45200,
  154. "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  155. }
  156. ],
  157. "text": {
  158. "id": "v4-slice-turn2",
  159. "inputTokens": 96,
  160. "outputTokens": 12,
  161. "text": "V4_TURN2_STREAMING turn2-part-two"
  162. }
  163. }
  164. }
  165. ]
  166. }