conversation-session-r3-task-faults.json 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-r3-task-faults",
  4. "spec": "./test/e2e/conversation-session/remote/execution/conversation-session-r3-task-faults.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "r3-faults-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_TASK_FAULTS"]
  20. },
  21. "response": {
  22. "statusCode": 200,
  23. "text": {
  24. "id": "r3-faults-title",
  25. "inputTokens": 64,
  26. "outputTokens": 8,
  27. "text": "{\"title\":\"R3 task faults\"}"
  28. }
  29. }
  30. },
  31. {
  32. "id": "r3-faults-http-429-once",
  33. "description": "真实HTTP 429限流响应",
  34. "metadata": {
  35. "kind": "main",
  36. "timingPolicy": "fault-stream",
  37. "source": "synthetic",
  38. "syntheticReason": "固定一次限流,随后恢复;核对HTTP状态与请求次数,支持当前重试策略。"
  39. },
  40. "maxMatches": 1,
  41. "match": {
  42. "method": "POST",
  43. "pathIncludes": "/messages",
  44. "lastUserMessageIncludes": ["E2E_R3_TASK_FAULTS_HTTP_429"],
  45. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  46. },
  47. "response": {
  48. "statusCode": 429,
  49. "headers": {
  50. "content-type": "application/json",
  51. "retry-after": "0"
  52. },
  53. "body": "{\"type\":\"error\",\"error\":{\"type\":\"rate_limit_error\",\"message\":\"E2E_429_RATE_LIMIT\"}}"
  54. }
  55. },
  56. {
  57. "id": "r3-faults-http-429-recover",
  58. "description": "限流后的自动或显式重试恢复",
  59. "metadata": {
  60. "kind": "main",
  61. "timingPolicy": "fast-text",
  62. "source": "synthetic",
  63. "syntheticReason": "与单次429组成明确的[429,200]恢复序列。"
  64. },
  65. "maxMatches": 1,
  66. "match": {
  67. "method": "POST",
  68. "pathIncludes": "/messages",
  69. "lastUserMessageIncludes": ["E2E_R3_TASK_FAULTS_HTTP_429"],
  70. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  71. },
  72. "response": {
  73. "statusCode": 200,
  74. "text": {
  75. "id": "r3-429-recovered",
  76. "inputTokens": 64,
  77. "outputTokens": 8,
  78. "text": "R3_FAULTS_429_RECOVERED"
  79. }
  80. }
  81. },
  82. {
  83. "id": "r3-faults-auth-once",
  84. "description": "首次请求 401 鉴权错误(不可重试),只消费一次",
  85. "metadata": {
  86. "kind": "main",
  87. "timingPolicy": "fast-text",
  88. "source": "synthetic",
  89. "syntheticReason": "远端模型错误必须以明确错误呈现且保留输入"
  90. },
  91. "replay": {
  92. "consumeOnce": true
  93. },
  94. "match": {
  95. "method": "POST",
  96. "pathIncludes": "/messages",
  97. "lastUserMessageIncludes": ["E2E_R3_TASK_FAULTS_RATE"],
  98. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  99. },
  100. "response": {
  101. "statusCode": 401,
  102. "headers": {
  103. "content-type": "application/json"
  104. },
  105. "body": "{\"type\": \"error\", \"error\": {\"type\": \"authentication_error\", \"message\": \"E2E_R3_AUTH_REJECTED\"}}"
  106. }
  107. },
  108. {
  109. "id": "r3-faults-rate-limit-recover",
  110. "description": "重试后正常回复",
  111. "metadata": {
  112. "kind": "main",
  113. "timingPolicy": "fast-text",
  114. "source": "synthetic",
  115. "syntheticReason": "重试恢复"
  116. },
  117. "maxMatches": 4,
  118. "match": {
  119. "method": "POST",
  120. "pathIncludes": "/messages",
  121. "lastUserMessageIncludes": ["E2E_R3_TASK_FAULTS_RATE"],
  122. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  123. },
  124. "response": {
  125. "statusCode": 200,
  126. "text": {
  127. "id": "r3-faults-rate-recover",
  128. "inputTokens": 64,
  129. "outputTokens": 8,
  130. "text": "R3_FAULTS_RATE_RECOVERED"
  131. }
  132. }
  133. },
  134. {
  135. "id": "r3-faults-truncated-once",
  136. "description": "流中途断开(无 message_stop)",
  137. "metadata": {
  138. "kind": "main",
  139. "timingPolicy": "fault-stream",
  140. "source": "synthetic",
  141. "syntheticReason": "truncated stream 不能假 completed 或永久 running"
  142. },
  143. "replay": {
  144. "consumeOnce": true
  145. },
  146. "match": {
  147. "method": "POST",
  148. "pathIncludes": "/messages",
  149. "lastUserMessageIncludes": ["E2E_R3_TASK_FAULTS_TRUNC"],
  150. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  151. },
  152. "response": {
  153. "statusCode": 200,
  154. "headers": {
  155. "cache-control": "no-cache",
  156. "content-type": "text/event-stream; charset=utf-8"
  157. },
  158. "closeMode": "destroy",
  159. "chunks": [
  160. {
  161. "offsetMs": 0,
  162. "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"r3-trunc\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"e2e-ssh-remote-lifecycle-model\",\"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"
  163. },
  164. {
  165. "offsetMs": 200,
  166. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
  167. },
  168. {
  169. "offsetMs": 400,
  170. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"R3_FAULTS_TRUNC_PARTIAL \"}}\n\n"
  171. }
  172. ]
  173. }
  174. },
  175. {
  176. "id": "r3-faults-truncated-recover",
  177. "description": "重试后正常回复",
  178. "metadata": {
  179. "kind": "main",
  180. "timingPolicy": "fast-text",
  181. "source": "synthetic",
  182. "syntheticReason": "重试恢复"
  183. },
  184. "maxMatches": 4,
  185. "match": {
  186. "method": "POST",
  187. "pathIncludes": "/messages",
  188. "lastUserMessageIncludes": ["E2E_R3_TASK_FAULTS_TRUNC"],
  189. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  190. },
  191. "response": {
  192. "statusCode": 200,
  193. "text": {
  194. "id": "r3-faults-trunc-recover",
  195. "inputTokens": 64,
  196. "outputTokens": 8,
  197. "text": "R3_FAULTS_TRUNC_RECOVERED"
  198. }
  199. }
  200. },
  201. {
  202. "id": "r3-faults-main",
  203. "description": "其它",
  204. "metadata": {
  205. "kind": "main",
  206. "timingPolicy": "fast-text",
  207. "source": "synthetic",
  208. "syntheticReason": "首发"
  209. },
  210. "maxMatches": 10,
  211. "match": {
  212. "method": "POST",
  213. "pathIncludes": "/messages",
  214. "bodyIncludes": ["E2E_R3_TASK_FAULTS_"],
  215. "bodyExcludes": [
  216. "Generate a concise title",
  217. "CRITICAL: Respond with TEXT ONLY",
  218. "E2E_R3_TASK_FAULTS_RATE",
  219. "E2E_R3_TASK_FAULTS_TRUNC"
  220. ]
  221. },
  222. "response": {
  223. "statusCode": 200,
  224. "text": {
  225. "id": "r3-faults-main",
  226. "inputTokens": 64,
  227. "outputTokens": 8,
  228. "text": "R3_TASK_FAULTS_REPLY"
  229. }
  230. }
  231. }
  232. ]
  233. }