conversation-session-r3-transport-loss.json 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-r3-transport-loss",
  4. "spec": "./test/e2e/conversation-session/remote/connection/conversation-session-r3-transport-loss.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "r3-tloss-title",
  8. "description": "标题辅助响应",
  9. "metadata": {
  10. "kind": "common",
  11. "timingPolicy": "fast-text",
  12. "source": "synthetic",
  13. "syntheticReason": "标题不属于断言"
  14. },
  15. "maxMatches": 8,
  16. "match": {
  17. "method": "POST",
  18. "pathIncludes": "/messages",
  19. "bodyIncludes": ["Generate a concise title", "E2E_R3_TRANSPORT_LOSS"]
  20. },
  21. "response": {
  22. "statusCode": 200,
  23. "text": {
  24. "id": "r3-tloss-title",
  25. "inputTokens": 64,
  26. "outputTokens": 8,
  27. "text": "{\"title\":\"R3 task control\"}"
  28. }
  29. }
  30. },
  31. {
  32. "id": "r3-tloss-slow-turn",
  33. "description": "远端 running 窗口:controlled stream 45s",
  34. "metadata": {
  35. "kind": "main",
  36. "timingPolicy": "controlled-stream",
  37. "source": "synthetic",
  38. "syntheticReason": "queue/stop 只在 running 期间存在"
  39. },
  40. "maxMatches": 4,
  41. "match": {
  42. "method": "POST",
  43. "pathIncludes": "/messages",
  44. "lastUserMessageIncludes": ["E2E_R3_TRANSPORT_LOSS_SLOW"],
  45. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  46. },
  47. "response": {
  48. "statusCode": 200,
  49. "statusMessage": "OK",
  50. "headers": {
  51. "cache-control": "no-cache",
  52. "content-type": "text/event-stream; charset=utf-8"
  53. },
  54. "chunks": [
  55. {
  56. "offsetMs": 0,
  57. "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"r3-tloss-slow\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":80,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":0,\"service_tier\":\"standard\"}}}\n\n"
  58. },
  59. {
  60. "offsetMs": 250,
  61. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
  62. },
  63. {
  64. "offsetMs": 500,
  65. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"R3_TLOSS_STREAMING \"}}\n\n"
  66. },
  67. {
  68. "offsetMs": 45000,
  69. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
  70. },
  71. {
  72. "offsetMs": 45100,
  73. "text": "event: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":80,\"output_tokens\":4,\"service_tier\":\"standard\"}}\n\n"
  74. },
  75. {
  76. "offsetMs": 45200,
  77. "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  78. }
  79. ],
  80. "text": {
  81. "id": "v4-queue-slow",
  82. "inputTokens": 80,
  83. "outputTokens": 4,
  84. "text": "V4_QUEUE_STREAMING"
  85. }
  86. }
  87. },
  88. {
  89. "id": "r3-tloss-queued",
  90. "description": "排队项被消费后的普通回复",
  91. "metadata": {
  92. "kind": "main",
  93. "timingPolicy": "fast-text",
  94. "source": "synthetic",
  95. "syntheticReason": "队列消费按 FIFO"
  96. },
  97. "maxMatches": 8,
  98. "match": {
  99. "method": "POST",
  100. "pathIncludes": "/messages",
  101. "lastUserMessageIncludes": ["E2E_R3_TRANSPORT_LOSS_Q"],
  102. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  103. },
  104. "response": {
  105. "statusCode": 200,
  106. "text": {
  107. "id": "r3-tloss-queued",
  108. "inputTokens": 64,
  109. "outputTokens": 8,
  110. "text": "R3_TLOSS_Q_REPLY"
  111. }
  112. }
  113. },
  114. {
  115. "id": "r3-tloss-permission-write",
  116. "description": "Write 工具触发远端权限请求",
  117. "metadata": {
  118. "kind": "main",
  119. "timingPolicy": "fast-text",
  120. "source": "synthetic",
  121. "syntheticReason": "权限阻塞必须由真实 blocking request 承载"
  122. },
  123. "maxMatches": 4,
  124. "match": {
  125. "method": "POST",
  126. "pathIncludes": "/messages",
  127. "lastUserMessageIncludes": ["E2E_R3_TRANSPORT_LOSS_PERMISSION"],
  128. "bodyIncludes": ["E2E_R3_TRANSPORT_LOSS_PERMISSION"],
  129. "bodyExcludes": [
  130. "Generate a concise title",
  131. "CRITICAL: Respond with TEXT ONLY",
  132. "toolu_r3_task_permission"
  133. ]
  134. },
  135. "response": {
  136. "statusCode": 200,
  137. "toolUse": {
  138. "id": "toolu_r3_task_permission",
  139. "name": "Write",
  140. "input": {
  141. "file_path": "/home/dev/r3-workspace-a/.zcode-e2e/r3-transport-loss/permission-output.txt",
  142. "content": "R3_TLOSS_PERMISSION_RESULT\n"
  143. }
  144. }
  145. }
  146. },
  147. {
  148. "id": "r3-tloss-permission-final",
  149. "description": "工具结果后的终态文本",
  150. "metadata": {
  151. "kind": "main",
  152. "timingPolicy": "fast-text",
  153. "source": "synthetic",
  154. "syntheticReason": "终态"
  155. },
  156. "maxMatches": 4,
  157. "match": {
  158. "method": "POST",
  159. "pathIncludes": "/messages",
  160. "bodyIncludes": ["E2E_R3_TRANSPORT_LOSS_PERMISSION", "toolu_r3_task_permission"],
  161. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  162. },
  163. "response": {
  164. "statusCode": 200,
  165. "text": {
  166. "id": "r3-tloss-permission-final",
  167. "inputTokens": 64,
  168. "outputTokens": 8,
  169. "text": "R3_TLOSS_PERMISSION_DONE"
  170. }
  171. }
  172. },
  173. {
  174. "id": "r3-tloss-main-fallback",
  175. "description": "其它本 case 请求",
  176. "metadata": {
  177. "kind": "main",
  178. "timingPolicy": "fast-text",
  179. "source": "synthetic",
  180. "syntheticReason": "首发/续发普通回复"
  181. },
  182. "maxMatches": 10,
  183. "match": {
  184. "method": "POST",
  185. "pathIncludes": "/messages",
  186. "bodyIncludes": ["E2E_R3_TRANSPORT_LOSS_"],
  187. "bodyExcludes": [
  188. "Generate a concise title",
  189. "CRITICAL: Respond with TEXT ONLY",
  190. "E2E_R3_TRANSPORT_LOSS_SLOW",
  191. "E2E_R3_TRANSPORT_LOSS_Q",
  192. "E2E_R3_TRANSPORT_LOSS_PERMISSION"
  193. ]
  194. },
  195. "response": {
  196. "statusCode": 200,
  197. "text": {
  198. "id": "r3-tloss-main",
  199. "inputTokens": 64,
  200. "outputTokens": 8,
  201. "text": "R3_TRANSPORT_LOSS_REPLY"
  202. }
  203. }
  204. }
  205. ]
  206. }