conversation-session-runtime-communication-performance.json 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-runtime-communication-performance",
  4. "spec": "./test/e2e/conversation-session/conversation-session-runtime-communication-performance.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "runtime-perf-title",
  8. "description": "PERF02 标题生成固定响应,避免 title sidecar 抢占业务 fixture。",
  9. "metadata": {
  10. "kind": "common",
  11. "timingPolicy": "fast-text",
  12. "source": "synthetic",
  13. "syntheticReason": "标题生成不是本性能复现的通信压力来源,只需稳定返回。"
  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\":\"runtime-perf-title\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[{\"type\":\"text\",\"text\":\"{\\\"title\\\":\\\"Runtime Perf Repro\\\"}\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":96,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":16,\"service_tier\":\"standard\"}}"
  27. }
  28. },
  29. {
  30. "id": "runtime-perf-parent-tool-a",
  31. "description": "lane A 父请求触发 Agent tool_use。",
  32. "metadata": {
  33. "kind": "main",
  34. "timingPolicy": "fast-text",
  35. "source": "synthetic",
  36. "syntheticReason": "PERF02 需要稳定触发子智能体,父请求只负责产生 Agent tool。"
  37. },
  38. "maxMatches": 1,
  39. "match": {
  40. "method": "POST",
  41. "pathIncludes": "/messages",
  42. "lastUserMessageIncludes": ["E2E_RUNTIME_PERF_A"],
  43. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  44. },
  45. "response": {
  46. "statusCode": 200,
  47. "toolUse": {
  48. "id": "toolu_runtime_perf_a_agent",
  49. "name": "Agent",
  50. "input": {
  51. "description": "PERF02 lane A child stream",
  52. "prompt": "E2E_RUNTIME_PERF_CHILD_A: stream child result and finish with PERF_CHILD_DONE_A.",
  53. "subagent_type": "general-purpose"
  54. }
  55. }
  56. }
  57. },
  58. {
  59. "id": "runtime-perf-child-stream-a",
  60. "description": "lane A child subagent recorded stream。",
  61. "metadata": {
  62. "kind": "main",
  63. "timingPolicy": "recorded-stream",
  64. "source": "synthetic",
  65. "syntheticReason": "性能复现需要稳定的 child subagent streaming 窗口。"
  66. },
  67. "maxMatches": 1,
  68. "match": {
  69. "method": "POST",
  70. "pathIncludes": "/messages",
  71. "lastUserMessageIncludes": ["E2E_RUNTIME_PERF_CHILD_A"],
  72. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  73. },
  74. "response": {
  75. "statusCode": 200,
  76. "statusMessage": "OK",
  77. "headers": {
  78. "cache-control": "no-cache",
  79. "content-type": "text/event-stream; charset=utf-8"
  80. },
  81. "chunks": [
  82. { "offsetMs": 0, "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"runtime-perf-child-a\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":128,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":0,\"service_tier\":\"standard\"}}}\n\n" },
  83. { "offsetMs": 250, "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n" },
  84. { "offsetMs": 500, "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"PERF_CHILD_STREAM_A_START\\n\\n| lane | phase | status |\\n| --- | --- | --- |\\n\"}}\n\n" },
  85. { "offsetMs": 4000, "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"| A | child-stream | receiving tool context |\\n```ts\\nexport const laneA = 'child-stream-mid';\\n```\\n\"}}\n\n" },
  86. { "offsetMs": 8000, "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"Lane A child stream is still active with markdown, code, and table updates.\\n\"}}\n\n" },
  87. { "offsetMs": 12000, "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"PERF_CHILD_DONE_A\"}}\n\n" },
  88. { "offsetMs": 12200, "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n" },
  89. { "offsetMs": 12300, "text": "event: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":128,\"output_tokens\":96,\"service_tier\":\"standard\"}}\n\n" },
  90. { "offsetMs": 12400, "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" }
  91. ]
  92. }
  93. },
  94. {
  95. "id": "runtime-perf-parent-final-a",
  96. "description": "lane A 父会话收到 child tool_result 后的 recorded stream。",
  97. "metadata": {
  98. "kind": "main",
  99. "timingPolicy": "recorded-stream",
  100. "source": "synthetic",
  101. "syntheticReason": "性能复现需要父会话 continuation 也保持 streaming。"
  102. },
  103. "maxMatches": 1,
  104. "match": {
  105. "method": "POST",
  106. "pathIncludes": "/messages",
  107. "bodyIncludes": ["E2E_RUNTIME_PERF_A", "PERF_CHILD_DONE_A"],
  108. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  109. },
  110. "response": {
  111. "statusCode": 200,
  112. "statusMessage": "OK",
  113. "headers": {
  114. "cache-control": "no-cache",
  115. "content-type": "text/event-stream; charset=utf-8"
  116. },
  117. "chunks": [
  118. { "offsetMs": 0, "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"runtime-perf-parent-a\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":192,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":0,\"service_tier\":\"standard\"}}}\n\n" },
  119. { "offsetMs": 250, "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n" },
  120. { "offsetMs": 500, "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"PERF_PARENT_STREAM_A_START after Agent tool result.\\n\"}}\n\n" },
  121. { "offsetMs": 3500, "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"Parent lane A continuation renders while other panes are active.\\n\"}}\n\n" },
  122. { "offsetMs": 7000, "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"More lane A markdown updates to keep React work alive.\\n\"}}\n\n" },
  123. { "offsetMs": 10000, "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"PERF_PARENT_DONE_A\"}}\n\n" },
  124. { "offsetMs": 10200, "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n" },
  125. { "offsetMs": 10300, "text": "event: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":192,\"output_tokens\":96,\"service_tier\":\"standard\"}}\n\n" },
  126. { "offsetMs": 10400, "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" }
  127. ]
  128. }
  129. },
  130. {
  131. "id": "runtime-perf-parent-tool-b",
  132. "description": "lane B 父请求触发 Agent tool_use。",
  133. "metadata": {
  134. "kind": "main",
  135. "timingPolicy": "fast-text",
  136. "source": "synthetic",
  137. "syntheticReason": "PERF02 需要稳定触发子智能体,父请求只负责产生 Agent tool。"
  138. },
  139. "maxMatches": 1,
  140. "match": {
  141. "method": "POST",
  142. "pathIncludes": "/messages",
  143. "lastUserMessageIncludes": ["E2E_RUNTIME_PERF_B"],
  144. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  145. },
  146. "response": {
  147. "statusCode": 200,
  148. "toolUse": {
  149. "id": "toolu_runtime_perf_b_agent",
  150. "name": "Agent",
  151. "input": {
  152. "description": "PERF02 lane B child stream",
  153. "prompt": "E2E_RUNTIME_PERF_CHILD_B: stream child result and finish with PERF_CHILD_DONE_B.",
  154. "subagent_type": "general-purpose"
  155. }
  156. }
  157. }
  158. },
  159. {
  160. "id": "runtime-perf-child-stream-b",
  161. "description": "lane B child subagent recorded stream。",
  162. "metadata": {
  163. "kind": "main",
  164. "timingPolicy": "recorded-stream",
  165. "source": "synthetic",
  166. "syntheticReason": "性能复现需要稳定的 child subagent streaming 窗口。"
  167. },
  168. "maxMatches": 1,
  169. "match": {
  170. "method": "POST",
  171. "pathIncludes": "/messages",
  172. "lastUserMessageIncludes": ["E2E_RUNTIME_PERF_CHILD_B"],
  173. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  174. },
  175. "response": {
  176. "statusCode": 200,
  177. "statusMessage": "OK",
  178. "headers": {
  179. "cache-control": "no-cache",
  180. "content-type": "text/event-stream; charset=utf-8"
  181. },
  182. "chunks": [
  183. { "offsetMs": 0, "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"runtime-perf-child-b\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":128,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":0,\"service_tier\":\"standard\"}}}\n\n" },
  184. { "offsetMs": 250, "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n" },
  185. { "offsetMs": 500, "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"PERF_CHILD_STREAM_B_START\\n\\n| lane | phase | status |\\n| --- | --- | --- |\\n\"}}\n\n" },
  186. { "offsetMs": 4000, "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"| B | child-stream | receiving tool context |\\n```ts\\nexport const laneB = 'child-stream-mid';\\n```\\n\"}}\n\n" },
  187. { "offsetMs": 8000, "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"Lane B child stream is still active with markdown, code, and table updates.\\n\"}}\n\n" },
  188. { "offsetMs": 12000, "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"PERF_CHILD_DONE_B\"}}\n\n" },
  189. { "offsetMs": 12200, "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n" },
  190. { "offsetMs": 12300, "text": "event: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":128,\"output_tokens\":96,\"service_tier\":\"standard\"}}\n\n" },
  191. { "offsetMs": 12400, "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" }
  192. ]
  193. }
  194. },
  195. {
  196. "id": "runtime-perf-parent-final-b",
  197. "description": "lane B 父会话收到 child tool_result 后的 recorded stream。",
  198. "metadata": {
  199. "kind": "main",
  200. "timingPolicy": "recorded-stream",
  201. "source": "synthetic",
  202. "syntheticReason": "性能复现需要父会话 continuation 也保持 streaming。"
  203. },
  204. "maxMatches": 1,
  205. "match": {
  206. "method": "POST",
  207. "pathIncludes": "/messages",
  208. "bodyIncludes": ["E2E_RUNTIME_PERF_B", "PERF_CHILD_DONE_B"],
  209. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  210. },
  211. "response": {
  212. "statusCode": 200,
  213. "statusMessage": "OK",
  214. "headers": {
  215. "cache-control": "no-cache",
  216. "content-type": "text/event-stream; charset=utf-8"
  217. },
  218. "chunks": [
  219. { "offsetMs": 0, "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"runtime-perf-parent-b\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":192,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":0,\"service_tier\":\"standard\"}}}\n\n" },
  220. { "offsetMs": 250, "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n" },
  221. { "offsetMs": 500, "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"PERF_PARENT_STREAM_B_START after Agent tool result.\\n\"}}\n\n" },
  222. { "offsetMs": 3500, "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"Parent lane B continuation renders while other panes are active.\\n\"}}\n\n" },
  223. { "offsetMs": 7000, "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"More lane B markdown updates to keep React work alive.\\n\"}}\n\n" },
  224. { "offsetMs": 10000, "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"PERF_PARENT_DONE_B\"}}\n\n" },
  225. { "offsetMs": 10200, "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n" },
  226. { "offsetMs": 10300, "text": "event: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":192,\"output_tokens\":96,\"service_tier\":\"standard\"}}\n\n" },
  227. { "offsetMs": 10400, "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" }
  228. ]
  229. }
  230. },
  231. {
  232. "id": "runtime-perf-parent-tool-c",
  233. "description": "lane C 父请求触发 Agent tool_use。",
  234. "metadata": {
  235. "kind": "main",
  236. "timingPolicy": "fast-text",
  237. "source": "synthetic",
  238. "syntheticReason": "PERF02 需要稳定触发子智能体,父请求只负责产生 Agent tool。"
  239. },
  240. "maxMatches": 1,
  241. "match": {
  242. "method": "POST",
  243. "pathIncludes": "/messages",
  244. "lastUserMessageIncludes": ["E2E_RUNTIME_PERF_C"],
  245. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  246. },
  247. "response": {
  248. "statusCode": 200,
  249. "toolUse": {
  250. "id": "toolu_runtime_perf_c_agent",
  251. "name": "Agent",
  252. "input": {
  253. "description": "PERF02 lane C child stream",
  254. "prompt": "E2E_RUNTIME_PERF_CHILD_C: stream child result and finish with PERF_CHILD_DONE_C.",
  255. "subagent_type": "general-purpose"
  256. }
  257. }
  258. }
  259. },
  260. {
  261. "id": "runtime-perf-child-stream-c",
  262. "description": "lane C child subagent recorded stream。",
  263. "metadata": {
  264. "kind": "main",
  265. "timingPolicy": "recorded-stream",
  266. "source": "synthetic",
  267. "syntheticReason": "性能复现需要稳定的 child subagent streaming 窗口。"
  268. },
  269. "maxMatches": 1,
  270. "match": {
  271. "method": "POST",
  272. "pathIncludes": "/messages",
  273. "lastUserMessageIncludes": ["E2E_RUNTIME_PERF_CHILD_C"],
  274. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  275. },
  276. "response": {
  277. "statusCode": 200,
  278. "statusMessage": "OK",
  279. "headers": {
  280. "cache-control": "no-cache",
  281. "content-type": "text/event-stream; charset=utf-8"
  282. },
  283. "chunks": [
  284. { "offsetMs": 0, "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"runtime-perf-child-c\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":128,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":0,\"service_tier\":\"standard\"}}}\n\n" },
  285. { "offsetMs": 250, "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n" },
  286. { "offsetMs": 500, "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"PERF_CHILD_STREAM_C_START\\n\\n| lane | phase | status |\\n| --- | --- | --- |\\n\"}}\n\n" },
  287. { "offsetMs": 4000, "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"| C | child-stream | receiving tool context |\\n```ts\\nexport const laneC = 'child-stream-mid';\\n```\\n\"}}\n\n" },
  288. { "offsetMs": 8000, "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"Lane C child stream is still active with markdown, code, and table updates.\\n\"}}\n\n" },
  289. { "offsetMs": 12000, "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"PERF_CHILD_DONE_C\"}}\n\n" },
  290. { "offsetMs": 12200, "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n" },
  291. { "offsetMs": 12300, "text": "event: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":128,\"output_tokens\":96,\"service_tier\":\"standard\"}}\n\n" },
  292. { "offsetMs": 12400, "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" }
  293. ]
  294. }
  295. },
  296. {
  297. "id": "runtime-perf-parent-final-c",
  298. "description": "lane C 父会话收到 child tool_result 后的 recorded stream。",
  299. "metadata": {
  300. "kind": "main",
  301. "timingPolicy": "recorded-stream",
  302. "source": "synthetic",
  303. "syntheticReason": "性能复现需要父会话 continuation 也保持 streaming。"
  304. },
  305. "maxMatches": 1,
  306. "match": {
  307. "method": "POST",
  308. "pathIncludes": "/messages",
  309. "bodyIncludes": ["E2E_RUNTIME_PERF_C", "PERF_CHILD_DONE_C"],
  310. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  311. },
  312. "response": {
  313. "statusCode": 200,
  314. "statusMessage": "OK",
  315. "headers": {
  316. "cache-control": "no-cache",
  317. "content-type": "text/event-stream; charset=utf-8"
  318. },
  319. "chunks": [
  320. { "offsetMs": 0, "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"runtime-perf-parent-c\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":192,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":0,\"service_tier\":\"standard\"}}}\n\n" },
  321. { "offsetMs": 250, "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n" },
  322. { "offsetMs": 500, "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"PERF_PARENT_STREAM_C_START after Agent tool result.\\n\"}}\n\n" },
  323. { "offsetMs": 3500, "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"Parent lane C continuation renders while other panes are active.\\n\"}}\n\n" },
  324. { "offsetMs": 7000, "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"More lane C markdown updates to keep React work alive.\\n\"}}\n\n" },
  325. { "offsetMs": 10000, "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"PERF_PARENT_DONE_C\"}}\n\n" },
  326. { "offsetMs": 10200, "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n" },
  327. { "offsetMs": 10300, "text": "event: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":192,\"output_tokens\":96,\"service_tier\":\"standard\"}}\n\n" },
  328. { "offsetMs": 10400, "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" }
  329. ]
  330. }
  331. },
  332. {
  333. "id": "runtime-perf-parent-tool-d",
  334. "description": "lane D 父请求触发 Agent tool_use。",
  335. "metadata": {
  336. "kind": "main",
  337. "timingPolicy": "fast-text",
  338. "source": "synthetic",
  339. "syntheticReason": "PERF02 需要稳定触发子智能体,父请求只负责产生 Agent tool。"
  340. },
  341. "maxMatches": 1,
  342. "match": {
  343. "method": "POST",
  344. "pathIncludes": "/messages",
  345. "lastUserMessageIncludes": ["E2E_RUNTIME_PERF_D"],
  346. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  347. },
  348. "response": {
  349. "statusCode": 200,
  350. "toolUse": {
  351. "id": "toolu_runtime_perf_d_agent",
  352. "name": "Agent",
  353. "input": {
  354. "description": "PERF02 lane D child stream",
  355. "prompt": "E2E_RUNTIME_PERF_CHILD_D: stream child result and finish with PERF_CHILD_DONE_D.",
  356. "subagent_type": "general-purpose"
  357. }
  358. }
  359. }
  360. },
  361. {
  362. "id": "runtime-perf-child-stream-d",
  363. "description": "lane D child subagent recorded stream。",
  364. "metadata": {
  365. "kind": "main",
  366. "timingPolicy": "recorded-stream",
  367. "source": "synthetic",
  368. "syntheticReason": "性能复现需要稳定的 child subagent streaming 窗口。"
  369. },
  370. "maxMatches": 1,
  371. "match": {
  372. "method": "POST",
  373. "pathIncludes": "/messages",
  374. "lastUserMessageIncludes": ["E2E_RUNTIME_PERF_CHILD_D"],
  375. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  376. },
  377. "response": {
  378. "statusCode": 200,
  379. "statusMessage": "OK",
  380. "headers": {
  381. "cache-control": "no-cache",
  382. "content-type": "text/event-stream; charset=utf-8"
  383. },
  384. "chunks": [
  385. { "offsetMs": 0, "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"runtime-perf-child-d\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":128,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":0,\"service_tier\":\"standard\"}}}\n\n" },
  386. { "offsetMs": 250, "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n" },
  387. { "offsetMs": 500, "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"PERF_CHILD_STREAM_D_START\\n\\n| lane | phase | status |\\n| --- | --- | --- |\\n\"}}\n\n" },
  388. { "offsetMs": 4000, "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"| D | child-stream | receiving tool context |\\n```ts\\nexport const laneD = 'child-stream-mid';\\n```\\n\"}}\n\n" },
  389. { "offsetMs": 8000, "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"Lane D child stream is still active with markdown, code, and table updates.\\n\"}}\n\n" },
  390. { "offsetMs": 12000, "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"PERF_CHILD_DONE_D\"}}\n\n" },
  391. { "offsetMs": 12200, "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n" },
  392. { "offsetMs": 12300, "text": "event: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":128,\"output_tokens\":96,\"service_tier\":\"standard\"}}\n\n" },
  393. { "offsetMs": 12400, "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" }
  394. ]
  395. }
  396. },
  397. {
  398. "id": "runtime-perf-parent-final-d",
  399. "description": "lane D 父会话收到 child tool_result 后的 recorded stream。",
  400. "metadata": {
  401. "kind": "main",
  402. "timingPolicy": "recorded-stream",
  403. "source": "synthetic",
  404. "syntheticReason": "性能复现需要父会话 continuation 也保持 streaming。"
  405. },
  406. "maxMatches": 1,
  407. "match": {
  408. "method": "POST",
  409. "pathIncludes": "/messages",
  410. "bodyIncludes": ["E2E_RUNTIME_PERF_D", "PERF_CHILD_DONE_D"],
  411. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  412. },
  413. "response": {
  414. "statusCode": 200,
  415. "statusMessage": "OK",
  416. "headers": {
  417. "cache-control": "no-cache",
  418. "content-type": "text/event-stream; charset=utf-8"
  419. },
  420. "chunks": [
  421. { "offsetMs": 0, "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"runtime-perf-parent-d\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":192,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":0,\"service_tier\":\"standard\"}}}\n\n" },
  422. { "offsetMs": 250, "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n" },
  423. { "offsetMs": 500, "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"PERF_PARENT_STREAM_D_START after Agent tool result.\\n\"}}\n\n" },
  424. { "offsetMs": 3500, "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"Parent lane D continuation renders while other panes are active.\\n\"}}\n\n" },
  425. { "offsetMs": 7000, "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"More lane D markdown updates to keep React work alive.\\n\"}}\n\n" },
  426. { "offsetMs": 10000, "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"PERF_PARENT_DONE_D\"}}\n\n" },
  427. { "offsetMs": 10200, "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n" },
  428. { "offsetMs": 10300, "text": "event: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":192,\"output_tokens\":96,\"service_tier\":\"standard\"}}\n\n" },
  429. { "offsetMs": 10400, "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" }
  430. ]
  431. }
  432. }
  433. ]
  434. }