conversation-session-r3-subagent.json 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-r3-subagent",
  4. "spec": "./test/e2e/conversation-session/remote/execution/conversation-session-r3-subagent.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "r3-sub-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_SUBAGENT"]
  20. },
  21. "response": {
  22. "statusCode": 200,
  23. "text": {
  24. "id": "r3-stale-title",
  25. "inputTokens": 64,
  26. "outputTokens": 8,
  27. "text": "{\"title\":\"R3 subagent\"}"
  28. }
  29. }
  30. },
  31. {
  32. "id": "r3-workflow-skill",
  33. "description": "远端工作流及辅助对话会话归属回归",
  34. "metadata": {
  35. "kind": "main",
  36. "timingPolicy": "fast-tool-use",
  37. "source": "synthetic",
  38. "syntheticReason": "固定模型输出,真实执行 Skill、CreateWorkflow 与远端子会话订阅。"
  39. },
  40. "maxMatches": 3,
  41. "match": {
  42. "method": "POST",
  43. "pathIncludes": "/messages",
  44. "bodyExcludes": [
  45. "Generate a concise title",
  46. "CRITICAL: Respond with TEXT ONLY",
  47. "You are now acting as the memory extraction subagent"
  48. ],
  49. "lastUserMessageIncludes": ["E2E_R3_WORKFLOW_START"]
  50. },
  51. "response": {
  52. "statusCode": 200,
  53. "toolUse": {
  54. "id": "toolu_r3_workflow_skill",
  55. "name": "Skill",
  56. "input": {
  57. "skill": "dynamic-workflows"
  58. }
  59. }
  60. }
  61. },
  62. {
  63. "id": "r3-workflow-create",
  64. "description": "远端工作流及辅助对话会话归属回归",
  65. "metadata": {
  66. "kind": "main",
  67. "timingPolicy": "fast-tool-use",
  68. "source": "synthetic",
  69. "syntheticReason": "固定模型输出,真实执行 Skill、CreateWorkflow 与远端子会话订阅。"
  70. },
  71. "maxMatches": 3,
  72. "match": {
  73. "method": "POST",
  74. "pathIncludes": "/messages",
  75. "bodyExcludes": [
  76. "Generate a concise title",
  77. "CRITICAL: Respond with TEXT ONLY",
  78. "You are now acting as the memory extraction subagent"
  79. ],
  80. "lastUserMessageIncludes": ["Writing dynamic workflows"],
  81. "bodyIncludes": ["E2E_R3_WORKFLOW_START"]
  82. },
  83. "response": {
  84. "statusCode": 200,
  85. "toolUse": {
  86. "id": "toolu_r3_workflow_create",
  87. "name": "CreateWorkflow",
  88. "input": {
  89. "name": "Remote workflow regression",
  90. "script": "return await agent(\"remote-reviewer\").ask(\"E2E_R3_WORKFLOW_CHILD: Reply exactly R3_WORKFLOW_CHILD_DONE\");",
  91. "subagent_model": "e2e-workflow-actors/GLM-5.3"
  92. }
  93. }
  94. }
  95. },
  96. {
  97. "id": "r3-workflow-started",
  98. "description": "远端工作流及辅助对话会话归属回归",
  99. "metadata": {
  100. "kind": "main",
  101. "timingPolicy": "fast-text",
  102. "source": "synthetic",
  103. "syntheticReason": "固定模型输出,真实执行 Skill、CreateWorkflow 与远端子会话订阅。"
  104. },
  105. "maxMatches": 3,
  106. "match": {
  107. "method": "POST",
  108. "pathIncludes": "/messages",
  109. "bodyExcludes": [
  110. "Generate a concise title",
  111. "CRITICAL: Respond with TEXT ONLY",
  112. "You are now acting as the memory extraction subagent"
  113. ],
  114. "lastUserMessageIncludes": ["run started in the background with ID:"],
  115. "bodyIncludes": ["E2E_R3_WORKFLOW_START"]
  116. },
  117. "response": {
  118. "statusCode": 200,
  119. "text": {
  120. "id": "r3-workflow-started",
  121. "text": "R3_WORKFLOW_STARTED"
  122. }
  123. }
  124. },
  125. {
  126. "id": "r3-workflow-child",
  127. "description": "远端工作流及辅助对话会话归属回归",
  128. "metadata": {
  129. "kind": "main",
  130. "timingPolicy": "fast-text",
  131. "source": "synthetic",
  132. "syntheticReason": "固定模型输出,真实执行 Skill、CreateWorkflow 与远端子会话订阅。"
  133. },
  134. "maxMatches": 3,
  135. "match": {
  136. "method": "POST",
  137. "pathIncludes": "/messages",
  138. "bodyExcludes": [
  139. "Generate a concise title",
  140. "CRITICAL: Respond with TEXT ONLY",
  141. "You are now acting as the memory extraction subagent"
  142. ],
  143. "lastUserMessageIncludes": ["E2E_R3_WORKFLOW_CHILD"]
  144. },
  145. "response": {
  146. "statusCode": 200,
  147. "text": {
  148. "id": "r3-workflow-child",
  149. "text": "R3_WORKFLOW_CHILD_DONE"
  150. }
  151. }
  152. },
  153. {
  154. "id": "r3-workflow-notification",
  155. "description": "远端工作流及辅助对话会话归属回归",
  156. "metadata": {
  157. "kind": "main",
  158. "timingPolicy": "fast-text",
  159. "source": "synthetic",
  160. "syntheticReason": "固定模型输出,真实执行 Skill、CreateWorkflow 与远端子会话订阅。"
  161. },
  162. "maxMatches": 3,
  163. "match": {
  164. "method": "POST",
  165. "pathIncludes": "/messages",
  166. "bodyExcludes": [
  167. "Generate a concise title",
  168. "CRITICAL: Respond with TEXT ONLY",
  169. "You are now acting as the memory extraction subagent"
  170. ],
  171. "lastUserMessageIncludes": ["workflow"],
  172. "bodyIncludes": ["E2E_R3_WORKFLOW_START", "R3_WORKFLOW_STARTED"]
  173. },
  174. "response": {
  175. "statusCode": 200,
  176. "text": {
  177. "id": "r3-workflow-notification",
  178. "text": "R3_WORKFLOW_COMPLETED"
  179. }
  180. }
  181. },
  182. {
  183. "id": "r3-side-chat",
  184. "description": "远端工作流及辅助对话会话归属回归",
  185. "metadata": {
  186. "kind": "main",
  187. "timingPolicy": "fast-text",
  188. "source": "synthetic",
  189. "syntheticReason": "固定模型输出,真实执行 Skill、CreateWorkflow 与远端子会话订阅。"
  190. },
  191. "maxMatches": 3,
  192. "match": {
  193. "method": "POST",
  194. "pathIncludes": "/messages",
  195. "bodyExcludes": [
  196. "Generate a concise title",
  197. "CRITICAL: Respond with TEXT ONLY",
  198. "You are now acting as the memory extraction subagent"
  199. ],
  200. "lastUserMessageIncludes": ["E2E_R3_SIDE_CHAT"]
  201. },
  202. "response": {
  203. "statusCode": 200,
  204. "text": {
  205. "id": "r3-side-chat",
  206. "text": "R3_SIDE_CHAT_DONE"
  207. }
  208. }
  209. },
  210. {
  211. "id": "r3-side-followup",
  212. "description": "远端工作流及辅助对话会话归属回归",
  213. "metadata": {
  214. "kind": "main",
  215. "timingPolicy": "fast-text",
  216. "source": "synthetic",
  217. "syntheticReason": "固定模型输出,真实执行 Skill、CreateWorkflow 与远端子会话订阅。"
  218. },
  219. "maxMatches": 3,
  220. "match": {
  221. "method": "POST",
  222. "pathIncludes": "/messages",
  223. "bodyExcludes": [
  224. "Generate a concise title",
  225. "CRITICAL: Respond with TEXT ONLY",
  226. "You are now acting as the memory extraction subagent"
  227. ],
  228. "lastUserMessageIncludes": ["E2E_R3_SIDE_FOLLOWUP"]
  229. },
  230. "response": {
  231. "statusCode": 200,
  232. "text": {
  233. "id": "r3-side-followup",
  234. "text": "R3_SIDE_FOLLOWUP_DONE"
  235. }
  236. }
  237. },
  238. {
  239. "id": "r3-sub-parent-cd",
  240. "description": "真实 Bash cd 后启动 Agent,验证绑定 workspace 不随执行 cwd 改变。",
  241. "metadata": {
  242. "kind": "main",
  243. "timingPolicy": "fast-tool-use",
  244. "source": "synthetic",
  245. "syntheticReason": "固定模型顺序,真实执行 cd 与 Agent,重启后打开同一 child。"
  246. },
  247. "maxMatches": 1,
  248. "match": {
  249. "method": "POST",
  250. "pathIncludes": "/messages",
  251. "bodyIncludes": ["E2E_R3_SUBAGENT_PARENT"],
  252. "bodyExcludes": [
  253. "Async agent launched successfully",
  254. "E2E_R3_SUBAGENT_PARENT2",
  255. "Generate a concise title",
  256. "CRITICAL: Respond with TEXT ONLY",
  257. "Verify whether the active session goal"
  258. ],
  259. "lastUserMessageIncludes": ["E2E_R3_SUBAGENT_PARENT"]
  260. },
  261. "response": {
  262. "statusCode": 200,
  263. "toolUse": {
  264. "id": "toolu_parent_cd",
  265. "name": "Bash",
  266. "input": {
  267. "command": "mkdir -p .zcode-e2e/cd-child && cd .zcode-e2e/cd-child && printf 'R3_PARENT_CD_DONE\\n'",
  268. "dangerouslyDisableSandbox": true
  269. }
  270. }
  271. }
  272. },
  273. {
  274. "id": "r3-sub-parent-agent",
  275. "description": "BG25: main launches a long-running background Agent.",
  276. "metadata": {
  277. "kind": "main",
  278. "timingPolicy": "fast-tool-use",
  279. "source": "synthetic",
  280. "syntheticReason": "稳定启动 background child,并用文件 barrier 保持 running 窗口。"
  281. },
  282. "maxMatches": 1,
  283. "match": {
  284. "method": "POST",
  285. "pathIncludes": "/messages",
  286. "bodyIncludes": ["E2E_R3_SUBAGENT_PARENT"],
  287. "bodyExcludes": [
  288. "Async agent launched successfully",
  289. "E2E_R3_SUBAGENT_PARENT2",
  290. "Generate a concise title",
  291. "CRITICAL: Respond with TEXT ONLY",
  292. "Verify whether the active session goal"
  293. ],
  294. "lastUserMessageIncludes": ["R3_PARENT_CD_DONE"]
  295. },
  296. "response": {
  297. "statusCode": 200,
  298. "toolUse": {
  299. "id": "toolu_r3_sub_agent",
  300. "name": "Agent",
  301. "input": {
  302. "description": "R3 remote subagent child",
  303. "prompt": "R3_SUBAGENT_CHILD_TASK: Run the Bash tool to wait for the release file, then reply R3_SUBAGENT_CHILD_DONE.",
  304. "run_in_background": true
  305. }
  306. }
  307. }
  308. },
  309. {
  310. "id": "r3-sub-parent-launched",
  311. "description": "O19: parent finishes the background Agent launch turn.",
  312. "metadata": {
  313. "kind": "main",
  314. "timingPolicy": "fast-text",
  315. "source": "synthetic",
  316. "syntheticReason": "先让 parent 启动 turn 回到 idle,再释放 child 输入错误,避免 completion notification 合流竞态。"
  317. },
  318. "maxMatches": 1,
  319. "match": {
  320. "method": "POST",
  321. "pathIncludes": "/messages",
  322. "bodyIncludes": ["E2E_R3_SUBAGENT_PARENT", "Async agent launched successfully"],
  323. "lastUserMessageIncludes": ["Async agent launched successfully"],
  324. "bodyExcludes": [
  325. "Generate a concise title",
  326. "CRITICAL: Respond with TEXT ONLY",
  327. "Verify whether the active session goal"
  328. ]
  329. },
  330. "response": {
  331. "statusCode": 200,
  332. "text": {
  333. "id": "r3-sub-parent-launched",
  334. "text": "R3_SUBAGENT_PARENT_LAUNCHED"
  335. }
  336. }
  337. },
  338. {
  339. "id": "r3-sub-child-bash",
  340. "description": "BG25: child starts a foreground Bash barrier before coordinator steer arrives.",
  341. "metadata": {
  342. "kind": "main",
  343. "timingPolicy": "controlled-tool-use",
  344. "source": "synthetic",
  345. "syntheticReason": "文件 barrier 稳定制造第一个 child tool call 尚未完成的 steer 窗口。"
  346. },
  347. "maxMatches": 1,
  348. "match": {
  349. "method": "POST",
  350. "pathIncludes": "/messages",
  351. "bodyIncludes": ["R3_SUBAGENT_CHILD_TASK"],
  352. "bodyExcludes": [
  353. "R3_SUBAGENT_CHILD_BASH_RELEASED",
  354. "Generate a concise title",
  355. "CRITICAL: Respond with TEXT ONLY",
  356. "Verify whether the active session goal"
  357. ],
  358. "lastUserMessageIncludes": ["R3_SUBAGENT_CHILD_TASK"]
  359. },
  360. "response": {
  361. "statusCode": 200,
  362. "toolUse": {
  363. "id": "toolu_r3_sub_child_bash",
  364. "name": "Bash",
  365. "input": {
  366. "command": "while [ ! -f '../r3-subagent/release-child' ]; do sleep 0.2; done; printf 'R3_SUBAGENT_CHILD_BASH_RELEASED\\n'",
  367. "description": "Wait for remote release file"
  368. }
  369. }
  370. }
  371. },
  372. {
  373. "id": "r3-sub-child-final",
  374. "description": "BG25: child finishes normally after continued work.",
  375. "metadata": {
  376. "kind": "main",
  377. "timingPolicy": "fast-text",
  378. "source": "synthetic",
  379. "syntheticReason": "证明 child 回复后继续普通工具,并最终通过正常 completion 收口。"
  380. },
  381. "maxMatches": 1,
  382. "match": {
  383. "method": "POST",
  384. "pathIncludes": "/messages",
  385. "bodyIncludes": ["R3_SUBAGENT_CHILD_BASH_RELEASED"],
  386. "bodyExcludes": [
  387. "Generate a concise title",
  388. "CRITICAL: Respond with TEXT ONLY",
  389. "Verify whether the active session goal"
  390. ]
  391. },
  392. "response": {
  393. "statusCode": 200,
  394. "text": {
  395. "id": "r3-sub-child-final",
  396. "text": "R3_SUBAGENT_CHILD_DONE"
  397. }
  398. }
  399. },
  400. {
  401. "id": "r3-sub-notification",
  402. "description": "BG25: parent consumes the child final completion notification.",
  403. "metadata": {
  404. "kind": "main",
  405. "timingPolicy": "task-notification",
  406. "source": "synthetic",
  407. "syntheticReason": "证明 child 最终仍通过标准 background completion notification 收口。"
  408. },
  409. "maxMatches": 4,
  410. "match": {
  411. "method": "POST",
  412. "pathIncludes": "/messages",
  413. "bodyIncludes": ["<task-notification>"],
  414. "bodyExcludes": [
  415. "Generate a concise title",
  416. "CRITICAL: Respond with TEXT ONLY",
  417. "Verify whether the active session goal"
  418. ],
  419. "lastUserMessageIncludes": ["<task-notification>"]
  420. },
  421. "response": {
  422. "statusCode": 200,
  423. "text": {
  424. "id": "r3-sub-notification",
  425. "text": "R3_SUBAGENT_NOTIFICATION_CONSUMED"
  426. }
  427. }
  428. },
  429. {
  430. "id": "r3-sub-memory-noop",
  431. "description": "BG25/O18: background Main memory extraction remains non-semantic for this renderer case.",
  432. "metadata": {
  433. "kind": "main",
  434. "timingPolicy": "fast-text",
  435. "source": "synthetic",
  436. "syntheticReason": "Memory extraction 默认在成功 Main turn 后异步运行;本 case 仅用 Nothing to save 收口,避免隐藏请求干扰严格 replay,不扩展 Memory 产品语义。"
  437. },
  438. "maxMatches": 8,
  439. "match": {
  440. "method": "POST",
  441. "pathIncludes": "/messages",
  442. "bodyIncludes": ["You are now acting as the memory extraction subagent"]
  443. },
  444. "response": {
  445. "statusCode": 200,
  446. "text": {
  447. "id": "deepseek-e2e-subagent-response-memory-extraction-noop",
  448. "text": "Nothing to save."
  449. }
  450. }
  451. },
  452. {
  453. "id": "r3-sub-parent2-slow",
  454. "description": "Model A 慢回合",
  455. "metadata": {
  456. "kind": "main",
  457. "timingPolicy": "controlled-stream",
  458. "source": "synthetic",
  459. "syntheticReason": "在明确点击父会话 Stop 前保持运行窗口,停止需真实取消流,不能依赖45秒自然完成。"
  460. },
  461. "maxMatches": 2,
  462. "match": {
  463. "method": "POST",
  464. "pathIncludes": "/messages",
  465. "lastUserMessageIncludes": ["E2E_R3_SUBAGENT_PARENT2"],
  466. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  467. },
  468. "response": {
  469. "statusCode": 200,
  470. "statusMessage": "OK",
  471. "headers": {
  472. "cache-control": "no-cache",
  473. "content-type": "text/event-stream; charset=utf-8"
  474. },
  475. "chunks": [
  476. {
  477. "offsetMs": 0,
  478. "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"r3-stale-slow\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"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"
  479. },
  480. {
  481. "offsetMs": 250,
  482. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
  483. },
  484. {
  485. "offsetMs": 500,
  486. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"R3_SUBAGENT_PARENT2_STREAMING \"}}\n\n"
  487. },
  488. {
  489. "offsetMs": 45000,
  490. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
  491. },
  492. {
  493. "offsetMs": 45100,
  494. "text": "event: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":80,\"output_tokens\":4,\"service_tier\":\"standard\"}}\n\n"
  495. },
  496. {
  497. "offsetMs": 45200,
  498. "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  499. }
  500. ],
  501. "text": {
  502. "id": "v4-queue-slow",
  503. "inputTokens": 80,
  504. "outputTokens": 4,
  505. "text": "V4_QUEUE_STREAMING"
  506. },
  507. "releaseAfterChunks": 3
  508. }
  509. },
  510. {
  511. "id": "r3-sub-main",
  512. "description": "其它",
  513. "metadata": {
  514. "kind": "main",
  515. "timingPolicy": "fast-text",
  516. "source": "synthetic",
  517. "syntheticReason": "首发/fork/edit"
  518. },
  519. "maxMatches": 12,
  520. "match": {
  521. "method": "POST",
  522. "pathIncludes": "/messages",
  523. "bodyIncludes": ["E2E_R3_SUBAGENT_A_FIRST_PROMPT"],
  524. "bodyExcludes": [
  525. "E2E_R3_SUBAGENT_PARENT",
  526. "Generate a concise title",
  527. "CRITICAL: Respond with TEXT ONLY",
  528. "Verify whether the active session goal"
  529. ],
  530. "lastUserMessageIncludes": ["E2E_R3_SUBAGENT_A_FIRST_PROMPT"]
  531. },
  532. "response": {
  533. "statusCode": 200,
  534. "text": {
  535. "id": "r3-stale-main",
  536. "inputTokens": 64,
  537. "outputTokens": 8,
  538. "text": "R3_SUBAGENT_REPLY"
  539. }
  540. }
  541. }
  542. ]
  543. }