conversation-session-stop-empty.json 7.2 KB

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