conversation-session-ttft-diagnostics.json 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-ttft-diagnostics",
  4. "spec": "./test/e2e/conversation-session/conversation-session-ttft-diagnostics.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "ttft-diag-title",
  8. "metadata": {
  9. "kind": "common",
  10. "timingPolicy": "fast-text",
  11. "source": "synthetic",
  12. "syntheticReason": "隔离标题生成,不让无关后台请求产生 Missing Fixture 重试与性能噪音。"
  13. },
  14. "match": {
  15. "method": "POST",
  16. "pathIncludes": "/messages",
  17. "bodyIncludes": ["Generate a concise title", "E2E_TTFT_"]
  18. },
  19. "response": {
  20. "statusCode": 200,
  21. "text": {
  22. "id": "diag-title",
  23. "text": "{\"title\":\"TTFT diagnostics\"}",
  24. "inputTokens": 30,
  25. "outputTokens": 10
  26. }
  27. }
  28. },
  29. {
  30. "id": "ttft-diag-hold",
  31. "metadata": {
  32. "kind": "main",
  33. "timingPolicy": "controlled-stream",
  34. "source": "synthetic",
  35. "syntheticReason": "固定首输出延迟,通过真实队列/取消/后台操作验证最终 OTLP。"
  36. },
  37. "maxMatches": 1,
  38. "match": {
  39. "method": "POST",
  40. "pathIncludes": "/messages",
  41. "lastUserMessageIncludes": ["E2E_TTFT_DIAG_HOLD"],
  42. "bodyExcludes": ["Generate a concise title"]
  43. },
  44. "response": {
  45. "statusCode": 200,
  46. "delayMs": 8000,
  47. "text": {
  48. "id": "ttft-diag-hold",
  49. "text": "ttft-diag-hold-ok",
  50. "inputTokens": 80,
  51. "outputTokens": 10
  52. }
  53. }
  54. },
  55. {
  56. "id": "ttft-diag-queue",
  57. "metadata": {
  58. "kind": "main",
  59. "timingPolicy": "controlled-stream",
  60. "source": "synthetic",
  61. "syntheticReason": "固定首输出延迟,通过真实队列/取消/后台操作验证最终 OTLP。"
  62. },
  63. "maxMatches": 1,
  64. "match": {
  65. "method": "POST",
  66. "pathIncludes": "/messages",
  67. "lastUserMessageIncludes": ["E2E_TTFT_DIAG_QUEUE"],
  68. "bodyExcludes": ["Generate a concise title"]
  69. },
  70. "response": {
  71. "statusCode": 200,
  72. "delayMs": 700,
  73. "text": {
  74. "id": "ttft-diag-queue",
  75. "text": "ttft-diag-queue-ok",
  76. "inputTokens": 80,
  77. "outputTokens": 10
  78. }
  79. }
  80. },
  81. {
  82. "id": "ttft-diag-cancel",
  83. "metadata": {
  84. "kind": "main",
  85. "timingPolicy": "controlled-stream",
  86. "source": "synthetic",
  87. "syntheticReason": "固定首输出延迟,通过真实队列/取消/后台操作验证最终 OTLP。"
  88. },
  89. "maxMatches": 1,
  90. "match": {
  91. "method": "POST",
  92. "pathIncludes": "/messages",
  93. "lastUserMessageIncludes": ["E2E_TTFT_DIAG_CANCEL"],
  94. "bodyExcludes": ["Generate a concise title"]
  95. },
  96. "response": {
  97. "statusCode": 200,
  98. "delayMs": 15000,
  99. "text": {
  100. "id": "ttft-diag-cancel",
  101. "text": "ttft-diag-cancel-ok",
  102. "inputTokens": 80,
  103. "outputTokens": 10
  104. }
  105. }
  106. },
  107. {
  108. "id": "ttft-diag-retry-failure",
  109. "metadata": {
  110. "kind": "main",
  111. "timingPolicy": "controlled-stream",
  112. "source": "synthetic",
  113. "syntheticReason": "固定首输出延迟,通过真实队列/取消/后台操作验证最终 OTLP。"
  114. },
  115. "maxMatches": 1,
  116. "match": {
  117. "method": "POST",
  118. "pathIncludes": "/messages",
  119. "lastUserMessageIncludes": ["E2E_TTFT_DIAG_RETRY"],
  120. "bodyExcludes": ["Generate a concise title"]
  121. },
  122. "response": {
  123. "statusCode": 503,
  124. "headers": {
  125. "content-type": "application/json"
  126. },
  127. "body": "{\"type\": \"error\", \"error\": {\"type\": \"overloaded_error\", \"message\": \"Synthetic retry\"}}"
  128. }
  129. },
  130. {
  131. "id": "ttft-diag-retry-success",
  132. "metadata": {
  133. "kind": "main",
  134. "timingPolicy": "controlled-stream",
  135. "source": "synthetic",
  136. "syntheticReason": "固定首输出延迟,通过真实队列/取消/后台操作验证最终 OTLP。"
  137. },
  138. "maxMatches": 1,
  139. "match": {
  140. "method": "POST",
  141. "pathIncludes": "/messages",
  142. "lastUserMessageIncludes": ["E2E_TTFT_DIAG_RETRY"],
  143. "bodyExcludes": ["Generate a concise title"]
  144. },
  145. "response": {
  146. "statusCode": 200,
  147. "text": {
  148. "id": "ttft-diag-retry",
  149. "text": "ttft-diag-retry-ok",
  150. "inputTokens": 80,
  151. "outputTokens": 10
  152. }
  153. }
  154. },
  155. {
  156. "id": "ttft-diag-fail",
  157. "metadata": {
  158. "kind": "main",
  159. "timingPolicy": "controlled-stream",
  160. "source": "synthetic",
  161. "syntheticReason": "固定首输出延迟,通过真实队列/取消/后台操作验证最终 OTLP。"
  162. },
  163. "maxMatches": 1,
  164. "match": {
  165. "method": "POST",
  166. "pathIncludes": "/messages",
  167. "lastUserMessageIncludes": ["E2E_TTFT_DIAG_FAIL"],
  168. "bodyExcludes": ["Generate a concise title"]
  169. },
  170. "response": {
  171. "statusCode": 400,
  172. "headers": {
  173. "content-type": "application/json"
  174. },
  175. "body": "{\"type\": \"error\", \"error\": {\"type\": \"invalid_request_error\", \"message\": \"Synthetic permanent failure\"}}"
  176. }
  177. },
  178. {
  179. "id": "ttft-diag-guide-read",
  180. "metadata": {
  181. "kind": "main",
  182. "timingPolicy": "controlled-stream",
  183. "source": "synthetic",
  184. "syntheticReason": "固定首输出延迟,通过真实队列/取消/后台操作验证最终 OTLP。"
  185. },
  186. "maxMatches": 1,
  187. "match": {
  188. "method": "POST",
  189. "pathIncludes": "/messages",
  190. "lastUserMessageIncludes": ["E2E_TTFT_DIAG_GUIDE_PARENT"],
  191. "bodyExcludes": ["Generate a concise title", "E2E_TTFT_GUIDE_FILE"]
  192. },
  193. "response": {
  194. "statusCode": 200,
  195. "delayMs": 4000,
  196. "toolUse": {
  197. "id": "ttft-diag-read",
  198. "name": "Read",
  199. "input": {
  200. "file_path": "{{e2eRuntimeRoot}}/ttft-diagnostics/input.txt"
  201. }
  202. }
  203. }
  204. },
  205. {
  206. "id": "ttft-diag-guide-final",
  207. "metadata": {
  208. "kind": "main",
  209. "timingPolicy": "controlled-stream",
  210. "source": "synthetic",
  211. "syntheticReason": "固定首输出延迟,通过真实队列/取消/后台操作验证最终 OTLP。"
  212. },
  213. "maxMatches": 1,
  214. "match": {
  215. "method": "POST",
  216. "pathIncludes": "/messages",
  217. "bodyExcludes": ["Generate a concise title"],
  218. "bodyIncludes": ["E2E_TTFT_GUIDE_FILE", "E2E_TTFT_DIAG_GUIDE_INPUT", "tool_result"]
  219. },
  220. "response": {
  221. "statusCode": 200,
  222. "text": {
  223. "id": "guide-final",
  224. "text": "ttft-diag-guide-ok",
  225. "inputTokens": 80,
  226. "outputTokens": 10
  227. }
  228. }
  229. },
  230. {
  231. "id": "ttft-diag-pause",
  232. "metadata": {
  233. "kind": "main",
  234. "timingPolicy": "controlled-stream",
  235. "source": "synthetic",
  236. "syntheticReason": "固定首输出延迟,通过真实队列/取消/后台操作验证最终 OTLP。"
  237. },
  238. "maxMatches": 1,
  239. "match": {
  240. "method": "POST",
  241. "pathIncludes": "/messages",
  242. "lastUserMessageIncludes": ["E2E_TTFT_DIAG_PAUSE"],
  243. "bodyExcludes": ["Generate a concise title"],
  244. "lastUserMessageExcludes": ["E2E_TTFT_DIAG_CONFIRM", "E2E_TTFT_DIAG_HELD"]
  245. },
  246. "response": {
  247. "statusCode": 200,
  248. "delayMs": 15000,
  249. "text": {
  250. "id": "pause",
  251. "text": "ttft-diag-pause-ok",
  252. "inputTokens": 80,
  253. "outputTokens": 10
  254. }
  255. },
  256. "description": "停止可能早于 provider 请求,PAUSE 未消费时不能抢匹配随后合并的 CONFIRM/HELD user content。"
  257. },
  258. {
  259. "id": "ttft-diag-held",
  260. "metadata": {
  261. "kind": "main",
  262. "timingPolicy": "controlled-stream",
  263. "source": "synthetic",
  264. "syntheticReason": "固定首输出延迟,通过真实队列/取消/后台操作验证最终 OTLP。"
  265. },
  266. "maxMatches": 1,
  267. "match": {
  268. "method": "POST",
  269. "pathIncludes": "/messages",
  270. "lastUserMessageIncludes": ["E2E_TTFT_DIAG_HELD"],
  271. "bodyExcludes": ["Generate a concise title"]
  272. },
  273. "response": {
  274. "statusCode": 200,
  275. "delayMs": 300,
  276. "text": {
  277. "id": "held",
  278. "text": "ttft-diag-held-ok",
  279. "inputTokens": 80,
  280. "outputTokens": 10
  281. }
  282. }
  283. },
  284. {
  285. "id": "ttft-diag-confirm",
  286. "metadata": {
  287. "kind": "main",
  288. "timingPolicy": "controlled-stream",
  289. "source": "synthetic",
  290. "syntheticReason": "固定首输出延迟,通过真实队列/取消/后台操作验证最终 OTLP。"
  291. },
  292. "maxMatches": 1,
  293. "match": {
  294. "method": "POST",
  295. "pathIncludes": "/messages",
  296. "lastUserMessageIncludes": ["E2E_TTFT_DIAG_CONFIRM"],
  297. "bodyExcludes": ["Generate a concise title"]
  298. },
  299. "response": {
  300. "statusCode": 200,
  301. "delayMs": 300,
  302. "text": {
  303. "id": "confirm",
  304. "text": "ttft-diag-confirm-ok",
  305. "inputTokens": 80,
  306. "outputTokens": 10
  307. }
  308. }
  309. }
  310. ]
  311. }