conversation-session-subagent-runtime-refresh.json 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-subagent-runtime-refresh",
  4. "spec": "./test/e2e/conversation-session/subagents/conversation-session-subagent-runtime-refresh.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "shr-title",
  8. "description": "shr-title",
  9. "metadata": {
  10. "kind": "common",
  11. "source": "synthetic",
  12. "timingPolicy": "fast-text",
  13. "syntheticReason": "固定工具调用和模型响应,以实际 provider 请求验证父上下文快照、Settings 保存及失败 child 恢复。"
  14. },
  15. "maxMatches": 1,
  16. "match": {
  17. "method": "POST",
  18. "pathIncludes": "/messages",
  19. "bodyIncludes": ["Generate a concise title", "E2E_SHR_FAIL_PARENT"]
  20. },
  21. "response": {
  22. "statusCode": 200,
  23. "headers": {
  24. "content-type": "application/json; charset=utf-8"
  25. },
  26. "body": "{\"id\":\"shr-title\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[{\"type\":\"text\",\"text\":\"{\\\"title\\\":\\\"Subagent runtime refresh\\\"}\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":32,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":12,\"service_tier\":\"standard\"}}"
  27. }
  28. },
  29. {
  30. "id": "shr-fail-parent-tool",
  31. "description": "shr-fail-parent-tool",
  32. "metadata": {
  33. "kind": "main",
  34. "source": "synthetic",
  35. "timingPolicy": "fast-text",
  36. "syntheticReason": "固定工具调用和模型响应,以实际 provider 请求验证父上下文快照、Settings 保存及失败 child 恢复。"
  37. },
  38. "maxMatches": 1,
  39. "match": {
  40. "method": "POST",
  41. "pathIncludes": "/messages",
  42. "lastUserMessageIncludes": ["E2E_SHR_FAIL_PARENT"],
  43. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  44. },
  45. "response": {
  46. "statusCode": 200,
  47. "toolUse": {
  48. "id": "toolu_shr_fail",
  49. "name": "Agent",
  50. "inputTokens": 32,
  51. "input": {
  52. "description": "Runtime refresh fail",
  53. "prompt": "E2E_SHR_FAIL_CHILD",
  54. "subagent_type": "e2e-runtime-reviewer",
  55. "run_in_background": true
  56. }
  57. }
  58. }
  59. },
  60. {
  61. "id": "shr-fail-child",
  62. "description": "shr-fail-child",
  63. "metadata": {
  64. "kind": "subagent",
  65. "source": "synthetic",
  66. "timingPolicy": "fault-stream",
  67. "syntheticReason": "固定工具调用和模型响应,以实际 provider 请求验证父上下文快照、Settings 保存及失败 child 恢复。"
  68. },
  69. "maxMatches": 1,
  70. "match": {
  71. "method": "POST",
  72. "pathIncludes": "/messages",
  73. "lastUserMessageIncludes": ["E2E_SHR_FAIL_CHILD"],
  74. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  75. },
  76. "response": {
  77. "statusCode": 400,
  78. "delayMs": 2000,
  79. "headers": {
  80. "content-type": "application/json"
  81. },
  82. "body": "{\"type\": \"error\", \"error\": {\"type\": \"invalid_request_error\", \"message\": \"E2E_SHR_INVALID_MODEL_CONFIGURATION\"}}"
  83. }
  84. },
  85. {
  86. "id": "shr-fail-parent-final",
  87. "description": "shr-fail-parent-final",
  88. "metadata": {
  89. "kind": "main",
  90. "source": "synthetic",
  91. "timingPolicy": "fast-text",
  92. "syntheticReason": "固定工具调用和模型响应,以实际 provider 请求验证父上下文快照、Settings 保存及失败 child 恢复。"
  93. },
  94. "maxMatches": 1,
  95. "match": {
  96. "method": "POST",
  97. "pathIncludes": "/messages",
  98. "bodyIncludes": ["E2E_SHR_FAIL_PARENT", "agentId: agent_"],
  99. "bodyExcludes": [
  100. "Generate a concise title",
  101. "CRITICAL: Respond with TEXT ONLY",
  102. "E2E_SHR_RESUME_PARENT"
  103. ]
  104. },
  105. "response": {
  106. "statusCode": 200,
  107. "text": {
  108. "id": "shr-fail-parent-final",
  109. "inputTokens": 32,
  110. "text": "E2E_SHR_FAIL_PARENT_DONE"
  111. }
  112. }
  113. },
  114. {
  115. "id": "shr-stable-parent-tool",
  116. "description": "shr-stable-parent-tool",
  117. "metadata": {
  118. "kind": "main",
  119. "source": "synthetic",
  120. "timingPolicy": "controlled-stream",
  121. "syntheticReason": "固定工具调用和模型响应,以实际 provider 请求验证父上下文快照、Settings 保存及失败 child 恢复。"
  122. },
  123. "maxMatches": 1,
  124. "match": {
  125. "method": "POST",
  126. "pathIncludes": "/messages",
  127. "lastUserMessageIncludes": ["E2E_SHR_STABLE_PARENT"],
  128. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  129. },
  130. "response": {
  131. "statusCode": 200,
  132. "toolUse": {
  133. "id": "toolu_shr_stable",
  134. "name": "Agent",
  135. "inputTokens": 32,
  136. "input": {
  137. "description": "Runtime refresh stable",
  138. "prompt": "E2E_SHR_STABLE_CHILD",
  139. "subagent_type": "e2e-runtime-reviewer",
  140. "run_in_background": false
  141. }
  142. },
  143. "delayMs": 40000
  144. }
  145. },
  146. {
  147. "id": "shr-stable-child",
  148. "description": "shr-stable-child",
  149. "metadata": {
  150. "kind": "subagent",
  151. "source": "synthetic",
  152. "timingPolicy": "fast-text",
  153. "syntheticReason": "固定工具调用和模型响应,以实际 provider 请求验证父上下文快照、Settings 保存及失败 child 恢复。"
  154. },
  155. "maxMatches": 1,
  156. "match": {
  157. "method": "POST",
  158. "pathIncludes": "/messages",
  159. "lastUserMessageIncludes": ["E2E_SHR_STABLE_CHILD"],
  160. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  161. },
  162. "response": {
  163. "statusCode": 200,
  164. "text": {
  165. "id": "shr-stable-child",
  166. "inputTokens": 32,
  167. "text": "E2E_SHR_STABLE_CHILD_DONE"
  168. }
  169. }
  170. },
  171. {
  172. "id": "shr-stable-parent-final",
  173. "description": "shr-stable-parent-final",
  174. "metadata": {
  175. "kind": "main",
  176. "source": "synthetic",
  177. "timingPolicy": "fast-text",
  178. "syntheticReason": "固定工具调用和模型响应,以实际 provider 请求验证父上下文快照、Settings 保存及失败 child 恢复。"
  179. },
  180. "maxMatches": 1,
  181. "match": {
  182. "method": "POST",
  183. "pathIncludes": "/messages",
  184. "bodyIncludes": ["toolu_shr_stable", "E2E_SHR_STABLE_CHILD_DONE", "agentId: agent_"],
  185. "bodyExcludes": [
  186. "Generate a concise title",
  187. "CRITICAL: Respond with TEXT ONLY",
  188. "E2E_SHR_NEXT_PARENT"
  189. ]
  190. },
  191. "response": {
  192. "statusCode": 200,
  193. "text": {
  194. "id": "shr-stable-parent-final",
  195. "inputTokens": 32,
  196. "text": "E2E_SHR_STABLE_PARENT_DONE"
  197. }
  198. }
  199. },
  200. {
  201. "id": "shr-next-parent-tool",
  202. "description": "shr-next-parent-tool",
  203. "metadata": {
  204. "kind": "main",
  205. "source": "synthetic",
  206. "timingPolicy": "fast-text",
  207. "syntheticReason": "固定工具调用和模型响应,以实际 provider 请求验证父上下文快照、Settings 保存及失败 child 恢复。"
  208. },
  209. "maxMatches": 1,
  210. "match": {
  211. "method": "POST",
  212. "pathIncludes": "/messages",
  213. "lastUserMessageIncludes": ["E2E_SHR_NEXT_PARENT"],
  214. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  215. },
  216. "response": {
  217. "statusCode": 200,
  218. "toolUse": {
  219. "id": "toolu_shr_next",
  220. "name": "Agent",
  221. "inputTokens": 32,
  222. "input": {
  223. "description": "Runtime refresh next",
  224. "prompt": "E2E_SHR_NEXT_CHILD",
  225. "subagent_type": "e2e-runtime-reviewer",
  226. "run_in_background": false
  227. }
  228. }
  229. }
  230. },
  231. {
  232. "id": "shr-next-child",
  233. "description": "shr-next-child",
  234. "metadata": {
  235. "kind": "subagent",
  236. "source": "synthetic",
  237. "timingPolicy": "fast-text",
  238. "syntheticReason": "固定工具调用和模型响应,以实际 provider 请求验证父上下文快照、Settings 保存及失败 child 恢复。"
  239. },
  240. "maxMatches": 1,
  241. "match": {
  242. "method": "POST",
  243. "pathIncludes": "/messages",
  244. "lastUserMessageIncludes": ["E2E_SHR_NEXT_CHILD"],
  245. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  246. },
  247. "response": {
  248. "statusCode": 200,
  249. "text": {
  250. "id": "shr-next-child",
  251. "inputTokens": 32,
  252. "text": "E2E_SHR_NEXT_CHILD_DONE"
  253. }
  254. }
  255. },
  256. {
  257. "id": "shr-next-parent-final",
  258. "description": "shr-next-parent-final",
  259. "metadata": {
  260. "kind": "main",
  261. "source": "synthetic",
  262. "timingPolicy": "fast-text",
  263. "syntheticReason": "固定工具调用和模型响应,以实际 provider 请求验证父上下文快照、Settings 保存及失败 child 恢复。"
  264. },
  265. "maxMatches": 1,
  266. "match": {
  267. "method": "POST",
  268. "pathIncludes": "/messages",
  269. "bodyIncludes": ["toolu_shr_next", "E2E_SHR_NEXT_CHILD_DONE", "agentId: agent_"],
  270. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  271. },
  272. "response": {
  273. "statusCode": 200,
  274. "text": {
  275. "id": "shr-next-parent-final",
  276. "inputTokens": 32,
  277. "text": "E2E_SHR_NEXT_PARENT_DONE"
  278. }
  279. }
  280. },
  281. {
  282. "id": "shr-failure-notification",
  283. "description": "shr-failure-notification",
  284. "metadata": {
  285. "kind": "main",
  286. "source": "synthetic",
  287. "timingPolicy": "fast-text",
  288. "syntheticReason": "固定工具调用和模型响应,以实际 provider 请求验证父上下文快照、Settings 保存及失败 child 恢复。"
  289. },
  290. "maxMatches": 1,
  291. "match": {
  292. "method": "POST",
  293. "pathIncludes": "/messages",
  294. "lastUserMessageIncludes": ["<task-notification>", "<status>failed</status>"],
  295. "bodyIncludes": ["E2E_SHR_FAIL_PARENT"],
  296. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  297. },
  298. "response": {
  299. "statusCode": 200,
  300. "text": {
  301. "id": "shr-failure-notification",
  302. "inputTokens": 32,
  303. "text": "E2E_SHR_FAILURE_NOTED"
  304. }
  305. }
  306. },
  307. {
  308. "id": "shr-resume-parent-tool",
  309. "description": "shr-resume-parent-tool",
  310. "metadata": {
  311. "kind": "main",
  312. "source": "synthetic",
  313. "timingPolicy": "fast-text",
  314. "syntheticReason": "固定工具调用和模型响应,以实际 provider 请求验证父上下文快照、Settings 保存及失败 child 恢复。"
  315. },
  316. "maxMatches": 1,
  317. "match": {
  318. "method": "POST",
  319. "pathIncludes": "/messages",
  320. "lastUserMessageIncludes": ["E2E_SHR_RESUME_PARENT"],
  321. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  322. },
  323. "response": {
  324. "statusCode": 200,
  325. "toolUse": {
  326. "id": "toolu_shr_resume",
  327. "name": "SendMessage",
  328. "inputTokens": 32,
  329. "input": {
  330. "to": "{{latestAgentId}}",
  331. "summary": "Retry corrected profile",
  332. "message": "E2E_SHR_RESUME_CHILD"
  333. }
  334. }
  335. }
  336. },
  337. {
  338. "id": "shr-resume-child",
  339. "description": "shr-resume-child",
  340. "metadata": {
  341. "kind": "subagent",
  342. "source": "synthetic",
  343. "timingPolicy": "controlled-stream",
  344. "syntheticReason": "固定工具调用和模型响应,以实际 provider 请求验证父上下文快照、Settings 保存及失败 child 恢复。"
  345. },
  346. "maxMatches": 1,
  347. "match": {
  348. "method": "POST",
  349. "pathIncludes": "/messages",
  350. "lastUserMessageIncludes": ["E2E_SHR_RESUME_CHILD"],
  351. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  352. },
  353. "response": {
  354. "statusCode": 200,
  355. "text": {
  356. "id": "shr-resume-child",
  357. "inputTokens": 32,
  358. "text": "E2E_SHR_RESUME_CHILD_DONE"
  359. },
  360. "delayMs": 2000
  361. }
  362. },
  363. {
  364. "id": "shr-resume-parent-final",
  365. "description": "shr-resume-parent-final",
  366. "metadata": {
  367. "kind": "main",
  368. "source": "synthetic",
  369. "timingPolicy": "fast-text",
  370. "syntheticReason": "固定工具调用和模型响应,以实际 provider 请求验证父上下文快照、Settings 保存及失败 child 恢复。"
  371. },
  372. "maxMatches": 1,
  373. "match": {
  374. "method": "POST",
  375. "pathIncludes": "/messages",
  376. "bodyIncludes": ["E2E_SHR_RESUME_PARENT", "resumed it in the background"],
  377. "bodyExcludes": [
  378. "Generate a concise title",
  379. "CRITICAL: Respond with TEXT ONLY",
  380. "E2E_SHR_STABLE_PARENT"
  381. ]
  382. },
  383. "response": {
  384. "statusCode": 200,
  385. "text": {
  386. "id": "shr-resume-parent-final",
  387. "inputTokens": 32,
  388. "text": "E2E_SHR_RESUME_PARENT_DONE"
  389. }
  390. }
  391. },
  392. {
  393. "id": "shr-resume-notification",
  394. "description": "shr-resume-notification",
  395. "metadata": {
  396. "kind": "main",
  397. "source": "synthetic",
  398. "timingPolicy": "fast-text",
  399. "syntheticReason": "固定工具调用和模型响应,以实际 provider 请求验证父上下文快照、Settings 保存及失败 child 恢复。"
  400. },
  401. "maxMatches": 1,
  402. "match": {
  403. "method": "POST",
  404. "pathIncludes": "/messages",
  405. "lastUserMessageIncludes": ["<task-notification>", "<status>completed</status>"],
  406. "bodyIncludes": ["E2E_SHR_RESUME_PARENT"],
  407. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  408. },
  409. "response": {
  410. "statusCode": 200,
  411. "text": {
  412. "id": "shr-resume-notification",
  413. "inputTokens": 32,
  414. "text": "E2E_SHR_RESUME_NOTED"
  415. }
  416. }
  417. },
  418. {
  419. "id": "shr-compact",
  420. "description": "shr-compact",
  421. "metadata": {
  422. "kind": "common",
  423. "source": "synthetic",
  424. "timingPolicy": "fast-text",
  425. "syntheticReason": "固定工具调用和模型响应,以实际 provider 请求验证父上下文快照、Settings 保存及失败 child 恢复。"
  426. },
  427. "match": {
  428. "method": "POST",
  429. "pathIncludes": "/messages",
  430. "bodyIncludes": ["CRITICAL: Respond with TEXT ONLY", "E2E_SHR_FAIL_PARENT"]
  431. },
  432. "response": {
  433. "statusCode": 200,
  434. "text": {
  435. "id": "shr-compact",
  436. "inputTokens": 32,
  437. "text": "Preserve original failed child and recovery. agentId: {{latestAgentId}}. E2E_SHR_FAIL_PARENT E2E_SHR_RESUME_PARENT."
  438. }
  439. }
  440. }
  441. ]
  442. }