conversation-session-ttft-diagnostics.json 9.5 KB

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