conversation-session-stop-empty.json 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-stop-empty",
  4. "spec": "./test/e2e/conversation-session/conversation-session-stop-empty.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "upstream-stop-empty-running-slow-stream",
  8. "description": "Stop empty queue 首轮慢流,稳定制造 queue=0 的 running 窗口。",
  9. "metadata": {
  10. "kind": "main",
  11. "timingPolicy": "controlled-stream",
  12. "source": "synthetic",
  13. "syntheticReason": "stop 空队列语义只依赖当前轮保持 running;真实 provider 可能过快完成导致 stop 按钮窗口消失。"
  14. },
  15. "maxMatches": 1,
  16. "match": {
  17. "method": "POST",
  18. "pathIncludes": "/messages",
  19. "bodyIncludes": [
  20. "E2E_SLOW_STREAM",
  21. "E2E_STOP_EMPTY_RUNNING"
  22. ],
  23. "bodyExcludes": [
  24. "Generate a concise title",
  25. "CRITICAL: Respond with TEXT ONLY"
  26. ],
  27. "lastUserMessageIncludes": [
  28. "E2E_STOP_EMPTY_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. "events": [
  39. {
  40. "sequence": 0,
  41. "offsetMs": 0,
  42. "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-stop-empty-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"
  43. },
  44. {
  45. "sequence": 1,
  46. "offsetMs": 250,
  47. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
  48. },
  49. {
  50. "sequence": 2,
  51. "offsetMs": 700,
  52. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"deep\"}}\n\n"
  53. },
  54. {
  55. "sequence": 3,
  56. "offsetMs": 60000,
  57. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"seek-e2e-ok\"}}\n\n"
  58. },
  59. {
  60. "sequence": 4,
  61. "offsetMs": 60100,
  62. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
  63. },
  64. {
  65. "sequence": 5,
  66. "offsetMs": 60200,
  67. "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"
  68. },
  69. {
  70. "sequence": 6,
  71. "offsetMs": 60300,
  72. "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  73. }
  74. ]
  75. }
  76. },
  77. {
  78. "id": "upstream-stop-empty-next-fast-text",
  79. "description": "Stop empty queue 后续普通文本应立即启动并完成。",
  80. "metadata": {
  81. "kind": "main",
  82. "timingPolicy": "fast-text",
  83. "source": "synthetic",
  84. "syntheticReason": "核心断言是 stop 后 queue=0 不阻塞下一轮;响应只需稳定完成。"
  85. },
  86. "maxMatches": 1,
  87. "match": {
  88. "method": "POST",
  89. "pathIncludes": "/messages",
  90. "bodyIncludes": [
  91. "E2E_STOP_EMPTY_NEXT"
  92. ],
  93. "bodyExcludes": [
  94. "Generate a concise title",
  95. "CRITICAL: Respond with TEXT ONLY"
  96. ],
  97. "lastUserMessageIncludes": [
  98. "E2E_STOP_EMPTY_NEXT"
  99. ]
  100. },
  101. "response": {
  102. "statusCode": 200,
  103. "text": {
  104. "id": "upstream-e2e-stop-empty-next",
  105. "inputTokens": 128,
  106. "outputTokens": 12,
  107. "text": "upstream-e2e-ok"
  108. }
  109. }
  110. },
  111. {
  112. "id": "upstream-stop-empty-toolcall-bash",
  113. "description": "Stop empty queue 的 tool call 运行窗口:返回一个长时间 Bash tool_use。",
  114. "metadata": {
  115. "kind": "main",
  116. "timingPolicy": "fast-tool-use",
  117. "source": "synthetic",
  118. "syntheticReason": "tool call 运行中 stop 后再发需要稳定制造本地工具执行窗口,真实模型可能选择纯文本或过快完成。"
  119. },
  120. "maxMatches": 1,
  121. "match": {
  122. "method": "POST",
  123. "pathIncludes": "/messages",
  124. "bodyIncludes": [
  125. "E2E_STOP_EMPTY_TOOLCALL_RUNNING"
  126. ],
  127. "bodyExcludes": [
  128. "Generate a concise title",
  129. "CRITICAL: Respond with TEXT ONLY"
  130. ],
  131. "lastUserMessageIncludes": [
  132. "E2E_STOP_EMPTY_TOOLCALL_RUNNING"
  133. ]
  134. },
  135. "response": {
  136. "statusCode": 200,
  137. "toolUse": {
  138. "id": "toolu_e2e_stop_empty_toolcall_bash",
  139. "name": "Bash",
  140. "input": {
  141. "command": "sleep 60",
  142. "description": "E2E stop empty long Bash"
  143. }
  144. }
  145. }
  146. },
  147. {
  148. "id": "upstream-stop-empty-toolcall-next-fast-text",
  149. "description": "Tool call stop 后续普通文本应立即启动并完成。",
  150. "metadata": {
  151. "kind": "main",
  152. "timingPolicy": "fast-text",
  153. "source": "synthetic",
  154. "syntheticReason": "核心断言是 tool call stop 后 queue=0 不阻塞下一轮;响应只需稳定完成。"
  155. },
  156. "maxMatches": 1,
  157. "match": {
  158. "method": "POST",
  159. "pathIncludes": "/messages",
  160. "bodyIncludes": [
  161. "E2E_STOP_EMPTY_TOOLCALL_NEXT"
  162. ],
  163. "bodyExcludes": [
  164. "Generate a concise title",
  165. "CRITICAL: Respond with TEXT ONLY"
  166. ],
  167. "lastUserMessageIncludes": [
  168. "E2E_STOP_EMPTY_TOOLCALL_NEXT"
  169. ]
  170. },
  171. "response": {
  172. "statusCode": 200,
  173. "text": {
  174. "id": "upstream-e2e-stop-empty-toolcall-next",
  175. "inputTokens": 128,
  176. "outputTokens": 12,
  177. "text": "upstream-e2e-ok"
  178. }
  179. }
  180. }
  181. ]
  182. }